Skip to content

fix(mobile): preserve live content during loading and reconnect - #5652

Open
iscekic wants to merge 4 commits into
mobile-live-loading-2be5-s2from
mobile-live-loading-2be5-s3
Open

fix(mobile): preserve live content during loading and reconnect#5652
iscekic wants to merge 4 commits into
mobile-live-loading-2be5-s2from
mobile-live-loading-2be5-s3

Conversation

@iscekic

@iscekic iscekic commented Aug 28, 2026

Copy link
Copy Markdown
Contributor
  • Home loads and refreshes live sessions without waiting for session history; its preview no longer fills gaps from saved sessions.
  • When access remains valid, Home and Agents keep sessions visible during refreshes, temporary failures, and reconnection.
  • Home and Agents show Personal or your organization name. “Nothing running right now” appears only after the selected list loads successfully.
  • Loading, Updating, Connecting, Reconnecting, Connection lost, and No internet connection appear separately from each agent's activity. Connection lost offers its own Retry button.
  • Retry retains screen-reader focus and avoids duplicate failure announcements; initial loading also gives screen-reader feedback.
  • Home keeps the Live now heading during loading. After your account selection loads, new-task actions remain available even when session loading fails.
  • You can retry an organization load failure; unavailable organizations and denied sessions instead offer Back to profile.
  • PR Review remains available while organization membership loads or fails; Code Reviewer and Security Agent wait for a confirmed selection.

Summary

useLiveSessionContext supplies LiveSessionContext for authenticated personal or confirmed organization selections; liveSessionContent requires hasAcceptedSuccess for emptiness and hides rows after non-retryable errors.
AgentSessionsSection now accepts LiveSessionProps (context, sessions); removing buildRows also removes stored-session fallback and keeps the preview limited to three live rows.
LiveSessionFeedback separates query progress, internet loss, and socket recovery from agent run state, preserving rows and retry focus or offering Profile recovery.

Files
  • apps/mobile/src/components/home/agent-sessions-section.tsx — Source; modified; 346 changed lines. Adds authentication and membership checks plus Personal or organization labels. Keeps readable rows through retryable failures. Separates membership retries from session retries with a submit lock and persistent busy controls. Offers Profile recovery for unavailable selections and non-retryable errors, with permission, not-found, or neutral messages. Announces initial loading and distinguishes Connecting, Reconnecting, and Connection lost, with an independent connection retry when automatic retries stop. Suppresses active progress during paused requests; the global offline banner still owns the offline announcement. Keeps keyed live cards and existing See all navigation; makes HOME_LIVE_SLOT_MIN_CLASS private.
  • apps/mobile/src/components/home/agent-sessions-section.test.ts — Test; modified; 343 changed lines. Updates the section test suite.

Home now owns one useLiveAgentSessions result, so stored-history loading and failures no longer block the live preview.
Pull-to-refresh calls its refetch instead of invalidating every active query.
HomeScreen keeps the layout mounted; context.isReady controls New coding task, while accountReady allows product choices during membership loading or failure.

Files
  • apps/mobile/src/components/home/home-screen.tsx — Source; modified; 110 changed lines. Passes the live result and context to the section instead of querying stored history. Removes history-dependent errors and whole-screen loading branches. Removes the loading/content fade swaps while retaining layout transitions. Separates action readiness from session requests and narrows pull-to-refresh to live sessions.
  • apps/mobile/src/components/home/home-screen.mounted.test.tsx — Test; modified; 730 changed lines. Updates the mounted Home screen suite.
  • apps/mobile/src/components/home/home-screen.test.ts — Test; modified; 2 changed lines. Updates the Home screen test suite.

AgentSessionListScreen adopts the shared content states and LiveSessionFeedback, retaining readable rows during pending requests and retryable failures.
context.isReady gates creation; confirmed emptiness uses the inline button, while every other ready state keeps the floating button.
Inline failure announcements replace refresh-error toasts without changing history navigation, focused foreground refresh, attention updates, or scroll retention.

Files
  • apps/mobile/src/components/agents/session-list-screen.tsx — Source; modified; 64 changed lines. Places shared feedback outside the list and uses accepted results to choose loading, empty, error, or rows. Keeps the list mounted during refreshes and reconnects. Extends creation access to pending and error states for ready contexts and adds an accessibility label to the empty-state button. Removes the duplicate refresh-failure toast.
  • apps/mobile/src/components/agents/session-list-screen.mounted.test.tsx — Test; modified; 1,068 changed lines. Updates the mounted live-list suite.

