Skip to content

fix(mobile): restore visible Agents session history - #5075

Merged
iscekic merged 11 commits into
mainfrom
agents-screen-134c
Aug 6, 2026
Merged

iscekic merged 11 commits into
mainfrom
agents-screen-134c

Conversation

@iscekic

@iscekic iscekic commented Aug 5, 2026 •

Copy link
Copy Markdown
Collaborator

The user: The Agents screen now shows active sessions in Active now and displays honest history content below the tray. It backfills older stored sessions when active exclusions hide the loaded page, with a bounded automatic fetch.

The product manager: Users no longer see a misleading No past sessions state when all loaded sessions are active. Cold active-session failures show a retry surface, and refresh and focus operations preserve history loading.

The maintainer: The mobile list adds an all-active body model, a three-page backfill selector and effect, serialized stored-query operations, and an active-error-empty surface. Tests cover the pure models, mounted effects, rendered empty state, error precedence, and exact-id exclusion.

Human steps: No step is needed before or after merge.

Visual Changes: N/A for the product workflow. Latest runtime evidence: mixed state, all-active state, bounded backfill.

E2E: bot-e2e — iOS S1 through S6 passed on the live mobile stack. S6 used page-source evidence because old rows were below the viewport without scrolling. The stock login helper has a stale four-tab assertion; the verifier used corrected three-tab flows.

@iscekic iscekic self-assigned this Aug 5, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of commits since facf4bea (per-consumer refetchOnWindowFocus option plus an AppState-driven foreground refetch on the Agents screen): the previous suggestion is resolved — buildStoredSessionsQueryOptions now defaults the native window-focus refetch to true so Home and the Share Gate keep their OS-foreground refresh (focusManager is wired to AppState in query-client-lifecycle.tsx), while the Agents list opts out and drives foreground refresh through an AppState listener calling the coordinator-wrapped refetch; the subscription is cleaned up on unmount, tests assert both the default and opt-out branches, and no new issues were found.

Files Reviewed (4 files)
  • apps/mobile/src/components/agents/session-list-screen.tsx
  • apps/mobile/src/components/agents/use-agent-session-list-data.ts
  • apps/mobile/src/lib/hooks/use-agent-sessions.ts
  • apps/mobile/src/lib/hooks/use-agent-sessions.test.ts
Previous Review Summaries (3 snapshots, latest commit facf4be)

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

Previous review (commit facf4be)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

Incremental review of commit facf4bea (coordinate native focus refreshes): the extracted pure buildStoredSessionsQueryOptions and its executable tests are correct (mock chain verified complete against all transitive imports), but disabling refetchOnWindowFocus on the shared stored query also removes OS-foreground stored refresh for the Home and share-gate surfaces, which have no replacement focus refetch — flagged as a suggestion to confirm the trade-off.

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
apps/mobile/src/lib/hooks/use-agent-sessions.ts 100 refetchOnWindowFocus: false also disables OS-foreground stored refresh for Home/share-gate consumers, which lack a focus-driven refetch
Files Reviewed (2 files)
  • apps/mobile/src/lib/hooks/use-agent-sessions.ts - 1 issue
  • apps/mobile/src/lib/hooks/use-agent-sessions.test.ts

Fix these issues in Kilo Cloud

Previous review (commit 5896150)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of new commits since 45de97ce: the branch merged origin/main and added one test-only commit (test(mobile): observe selectable read errors) updating tool-card-output-cap.test.ts to assert read errors via the SelectableText/TextInput value prop — verified the assertion matches the actual read-tool-card.tsx implementation (which already renders errors through SelectableText), and confirmed the merge left all 14 previously-reviewed session-history files byte-identical. High confidence, no issues found.

Files Reviewed (15 files)
  • apps/mobile/src/components/agents/session-list-backfill.ts
  • apps/mobile/src/components/agents/session-list-backfill.test.ts
  • apps/mobile/src/components/agents/session-list-body-model.ts
  • apps/mobile/src/components/agents/session-list-body-model.test.ts
  • apps/mobile/src/components/agents/session-list-body-empty.tsx
  • apps/mobile/src/components/agents/session-list-body-empty.mounted.test.tsx
  • apps/mobile/src/components/agents/session-list-content-surface.ts
  • apps/mobile/src/components/agents/session-list-content.test.ts
  • apps/mobile/src/components/agents/session-list-content.tsx
  • apps/mobile/src/components/agents/session-list-screen.tsx
  • apps/mobile/src/components/agents/tool-cards/tool-card-output-cap.test.ts
  • apps/mobile/src/components/agents/use-agent-session-list-data.ts
  • apps/mobile/src/components/agents/use-history-backfill.ts
  • apps/mobile/src/components/agents/use-history-backfill.mounted.test.tsx
  • apps/mobile/src/lib/hooks/use-agent-sessions.ts

Previous review (commit 45de97c)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the mobile Agents session-history fix (all-active body model, bounded backfill selector/effect, active-error-empty surface, and the operation coordinator serializing stored refetch/next-page fetches) with high confidence: gates are consistently ordered, search/pending-search transitions cannot fire the stored backfill, the coordinator chain is bounded and rejection-safe, and no memory leaks or consumer regressions (Home, Share gate) were introduced.

Files Reviewed (14 files)
  • apps/mobile/src/components/agents/session-list-backfill.ts
  • apps/mobile/src/components/agents/session-list-backfill.test.ts
  • apps/mobile/src/components/agents/session-list-body-model.ts
  • apps/mobile/src/components/agents/session-list-body-model.test.ts
  • apps/mobile/src/components/agents/session-list-body-empty.tsx
  • apps/mobile/src/components/agents/session-list-body-empty.mounted.test.tsx
  • apps/mobile/src/components/agents/session-list-content-surface.ts
  • apps/mobile/src/components/agents/session-list-content.test.ts
  • apps/mobile/src/components/agents/session-list-content.tsx
  • apps/mobile/src/components/agents/session-list-screen.tsx
  • apps/mobile/src/components/agents/use-agent-session-list-data.ts
  • apps/mobile/src/components/agents/use-history-backfill.ts
  • apps/mobile/src/components/agents/use-history-backfill.mounted.test.tsx
  • apps/mobile/src/lib/hooks/use-agent-sessions.ts

Reviewed by kimi-k3 · Input: 59K · Output: 10.7K · Cached: 370.7K

Review guidance: REVIEW.md from base branch main

@iscekic iscekic added the human-ready The PR is ready for human review. label Aug 6, 2026
@iscekic
iscekic enabled auto-merge (squash) August 6, 2026 08:51
@iscekic
iscekic merged commit e1eabc1 into main Aug 6, 2026
19 checks passed
@iscekic
iscekic deleted the agents-screen-134c branch August 6, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-ready The PR is ready for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants