Repository navigation
Open native chats on the phone in place - #36315
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 5

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1d7fc9bc-669f-4528-b792-3e6ebf00b594
Files ignored due to path filters: 1-
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
Files selected for processing: 92-
mobile/src/agent-history/MobileAgentSessionHistoryPanel.tsxmobile/src/agent-history/agent-history-pending-resume-ownership.test.tsxmobile/src/agent-history/mobile-history-resume-target-preparation.tsmobile/src/agent-history/open-mobile-agent-history-chat.tsmobile/src/session/mobile-structured-session-open-rpc.tsmobile/src/session/open-mobile-structured-session.test.tsmobile/src/session/open-mobile-structured-session.tsmobile/src/session/use-mobile-session-close-actions.test.tsxmobile/src/session/use-mobile-session-close-actions.tsmobile/src/session/use-mobile-session-controller.tsmobile/src/session/use-mobile-session-tab-switching.tsmobile/src/session/use-mobile-structured-session-opening.test.tsxmobile/src/session/use-mobile-structured-session-opening.tsmobile/src/session/use-notification-pane-navigation.test.tsxmobile/src/session/use-notification-pane-navigation.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host-tabs.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host-types.tssrc/main/persistence/terminal-topology/layout-command-persistence.tssrc/main/runtime/agent-session-tab-layout-queue.test.tssrc/main/runtime/agent-session-tab-layout-queue.tssrc/main/runtime/agent-session/agent-session-tab-identity.tssrc/main/runtime/agent-session/agent-session-tab-layout.test.tssrc/main/runtime/agent-session/agent-session-tab-layout.tssrc/main/runtime/agent-session/agent-session-tab-table.tssrc/main/runtime/agent-session/structured-agent-session-close.test.tssrc/main/runtime/agent-session/structured-agent-session-close.tssrc/main/runtime/agent-session/structured-agent-session-tab-index-seed.tssrc/main/runtime/agent-session/structured-agent-session-tab-retirement.tssrc/main/runtime/agent-session/structured-session-renderer-close.tssrc/main/runtime/client-session-tab-selection.test.tssrc/main/runtime/client-session-tab-selection.tssrc/main/runtime/construction/runtime-identity-state.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/orchestration/orchestration-party-location.test.tssrc/main/runtime/orchestration/orchestration-party-location.tssrc/main/runtime/orchestration/structured-session-lineage.tssrc/main/runtime/orchestration/terminal-pane-mail-routing.tssrc/main/runtime/rpc/methods/orchestration-structured-worker-session.tssrc/main/runtime/rpc/methods/orchestration/caller-show.tssrc/main/runtime/rpc/methods/session-tab-mutation-methods.tssrc/main/runtime/rpc/methods/structured-agent-session-close-before-create.test.tssrc/main/runtime/rpc/methods/structured-agent-session-close-before-create.tssrc/main/runtime/rpc/methods/structured-agent-session-close-method.tssrc/main/runtime/rpc/methods/structured-agent-session-create-handler.tssrc/main/runtime/rpc/methods/structured-agent-session-create.tssrc/main/runtime/rpc/methods/structured-agent-session-reveal.test.tssrc/main/runtime/rpc/methods/structured-agent-session-reveal.tssrc/main/runtime/rpc/methods/structured-agent-session-rpc.test-fixture.tssrc/main/runtime/rpc/methods/structured-agent-session-schemas.tssrc/main/runtime/rpc/methods/structured-agent-session.test.tssrc/main/runtime/rpc/methods/structured-agent-session.tssrc/main/runtime/rpc/methods/structured-chat-tab-lifetime.test-fixture.tssrc/main/runtime/rpc/methods/structured-chat-tab-lifetime.test.tssrc/main/runtime/rpc/methods/structured-chat-tab-table.test-fixture.tssrc/main/runtime/rpc/methods/structured-chat-tab-table.test.tssrc/main/runtime/runtime-layout-apply.tssrc/main/runtime/runtime-rpc/runtime-rpc-mobile-method-routing.tssrc/main/runtime/session-lifecycle/close/close-mobile-session-tab.tssrc/main/runtime/session-lifecycle/projection/apply-mobile-session-tab-navigation.tssrc/main/runtime/session-lifecycle/projection/perform-mobile-session-pty-records-refresh.tssrc/main/runtime/session-tabs/restored-chat-tab-changes.tssrc/main/runtime/session-tabs/session-tab-prototype-dispatch.test.tssrc/main/runtime/session-tabs/structured-session-create-support.tssrc/main/runtime/session-tabs/structured-session-tab-close.tssrc/main/runtime/session-tabs/structured-session-tab-presentation.tssrc/main/runtime/session-tabs/structured-session-tab-publication.tssrc/main/runtime/session-tabs/structured-session-tab-restoration.tssrc/main/runtime/structured-agent-session-tab-authority.test-support.tssrc/main/runtime/structured-agent-session-tab-authority.test.tssrc/main/runtime/structured-chat-dispatch-worker-lifecycle.test.tssrc/main/runtime/structured-chat-tab-compatibility.test.tssrc/main/runtime/structured-chat-tab-lifetime-cost.test.tssrc/main/runtime/structured-session-worktree-teardown.test.tssrc/main/runtime/structured-session-worktree-teardown.tssrc/renderer/src/components/NativeChatResumeOnRestartModal.tsxsrc/renderer/src/lib/activate-ai-vault-structured-session-host.test.tssrc/renderer/src/lib/activate-ai-vault-structured-session.test.tssrc/renderer/src/lib/activate-ai-vault-structured-session.tssrc/renderer/src/lib/open-agent-message-sender.test.tssrc/renderer/src/lib/open-agent-message-sender.tssrc/renderer/src/runtime/sync-runtime-graph-chat-tab-order.test.tssrc/renderer/src/runtime/sync-runtime-graph/mobile-session-capture.tssrc/renderer/src/runtime/sync-runtime-graph/mobile-session-group-projection.tssrc/renderer/src/runtime/sync-runtime-graph/mobile-session-inputs.tssrc/renderer/src/runtime/sync-runtime-graph/types.tssrc/shared/open-structured-agent-session.test.tssrc/shared/open-structured-agent-session.tssrc/shared/rpc-contract/structured-agent-session-params.tssrc/shared/structured-agent-session-host-tab-id.tssrc/shared/structured-session-notification-pane.tssrc/shared/workspace-layout/old-client/old-client-session-row-ids.tssrc/shared/workspace-layout/old-client/old-client-session-tabs-projection.ts
Files with no reviewable changes: 2-
- src/main/runtime/orchestration/terminal-pane-mail-routing.ts
- src/main/runtime/rpc/methods/orchestration-structured-worker-session.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
-
There was a problem hiding this comment.
Actionable comments posted: 1
Duplicate comments: 1
src/shared/open-structured-agent-session.ts: 1
66-78:Minor · Functional Correctness · Quick win
structuredSessionOpenMessagestill returns hardcoded English text.This function builds fixed English strings. The mobile hook (
use-mobile-structured-session-opening.ts) shows this text in its toasts. These strings are not localized. Users with a non-English locale see English for every failure to open a structured chat.Keep the shared mapping from
reasonto message. Resolve the text in each platform adapter: usetranslateon desktop andton mobile. Alternatively, add a translator parameter to the shared function. Use an intent-named ID and a named placeholder for the agent label in both cases.Based on learnings: "For newly added user-facing strings in stablyai/orca TypeScript and TSX files, follow config/i18n-translation-source.md: use intent-named localization IDs with named interpolation placeholders."
Source: Learnings

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4b0653e3-f576-47a8-ab60-208235d7fe13
Files ignored due to path filters: 1-
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
Files selected for processing: 57-
mobile/src/agent-history/agent-history-pending-resume-ownership.test.tsxmobile/src/session/open-mobile-structured-session.tsmobile/src/session/use-mobile-session-close-actions.test.tsxmobile/src/session/use-mobile-structured-session-opening.test.tsxmobile/src/session/use-mobile-structured-session-opening.tsmobile/src/session/use-notification-pane-navigation.test.tsxmobile/src/session/use-notification-pane-navigation.tssrc/main/runtime/agent-session-tab-layout-command.test.tssrc/main/runtime/agent-session-tab-layout-queue.test.tssrc/main/runtime/folder-workspace-mixed-host-routing.test.tssrc/main/runtime/orca-runtime-desktop-tab-names.test.tssrc/main/runtime/orca-runtime-structured-session-restore.test.tssrc/main/runtime/orchestration/worker-terminal-release-runtime.tssrc/main/runtime/project-removal-structured-sessions.test.tssrc/main/runtime/rpc/methods/orchestration-structured-worker-lifecycle.test.tssrc/main/runtime/rpc/methods/orchestration-structured-worker-lifecycle.tssrc/main/runtime/rpc/methods/orchestration-structured-worker-retry.test.tssrc/main/runtime/rpc/methods/orchestration-structured-worker-session.test.tssrc/main/runtime/rpc/methods/orchestration-structured-worker-start-failure.test.tssrc/main/runtime/rpc/methods/session-tabs.test.tssrc/main/runtime/rpc/methods/structured-agent-session-admission.test.tssrc/main/runtime/rpc/methods/structured-agent-session-reveal.test.tssrc/main/runtime/rpc/methods/structured-agent-session-reveal.tssrc/main/runtime/rpc/methods/structured-agent-session-rpc.test-fixture.tssrc/main/runtime/rpc/methods/structured-worker-tab-retirement.test.tssrc/main/runtime/rpc/methods/workspace-layout-apply.test.tssrc/main/runtime/runtime-layout-apply.test.tssrc/main/runtime/session-lifecycle/close/close-mobile-session-tab.tssrc/main/runtime/session-tabs/session-tab-prototype-dispatch.test.tssrc/main/runtime/session-tabs/structured-session-tab-close.tssrc/main/runtime/session-tabs/structured-session-tab-presentation.tssrc/main/runtime/session-tabs/structured-session-tab-publication.tssrc/main/runtime/session-tabs/structured-session-tab-restoration.tssrc/main/runtime/structured-agent-session-startup-reconcile.test.tssrc/main/runtime/structured-agent-session-tab-authority.test-support.tssrc/main/runtime/structured-agent-session-tab-authority.test.tssrc/main/runtime/structured-agent-session-windowless-layout-host.test.tssrc/main/runtime/structured-agent-session-windowless-layout.test.tssrc/main/runtime/structured-chat-tab-compatibility.test.tssrc/main/runtime/structured-chat-tab-lifetime-cost.test.tssrc/main/runtime/structured-chat-tab-unavailable-host.test.tssrc/main/runtime/structured-worker-at-rest.test.tssrc/main/runtime/structured-worker-cleared-session.test.tssrc/main/runtime/workspaces/persisted-surfaces/restored-terminal-placement.test.tssrc/renderer/src/components/NativeChatResumeOnRestartModal.test.tsxsrc/renderer/src/components/native-chat/NativeChatAgentMessageCard.test.tsxsrc/renderer/src/components/right-sidebar/AiVaultSessionVirtualList.keyboard.test.tsxsrc/renderer/src/components/right-sidebar/ai-vault-session-resume-here.tssrc/renderer/src/lib/activate-ai-vault-structured-session-host.test.tssrc/renderer/src/lib/activate-ai-vault-structured-session-reveal.test.tssrc/renderer/src/lib/activate-ai-vault-structured-session.test.tssrc/renderer/src/lib/activate-ai-vault-structured-session.tssrc/renderer/src/lib/open-agent-message-sender.test.tssrc/renderer/src/lib/open-agent-message-sender.tssrc/renderer/src/lib/structured-session-open-consumers.test.tsxsrc/shared/open-structured-agent-session.test.tssrc/shared/open-structured-agent-session.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
…2025/phone-open-chats # Conflicts: # src/main/runtime/orchestration/orchestration-party-location.test.ts # src/main/runtime/rpc/methods/orchestration-structured-worker-start-failure.test.ts # src/main/runtime/structured-agent-session-startup-reconcile.test.ts
|
Phone Session History could resume a native chat in a terminal, and notifications could not reopen a closed chat. Delayed closes/layout writes also crossed reopened-tab lifetimes; a retained History row could recreate a stray tab after workspace removal. The phone now opens the native chat in place through the shared desktop opening policy. It selects the chat on the requesting phone while the computer keeps its active view. Removed workspaces use the existing notice before a new chat, composer or shared tab is opened; History remains saved. The full review completed six normal rounds, architecture/reference comparison, lifecycle and compatibility settlements, focused regression checks and the required real-agent QA. Later authorized CI fixture/type repairs preserved every existing case and assertion; they were independently reviewed and are not additional rounds. Redundant tests were pruned; this remains a substantial lifecycle change. CI is green on reviewed head Verified with real Claude and Codex on preserved previous-build state: upgrade/restart, closed native History open and completed phone reply, desktop Reference preserved with passive shared membership, normal close/reopen and recovery, Stop during provider startup, shipped worker-stop, and normal worktree removal retiring the correct tabs and recorded processes while unrelated shells survived. The targeted removed-workspace repair was exercised for both agents: retained History taps reach the existing notice, with zero target tab/saved-layout/pending additions, stable operation/receipt totals and no observed new target process after settled reads. Original History and provider records remain saved. The raw reports, events, inventories and screenshots were independently audited; a successful driver exit alone was not treated as a pass. Evidence limits: two literal driver FAILs remain in the records. The Claude positive run remembered the first tab in an initially empty inactive workspace; active desktop selection/content stayed unchanged, as the visibility contract allows. A zero-count map key disappeared 6.971 seconds before observer readiness and over a minute before the Codex negative tap; there were no after-ready recorder changes. Its cause is unknown. Native frames are samples, not continuous no-flash proof. Current Codex History/thread metadata and the completed reply establish conversation continuity, but its unsaved PID-to-thread observation does not establish exclusive process ownership. The initial normal Codex Close followed an already-exited provider, so that exit is not attributed to Close. Earlier overlapping Codex-chain ownership and the short unidentified Claude process at the current tap remain unknown; current target retirement uses recorded PID/start identities. Recovery completed a new reply before processing the retained queued prompt/reply, then cleared the queue. Exact operation-key/receipt-ID equality is report-only; the underlying settled inventories independently establish unchanged totals and zero target state. The literal History-RPC/close overlap is covered by a deterministic production-path test; app QA exercised provider startup cancellation. Notification routing/compatibility are tests-row flows. Localized captures below are controlled layout fixtures only. Deferred: senders on another computer (STA-12948); broader Resume behavior after workspace deletion (STA-13107); phone message cards/arrow tracked in #36162. A separate pre-existing failed-dispatch mailbox issue remains tracked in STA-12976; permanent mail quiescence is not claimed, and worker-stop's failed/stopped result is not a successful completion/release. An unsupported-agent fallback concern had no proven shipped input. A historical Windows ARM teardown flake passed its narrow retry; no shipped Stop failure was established. For Brennan’s review, the screenshots below cover the real flows and the controlled copy/layout fixture. The baseline phone showed ownership-unknown; the unrelated pre-existing Codex server toast is not attributed to the tap. The candidate opens the native chat. Desktop activity/sidebar changes are expected; the invariant is the selected Reference view, not pixel equality of the entire window. Upgrade comparison: previous-build phone versus native open/replyPrevious-build phone:
Same preserved profile after upgrade:
Desktop before/after baseline taps: Current repaired path: native open and real reply, desktop kept in placeFull desktop before either tap (existing phone-control overlay already present):
Close/reopen, startup Stop, and recoveryNormal Close retires the Claude tab; the surviving Codex chat remains visible: Normal close/reopen completed replies:
Startup cancellation sampled sequence and fallback; timing comes from host records:
Recovery after startup Stop:
Worker-stop and normal removalReopened original workers completed a real reply before Stop:
Desktop after shipped worker-stop:
Current normal removal, settled full desktop: Controlled localized layout fixturesThe old History fixture proves wrapping only and does not depict the current dismissible control; the actual current notices are above. Three judgment points: shared opening policy, resource-owned workspace admission, existing phone notice routing. Latest changed-flow running-app QA is on |
Brings in 3601c5a, including #36315 (open native chats on the phone in place). Created chats publish through main's shared tab publication and capture their surface for close-before-create; the founding attempt still records the chat as installed once its tab is in the host's list, even if notifying viewers fails.



