ProductChoicesProps now requires contextReady for Code Reviewer and Security Agent, so unresolved organization selections cannot open scoped tools.
PR Review remains available after account readiness, independent of membership loading or failure, under the existing FEATURE_FLAG_PR_REVIEW.
If neither scoped tools nor PR Review can appear, ProductChoices omits Explore; callers must supply the readiness value.

Files
  • apps/mobile/src/components/home/product-choices.tsx — Source; modified; 48 changed lines. Adds the required readiness prop and conditionally shows scoped rows. Keeps the personal and organization routes, the PR Review route, and the existing flag default unchanged.
  • apps/mobile/src/components/home/product-choices.mounted.test.tsx — Test; modified; 4 changed lines. Updates the mounted product-choice suite.

The new agents.sessionList.updating message displays “Updating” when readable rows have an active, unpaused fetch.
This distinguishes background query work from connection notices and agent run state.
Only English gains the message; final translations remain pending.

Files
  • apps/mobile/src/i18n/locales/en.json — Source; modified; 1 added line. Adds the English text for the background-refresh notice.

Tests: 5 files modified: session-list-screen.mounted.test.tsx, agent-sessions-section.test.ts, home-screen.mounted.test.tsx, home-screen.test.ts, and product-choices.mounted.test.tsx (2,147 changed lines).
Generated: 0 files changed.


Verification

  • No manual tests ran for this level; runtime verification is pending on the stack tip.
  • No end-to-end (E2E) report accompanies this level.

Visual Changes

Visual Changes: N/A

Reviewer Notes

Human steps

  • before merge: Wait for all human-ready labels.
  • before merge: Review each pull request (PR).
  • before merge: Merge cloud#5641, then cloud#5649, then this PR. Do not merge automatically.
  • before merge: The workflow must complete the non-English translations for “Updating” before human-ready.
  • after merge: No environment changes, secrets, migrations, flag changes, or cache resets are required.

Evidence and scope

  • The handoff reports 85 passing focused presentation tests. Hosted continuous integration (CI) remains unverified.
  • Scope: level 3 of Kilo-Org/cloud; base mobile-live-loading-2be5-s2, head mobile-live-loading-2be5-s3, commit b88eafb15c5b3920fa4725820dd2e41d5492db20.
  • Worktree: /Users/igor/Projects/.worktrees/mobile-live-loading-2be5.

Notes

Runtime verification is pending on the stack tip; this level has focused test coverage only.

Stacked PRs — merge bottom to top. Each level shows only its own diff.

Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.

  1. mobile-live-loading-2be5fix(mobile): serialize development account replacement #5641
  2. mobile-live-loading-2be5-s2fix(mobile): track accepted live query outcomes #5649
  3. mobile-live-loading-2be5-s3fix(mobile): preserve live content during loading and reconnect #5652 ← this PR (tip)

@kilo-code-bot

kilo-code-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/components/home/agent-sessions-section.tsx 164 Conditionally inserting QueryError remounts Retry and re-announces the failure
Files Reviewed (10 files)
  • apps/mobile/src/components/home/agent-sessions-section.tsx - 1 issue
  • apps/mobile/src/components/home/agent-sessions-section.test.ts
  • apps/mobile/src/components/home/home-screen.tsx
  • apps/mobile/src/components/home/home-screen.mounted.test.tsx
  • apps/mobile/src/components/home/home-screen.test.ts
  • apps/mobile/src/components/home/product-choices.tsx
  • apps/mobile/src/components/home/product-choices.mounted.test.tsx
  • apps/mobile/src/components/agents/session-list-screen.tsx
  • apps/mobile/src/components/agents/session-list-screen.mounted.test.tsx
  • apps/mobile/src/i18n/locales/en.json
Previous Review Summary (commit b88eafb)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit b88eafb)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/components/home/agent-sessions-section.tsx 164 Conditionally inserting QueryError remounts Retry and re-announces the failure
Files Reviewed (10 files)
  • apps/mobile/src/components/home/agent-sessions-section.tsx - 1 issue
  • apps/mobile/src/components/home/agent-sessions-section.test.ts
  • apps/mobile/src/components/home/home-screen.tsx
  • apps/mobile/src/components/home/home-screen.mounted.test.tsx
  • apps/mobile/src/components/home/home-screen.test.ts
  • apps/mobile/src/components/home/product-choices.tsx
  • apps/mobile/src/components/home/product-choices.mounted.test.tsx
  • apps/mobile/src/components/agents/session-list-screen.tsx
  • apps/mobile/src/components/agents/session-list-screen.mounted.test.tsx
  • apps/mobile/src/i18n/locales/en.json

Reviewed by grok-4.6 · Input: 294.6K · Output: 19K · Cached: 590.5K

Review guidance: REVIEW.md from base branch mobile-live-loading-2be5-s2

@iscekic

iscekic commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

(bot) BLOCKED: mobile-live-loading-2be5

BLOCKED

Final section report

A human must review the retained workflow repair and its five capability failures before a reviewed merge.
The supported account-bearing mobile-opening helper cannot resolve @kilocode/db.
The workflow-fixer rule forbids more validation after the recorded capability limit.

Required action

Review the staged workflow patch:

git -C "/Users/igor/Projects/.worktrees/workflow-source-paths-20260828" diff --cached

Review its preserved failure evidence at dev/drills/results.tsv:5303–5338 in that worktree.
The retained branch is fix/source-paths-20260828; it has five staged files and no commit or PR.
After an approved workflow repair lands, retry account-bearing opening in a fresh E2E bundle.
The section then needs the remaining verification and delivery gates.
Do not merge the product PRs yet.

Verified delivery state

Product worktree: /Users/igor/Projects/.worktrees/mobile-live-loading-2be5.
Current branch: mobile-live-loading-2be5-s3.
Current head: a9c9ec6c97f8657043d4a18f28787dfccf9fecee.
The worktree is clean; all product changes are committed and pushed.

Level PR Current head Mechanical gate
1 #5641 ae161ba Typecheck red; mergeability unknown; threads unreadable
2 #5649 4608e01 Lint/typecheck red; mergeable; threads unreadable
3 #5652 a9c9ec6 Lint/typecheck/i18n-leftover red; mergeable; threads unreadable

No PR has the human-ready label.
Existing assignments on levels 1 and 2 predate this generation; level 3 remains unassigned.
No product PR was merged or sent for human review.
GraphQL rate limits prevent thread enumeration; unknown thread state is not a waiver.
The newest level-3 bot summary reports one Retry remount finding; it remains untriaged.
CI failures remain undiagnosed; they are unfinished findings, not the reason for this terminal result.

Work completed

  • Verified a1, a2, and a3 in the drive ledger and their pushed commits.
  • Verified UX repair b88eafb and the fresh USER EXPERIENCE APPROVED result.
  • Recovered the first blocked backend and iOS verifier verdicts; no complete runtime case passed.
  • Restored the stopped host OrbStack application without resetting data or stopping foreign resources.
  • Removed the first bundle's owned containers and confirmed cleanup.
  • Recovered the completed simplify pass and accepted all three concrete deletions.
  • Landed level-1 cleanup reuse as ae161ba with No findings and four passing scoped checks.
  • Landed level-2 test-helper reuse as 2b65e3a with No findings and four passing scoped checks.
  • Landed level-3 obsolete mock removal as 707a554 with No findings and four passing scoped checks.
  • Propagated the repairs through all three stack levels with STACK FORWARD OK.
  • Started a fresh bundle, seeded both accounts and an organization, and completed Home preparation.

Acceptance outcomes

Implementation and mounted tests cover the planned state matrices and safety fences.
Scoped checks passed for every simplification.
Text-only user approval remains applicable; the simplifications change no visible behavior.
Home preparation proves only that the signed-in surface opens and shows LIVE NOW.
The account-bearing helper failed; the login/tab workaround does not prove development admission.
No r2 verifier ran, no live session was created, and no temporary transport control was installed.
Native Offline, authenticated backend scenarios, controlled faults, context/account transitions, and device accessibility remain unproved.
The section does not satisfy the runtime or completion gate.

