Skip to content

fix(mobile): dismiss to Agents list after remote session exit - #5423

Merged
iscekic merged 9 commits into
mainfrom
session-navigation-3f7c
Aug 21, 2026
Merged

fix(mobile): dismiss to Agents list after remote session exit#5423
iscekic merged 9 commits into
mainfrom
session-navigation-3f7c

Conversation

@iscekic

@iscekic iscekic commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

After you exit a remote session with feedback, the app returns you to the Agents list. A back gesture no longer reopens the exited session.


The exit helper navigates with dismissTo instead of replace, so the exited agent-chat route is popped from the stack and a back gesture cannot return to it. The helper's router parameter now uses a new local ExitRemoteSessionRouter type that requires dismissTo, and it no longer accepts the shared AgentSessionRouterLike shape, which still serves the other navigation helpers. The feedback flow (toast, retry, non-retryable classification) is unchanged.

Files
  • apps/mobile/src/components/agents/exit-remote-session-with-feedback.ts — swaps router.replace(SESSIONS_ROUTE) for router.dismissTo(SESSIONS_ROUTE); drops the AgentSessionRouterLike import and adds a local ExitRemoteSessionRouter type with dismissTo: (href: Href) => void.

Test: 1 test file updated (apps/mobile/src/components/agents/exit-remote-session-with-feedback.test.ts).
Generated: none.


Verification

Three rounds (6, 7, 8) on iOS ran the two cases.

Case What it proves Platform Result
exit-1 Exit with feedback returns the user to the Agents list and shows the Session exited toast. iOS passed
exit-2 A back gesture after exit does not return to the exited session page. iOS passed after the fix in round 8

Round 6 reproduced a stale session page after the back gesture, because the old harness flow tapped a session row. The corrected flow fixed it; round 8 does not reproduce it.

Recording: none.

Human steps: none needed.

Visual Changes

Agents list after session exit. The user exits a remote session with feedback and the app shows the Agents list with a Session exited toast. In the picture, the toast sits above the Search sessions... field, and the AGENTS tab is selected at the bottom.

02-land-on-agents-list.png

Agents list after the back gesture. After a left-edge back gesture, the app stays on the Agents list and the exited session page does not return. In the picture, the large Agents header and the session list are visible, and no chat screen appears.

01-back-gesture-no-return-top.png

Reviewer Notes

None.

Replace the success-path router.replace with router.dismissTo so POP_TO
truncates the exited agent-chat route off the (app) stack and focuses the
existing (tabs) entry. The next back gesture no longer returns to the
exited session page.
@iscekic iscekic self-assigned this Aug 21, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of temporary exit-navigation debug removal found no leftover debug hooks or correctness issues.

Files Reviewed (4 files)
  • apps/mobile/src/app/(app)/_layout.tsx
  • apps/mobile/src/app/_layout.tsx
  • apps/mobile/src/components/agents/exit-remote-session-with-feedback.ts
  • apps/mobile/src/components/agents/session-detail-content.tsx
Previous Review Summaries (7 snapshots, latest commit ff1ab93)

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

Previous review (commit ff1ab93)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of temporary router-method wrappers in ExitDebugMount found no correctness issues.

Files Reviewed (1 file)
  • apps/mobile/src/app/(app)/_layout.tsx

Previous review (commit d1c880e)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of navigation-container state listeners and pending deep-link debug logging found no correctness issues.

Files Reviewed (2 files)
  • apps/mobile/src/app/(app)/_layout.tsx
  • apps/mobile/src/app/_layout.tsx

Previous review (commit 5fe299b)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of fuller navigation-state debug dumps in layout and session detail found no correctness issues.

Files Reviewed (2 files)
  • apps/mobile/src/app/(app)/_layout.tsx
  • apps/mobile/src/components/agents/session-detail-content.tsx

Previous review (commit 2201b78)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of (app) stack debug logging in layout and session detail found no correctness issues.

Files Reviewed (2 files)
  • apps/mobile/src/app/(app)/_layout.tsx
  • apps/mobile/src/components/agents/session-detail-content.tsx

Previous review (commit 52aa327)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of temporary exit-navigation debug logging found no correctness issues.

Files Reviewed (2 files)
  • apps/mobile/src/components/agents/exit-remote-session-with-feedback.ts
  • apps/mobile/src/components/agents/session-detail-content.tsx

Previous review (commit 702b54e)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review of comment and test-label updates around dismissTo found no correctness issues.

Files Reviewed (2 files)
  • apps/mobile/src/components/agents/exit-remote-session-with-feedback.ts
  • apps/mobile/src/components/agents/exit-remote-session-with-feedback.test.ts

Previous review (commit 8d1708e)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • apps/mobile/src/components/agents/exit-remote-session-with-feedback.ts
  • apps/mobile/src/components/agents/exit-remote-session-with-feedback.test.ts

Reviewed by grok-4.6 · Input: 46.4K · Output: 4.6K · Cached: 233.5K

Review guidance: REVIEW.md from base branch main

@iscekic
iscekic requested review from jrf0110 and pandemicsyn August 21, 2026 16:53
@iscekic iscekic added the human-ready The PR is ready for human review. label Aug 21, 2026
@iscekic
iscekic merged commit 6a04ab1 into main Aug 21, 2026
18 checks passed
@iscekic
iscekic deleted the session-navigation-3f7c branch August 21, 2026 20:33
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