Tapping a native chat in phone Session History could resume it in a terminal, and a notification could not open the chat after its tab was closed. Reopening also exposed races where a delayed close or saved layout write could remove a newer tab. A cold host could incorrectly report a saved chat as gone. A retained History entry could also recreate a stray tab after its workspace was removed.
The phone now opens native chats in place through the same opening policy as desktop Session History, restart offers and existing sender arrows. It follows the conversation's current continuation, reuses an existing tab or reopens the closed chat, and selects the returned chat only for the phone that opened it. The computer and other phones keep their current selection. Notifications can reopen a closed chat after inventory has loaded and the notification's chat identity has been validated.
The shared opening path checks the workspace separately from the saved conversation. If the workspace has been removed, the phone shows its existing workspace-unavailable notice before opening a new tab, chat screen or composer. The conversation, its history and provider identity remain saved. The shared fix also affects desktop History and existing desktop callers: they cannot create a new shared tab under a removed workspace and show the existing localized workspace-unavailable feedback once. There is no new reader, copy, restoration or workspace-recreation flow, and History is not erased.
Desktop and phone use one shared opening policy, with selection handled by the client that requested the chat. Each reopened tab has its own lifetime, so a delayed close cannot remove a newer tab. The same workspace check covers showing the tab, writing its saved layout and completing the open, including a layout write that was already queued when removal began. Stop remains independent of tab bookkeeping, including when showing the chat failed and it displays Retry. Unknown workspace evidence stays unknown.
Compatibility is intended: omitted reveal navigation retains desktop's activating, best-effort behavior. Explicit old-host/schema/method/permission refusals before effects retain History's terminal resume path; an ambiguous timeout never starts an extra resume or an activating retry. Closed-chat notifications need a host that supports caller reveal. Strict caller publication may refuse where the legacy desktop path can still show Retry.
The shared host tab list with per-client selection is an intended adaptation of the common pattern for independently updated paired clients. Legacy/custom IDs remain compatible; a reopened surface receives a distinct lifetime ID. Resolving senders on another computer is temporary and tracked in https://linear.app/stably/issue/STA-12948. Message cards and their phone arrow adapter remain tracked in #36162 and are outside this PR.
Resume on a chat whose workspace was deleted is a temporary limitation, tracked in https://linear.app/stably/issue/STA-13107. Broader behavior for those conversations is deferred; this PR only prevents the stray tab through the existing workspace-unavailable outcome.
CI is green on reviewed head
7ce89cfa28b5522a9dff55daa97b29d4d62ef2f7: static analysis, typecheck and all 12 unit shards, plus Mobile verify. Focused tests cover shared opening, lineage, cold-host lookup, old-host compatibility, delayed writes, close/create and Stop races, worker cleanup and worktree removal. The three older automation Details cases now use a real workspace identity and matching saved records; every case and assertion is unchanged.Real phone QA used preserved previous-build state and both Claude and Codex. It covered closed History chats opening natively with completed replies while the desktop kept its active Reference view, close/reopen and recovery, Stop during provider startup, worker-stop, and normal worktree removal. Targeted runs of the removed-workspace repair confirmed both retained History taps show the existing notice with no composer and no new target tab, saved layout or pending operation, stable operation/receipt totals, and no observed new target provider process after settled reads. Original History and provider records remain saved. The literal History-reveal/close overlap is covered by a deterministic production-path test; notification routing and compatibility are covered by tests. Controlled localized component captures prove layout only.
Two driver assertions remain recorded as failures with bounded dispositions: an empty inactive workspace remembered its first tab without changing the active desktop view, as permitted by the visibility contract; a zero-count map key disappeared before the observer was ready and more than a minute before the Codex negative tap, with no after-ready target mutation. That omission's cause remains unknown. Exact operation-key/receipt-ID and updatedAt equality is report-only; independently inspected inventories show stable totals and zero target state. Sampled native frames do not establish continuous absence of a flash. The current Codex History/thread metadata and completed reply establish conversation continuity; an unsaved live PID-to-thread observation is not claimed as proof of exclusive process ownership.
Running-app evidence is on
ffbcbfaa553ddba5cff9645e71c71307d5e8a172and the earlier unchanged flow heads identified in the review status. It carries across the test-only commits5449eb2,8edb6a6,7ce89cfand accepted main merge9174120; these were reviewed, and CI passed on the final head. Screenshots and the complete validation summary are in the review status comment.