Repair evidence and counters

  • Original slices: a1 landed; a2 used two implementation rounds plus cleanup; a3 used two rounds.
  • UX repair used three implementation rounds and a clean bounded recheck.
  • Simplification used one pass and one clean repair/review round on each owning level.
  • First verification bundle: backend-r1 and ios-core-r1 both returned VERIFICATION BLOCKED; one blocked round total.
  • Second bundle: stopped during preparation; no verifier verdict or new blocked-verifier count.
  • Mobile-opening workflow repair: one dead dispatch, one finished blocked repair, and one sharper blocked continuation.
  • The first finished repair passed its targeted runtime drill 5/5 and 68 tests.
  • Required supplemental validation reached five capability failures; retained evidence remains unchanged.
  • The continuation confirmed the binding stop rule at workflow-fixer.md:157 and ran no further drills.
  • No product takeover, rejected finding, consultant call, translation pass, CI repair, or completed Kilobot iteration occurred here.

Relevant evidence:

  • e2e-prep-r2.md and e2e-r2-aborted.md.
  • mobile-open-fixer-final.json.
  • workflow-fixer-fix-mobile-open-r2-lkQTII.log through log-digest.sh.
  • gates-blocked/gate-5641.txt, gate-5649.txt, and gate-5652.txt through log-digest.sh.
  • decisions.md and resources.md.

Remaining work after the blocker clears

Retry the account-bearing helper and run fresh preparation.
Complete every pending iOS and backend scenario without substituting mocks for required live evidence.
Complete CI diagnosis, bot finding disposition, and thread enumeration on every current head.
Translate the recorded English key on level 3 through the required translation pass.
Refresh every PR description and pass every completion gate before human-ready.

Resource state

All section-owned recorders, device claims, stack processes, containers, and E2E slots are stopped or released.
The prior device now belongs to another section; do not touch it.
The shared OrbStack engine remains host-owned.
Keep the product worktree, branches, PRs, scratch evidence, and the retained workflow patch for follow-up.

@iscekic iscekic self-assigned this Aug 28, 2026
@iscekic

iscekic commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

(bot) Rejected the Retry remount finding at agent-sessions-section.tsx:164.

The conditional QueryError occupies the first child slot. The persistent status and Retry remain inside the second View slot.
React preserves that second child when the first slot changes between false and QueryError.

home-screen.mounted.test.tsx:389–410 checks Retry identity, status identity, and one announcement while rows appear and disappear.
The scoped mounted test file passes on a9c9ec6c9:

pnpm --filter kilo-app exec vitest run --project mobile-mounted src/components/home/home-screen.mounted.test.tsx --reporter=verbose

Review-thread enumeration remains unavailable because the GraphQL rate limit is exhausted. This comment does not waive the thread gate.

@iscekic

iscekic commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

(bot) BLOCKED: mobile-live-loading-2be5

BLOCKED

Recovery result

The fresh bundle proves one account-bearing Home opening, but a repeated opening fails to reach Home.
The required preparation gate remains incomplete after one workflow recovery and two NOT READY results.
The bundle is stopped, its slot is released, and the product worktree remains clean.

Blocking gate

Required gate: complete development admission before native and backend verifier dispatch.
Preparation task ses_fb53701ccffecxDS4JiBv7F77o proves the following:

  1. The account-bearing Home command reports success and LIVE NOW appears.
  2. Profile displays live-a@example.com and the account assertion passes.
  3. The same account-bearing Home command reports success again, but Profile remains visible.
  4. The final LIVE NOW assertion fails.

Command:

$KILO_WORKFLOW/e2e/session.sh open 7534187C-0893-4290-89FF-8F8D0F72888B home --email=live-a@example.com

Do not reuse this device identifier for another round without a fresh owned claim.
Command success is not destination proof.
The second preparation failure stops bundle r3 and consumes the second consecutive blocked E2E verdict.
No native or backend verifier ran in this recovery.
No complete live verification pass exists.

The warm destination failure needs diagnosis before another authorized runtime recovery.
Its root cause remains unproved; do not classify it as a fixed workflow defect or silently replace the route with tab navigation.

