Skip to content

feat(mobile): exit list sessions and hydrate child card models - #5442

Open
iscekic wants to merge 4 commits into
mainfrom
session-list-ux-dadd
Open

feat(mobile): exit list sessions and hydrate child card models#5442
iscekic wants to merge 4 commits into
mainfrom
session-list-ux-dadd

Conversation

@iscekic

@iscekic iscekic commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Long-press a running session in the Active now list to see a new Exit session entry. Confirm to stop the running session and keep its history. Success shows a "Session exited" toast and refreshes the Active now list; a retryable send failure shows a "Try again" action. Stored rows keep the old menu, and a running session started from a cloud agent omits the entry.

A parent transcript now fills in empty child sessions in the background. A completed or live child then shows its own model on its card without opening the child session. A child with no model in its history shows no model line instead of the parent's model.


The Active now row's long-press menu gains an additive Exit session entry, wired through an optional onExit callback so callers that omit it keep the old Copy, Rename, Delete, Cancel form. Confirming sends exit_cli over the web connection, keeps the session's history, shows a Session exited toast, and refreshes the active list; a retryable send failure shows Try again without a second confirmation, and a non-retryable failure fails closed with no retry action. The destructive button index prefers Delete when both entries exist, and an in-flight flag blocks a second exit while one is running.

Files
  • apps/mobile/src/components/agents/exit-remote-session-from-list.ts — new helper owns the confirm, send, refresh, and toast lifecycle; classifies non-retryable exit errors and offers a retry action for retryable ones.
  • apps/mobile/src/components/agents/remote-session-row.tsx — adds the exit handler, the in-flight ref, the active-list refresh, and passes onExit only when canExitSessionFromList allows; non-interactive rows keep no long-press.
  • apps/mobile/src/components/agents/session-row-actions.ts — adds the optional onExit entry and picks the destructive button index.

The new pure helper canExitSessionFromList gates the Exit session entry. Cloud-agent rows carry the sentinel connection id and have no CLI connection to receive exit_cli, so the helper returns false and the row omits the entry. Only real CLI rows can be exited.

Files
  • apps/mobile/src/components/agents/session-list-helpers.ts — adds canExitSessionFromList, which returns false for the cloud-agent sentinel connection id.

The parent transcript now hydrates empty child sessions in the background through two new helpers, collectEmptyChildSessionIds and hydrateEmptyChildSessions. A reopened parent shows each completed or live child's own model on its card without opening the child sheet, and a child with no model in its history shows no model line. Each child id is attempted once per parent session and retried once when hydration reports an error status; the child sheet stays closed and hydration reads live atom state through the store so the effect never acts on a stale child-message map.

Files
  • apps/mobile/src/components/agents/session-detail-content.tsx — adds the hydration effect plus the attempted ref set, reset on session change.
  • apps/mobile/src/components/agents/session-detail-content-helpers.ts — adds collectEmptyChildSessionIds and hydrateEmptyChildSessions.

Tests: 4 files — exit-remote-session-from-list.test.ts (new), session-detail-content-helpers.test.ts, session-list-helpers.test.ts, and session-row-actions.test.ts.
Generated: none.


Verification

One round on iOS ran all five cases.

Case What it proves Platform Result
cold-open The cloud/sessions deep link opens the Agents list, and the running session row appears under Active now. ios passed
menu-exit The long-press menu on the running row lists Copy session ID, Rename, Exit session, and Cancel, with Exit session above Cancel. ios passed
confirm-keep The exit dialog shows the right body and buttons, and Keep session running leaves the row in Active now with no toast. ios passed
exit-success Exit shows the Session exited toast, moves the row from Active now to History, and leaves no spinner on the row. ios passed
stored-menu The long-press menu on the stored row lists Delete session and omits Exit session. ios passed

No product defect reproduced on the unfixed build; the single cold-open retry was a test-flow issue, not a product defect.
Recording: none.

Visual Changes

Agents list — Active now section

The Agents list shows the running session in an Active now section above the stored rows. In the picture, the ACTIVE NOW header holds one row: CLOUD, One sentence greeting, a green dot, and 1M AGO.

01-s1-cold-open.png

Long-press manage sheet on the running row

A long press on the running row opens a sheet with Copy session ID, Rename, Exit session, and Cancel. In the picture, the red Exit session item sits above Cancel, over the dimmed Active now row.

01-s2-menu-exit.png

Manage sheet on a stored row under TODAY

A long press on a stored row under TODAY opens a sheet with Copy session ID, Rename, Delete session, and Cancel. In the picture, the red Delete session item sits above Cancel, and the sheet has no Exit session item.

01-s5-stored-menu.png

Reviewer Notes

Human steps: none.

Notes: E2E scope: the child-card model feature (a2) is not bot-E2E-testable because the fake LLM emits only text deltas and never a task tool call, so no child session can be seeded. Its logic is covered by unit tests.

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

kilo-code-bot Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • apps/mobile/src/components/agents/remote-session-row.tsx
  • apps/mobile/src/components/agents/session-list-helpers.ts
  • apps/mobile/src/components/agents/session-list-helpers.test.ts
Previous Review Summaries (2 snapshots, latest commit 80de432)

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

Previous review (commit 80de432)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
apps/mobile/src/components/agents/remote-session-row.tsx 153 Exit is offered for cloud-agent Active now rows that cannot be exited
Files Reviewed (8 files)
  • apps/mobile/src/components/agents/exit-remote-session-from-list.ts - 0 issues
  • apps/mobile/src/components/agents/exit-remote-session-from-list.test.ts - 0 issues
  • apps/mobile/src/components/agents/remote-session-row.tsx - 1 issue
  • apps/mobile/src/components/agents/session-row-actions.ts - 0 issues
  • apps/mobile/src/components/agents/session-row-actions.test.ts - 0 issues
  • apps/mobile/src/components/agents/session-detail-content.tsx - 0 issues
  • apps/mobile/src/components/agents/session-detail-content-helpers.ts - 0 issues
  • apps/mobile/src/components/agents/session-detail-content-helpers.test.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 3c14afc)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
apps/mobile/src/components/agents/remote-session-row.tsx 153 Exit is offered for cloud-agent Active now rows that cannot be exited
Files Reviewed (8 files)
  • apps/mobile/src/components/agents/exit-remote-session-from-list.ts - 0 issues
  • apps/mobile/src/components/agents/exit-remote-session-from-list.test.ts - 0 issues
  • apps/mobile/src/components/agents/remote-session-row.tsx - 1 issue
  • apps/mobile/src/components/agents/session-row-actions.ts - 0 issues
  • apps/mobile/src/components/agents/session-row-actions.test.ts - 0 issues
  • apps/mobile/src/components/agents/session-detail-content.tsx - 0 issues
  • apps/mobile/src/components/agents/session-detail-content-helpers.ts - 0 issues
  • apps/mobile/src/components/agents/session-detail-content-helpers.test.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 38.3K · Output: 5.4K · Cached: 247.4K

Review guidance: REVIEW.md from base branch main

@iscekic iscekic added the human-ready The PR is ready for human review. label Aug 23, 2026
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.

1 participant