feat(mobile): exit list sessions and hydrate child card models - #5442
Open
iscekic wants to merge 4 commits into
Open
feat(mobile): exit list sessions and hydrate child card models#5442iscekic wants to merge 4 commits into
iscekic wants to merge 4 commits into
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
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
Issue Details (click to expand)WARNING
Files Reviewed (8 files)
Fix these issues in Kilo Cloud Previous review (commit 3c14afc)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (8 files)
Reviewed by grok-4.6 · Input: 38.3K · Output: 5.4K · Cached: 247.4K Review guidance: REVIEW.md from base branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
onExitcallback so callers that omit it keep the old Copy, Rename, Delete, Cancel form. Confirming sendsexit_cliover 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 passesonExitonly whencanExitSessionFromListallows; non-interactive rows keep no long-press.apps/mobile/src/components/agents/session-row-actions.ts— adds the optionalonExitentry and picks the destructive button index.The new pure helper
canExitSessionFromListgates the Exit session entry. Cloud-agent rows carry the sentinel connection id and have no CLI connection to receiveexit_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— addscanExitSessionFromList, 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,
collectEmptyChildSessionIdsandhydrateEmptyChildSessions. 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— addscollectEmptyChildSessionIdsandhydrateEmptyChildSessions.Tests: 4 files —
exit-remote-session-from-list.test.ts(new),session-detail-content-helpers.test.ts,session-list-helpers.test.ts, andsession-row-actions.test.ts.Generated: none.
Verification
One round on iOS ran all five cases.
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.
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.
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.
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.