Repair rounds and workflow fixes

  • The owner-authorized source-dependency repair remains merged in workflow PR 259.
  • All five historical capability failures and the Q284 evidence remain unchanged.
  • New prep r3 failed with a missing getSeedDb export after OTP login.
  • Workflow fix-mobile-export-r1 returned WORKFLOW FIX MERGED after one cycle.
  • Workflow PR 261 fixes transformed CommonJS source handling; the primary checkout included merge 2abbfdd.
  • The fixer reports 109 passing tests and Q286 baseline failure plus five fixed passes.
  • Fresh prep then reached Home once but failed the repeated destination opening.
  • Cleanup exposed a separate claim-release defect; the documented stop retry could not prove shutdown.
  • Workflow fix-ios-cleanup-r1 returned WORKFLOW FIX MERGED after one cycle.
  • Workflow PR 267 verifies Shutdown before restoring a label or deleting a claim.
  • Its owner-scoped proof confirms no remaining owned runtime resource.

No product repair, product takeover, new simplify pass, or translation pass ran in this recovery.

Acceptance outcomes

  • All three plan slices remain landed and pushed.
  • The UX repair and all three simplify repairs remain landed and pushed.
  • The approved user visual checks remain preserved; no new user-visible implementation changed.
  • The fresh allocator claimed the iOS device with alreadyOwned=false.
  • Eight account, organization, credential, and status preparation commands passed.
  • The account-bearing helper now passes its prior module-loading failure.
  • One Home opening and the intended account have concrete device evidence.
  • Repeated destination admission fails; full AC10/AC11 proof remains incomplete.
  • Native, backend, controlled-fault, context, accessibility, and final normal-smoke scenarios remain pending.
  • No temporary product controls were installed.

PR state

PR Current head Current gate evidence
#5641 ae161ba typecheck red; mergeability unknown; threads unreadable
#5649 4608e01 lint/typecheck red; mergeable; threads unreadable
#5652 a9c9ec6 lint/typecheck/i18n-leftover red; mergeable; threads unreadable

The supported gate reports the GraphQL rate limit exhausted.
No lookup failure grants a thread waiver.
These snapshots are not a completed Kilobot iteration or a diagnosis of CI failures.
No product PR was merged, labeled human-ready, or given a new reviewer request.
Existing assignments remain unchanged.

Finding disposition

REJECT the Retry remount finding at agent-sessions-section.tsx:164.
The persistent status/Retry View remains in the same sibling slot when QueryError changes between false and an element.
The existing test at home-screen.mounted.test.tsx:389–410 proves Retry/status identity and one announcement through both transitions.
The scoped mounted test file passed on the unchanged source tip.
The rejection is recorded at #5652 (comment).
Thread enumeration and any required resolution remain incomplete.

No other finding was rejected during this recovery.

Counters

  • All counters from relay.md remain preserved.
  • E2E blocked rounds: 2 total; r2 had no verifier verdict, while r3 ended after two NOT READY results.
  • New missing-export workflow cycles: 1, merged.
  • New cleanup workflow cycles: 1, merged.
  • Simplify passes: 1, already spent.
  • Kilobot iterations: 0 completed.
  • CI product repair rounds: 0.
  • Translation passes: 0.
  • Consultants: 0.

Evidence

  • e2e-start-r3.txt
  • e2e-seed-r3.txt
  • e2e-prep-r3.md
  • e2e-prep-r3-recovery.md
  • handoff-fixer-mobile-export-r1.md
  • handoff-fixer-ios-cleanup-r1.md
  • check-retry-remount-r4.txt
  • gates-recovery-blocked/gate-5641.txt
  • gates-recovery-blocked/gate-5649.txt
  • gates-recovery-blocked/gate-5652.txt
  • resources.md and decisions.md
  • /var/folders/pz/_kmbp8vs2755j415slh2hz100000gn/T/kilo/owned-release-evidence.TWWjHm/owner-proof.json

Credential files remain private and separate from these report artifacts.
The old final report, prior round evidence, and all landed work remain intact.

Cleanup and next step

The owner proof confirms Shutdown, no claim, no recorder, no Appium/WDA listener, and no owned container or network.
The dispatcher released slot-1 afterward; slot status has no section entry or unaccounted known resource.
The shared OrbStack engine remains untouched.
The reaper must perform the final owner-scoped sweep while preserving the worktree and scratch.

Next step: diagnose and repair the repeated account-bearing destination failure before resuming runtime verification and delivery gates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant