Repository navigation
Name the terminal holding a conversation, with a Close terminal button - #33721
brennanb2025 wants to merge 128 commits into
Conversation
…uses to start while a terminal writes its conversation Each chat link now carries its role (head or earlier) and key; Session History names the chat continuing a conversation first, duplicate adoption checks only head links in both the pre-commit check and the store transaction, and terminal resumes stay refused exactly as before. The terminal-writer check now also runs inside acquireOwner before the spawn, refusing with the typed pre-spawn reason conversationOpenInTerminal.
…l reports it An in-memory registry of managed terminal starts per conversation, registered in the same step as the resume admission (terminal.send with a resume command, createTerminal with a command), bound to the PTY execution that runs it, and ended only when that terminal's hooks report the conversation or the execution is gone. A chat's agent start refuses while an entry may hold its conversation.
… an open chat continues Resume recipes built from a pane's saved facts (cold restore, deferred and late reattach, sleeping wake, host mobile materialization) carry resumeOrigin 'saved'. The execution host decides before any command is issued: while an open chat continues the conversation, or a chat may be writing it, the pane starts its plain shell with the started-fresh notice and its saved claim is forgotten; with unreadable records only a saved restore is refused and its record kept. An admitted resume registers its managed start in the same step, so the chat's agent start refuses until the terminal reports it or exits. Clearing the last saved record now reaches disk.
…s terminal in place One enablement source (Codex) drives same-id terminal resume, the per-agent switch capability and History. agentSession.switchToTerminal admits only an idle chat, registers the switch claim in the chat's ordered step, stops the agent with proven exit while the tab stays, and returns the resume recipe. The claim refuses a chat start until the switch terminal's own spawn binds it; the bound proof ends only when the agent that terminal ran is proven exited and the pane is shell alone.
…nal in place Switch to CLI (tab menu, hover card, chat top-right icon, History) asks the chat's host to stop the idle chat and opens the same-id resume in the chat's slot, then closes the chat tab. Switch to native chat opens the chat in the terminal's slot, or reveals the chat that already holds the conversation, and closes the terminal pane. Hosts without the agent's switch capability keep the new-tab entries, worded Resume in New Chat / Resume in New Terminal; the view toggle reads Show as chat / Show as terminal.
Covers the host op stopping an idle chat while a racing send is refused, the switch claim lifetime (unaccepted lapse, accepted spawn past the window, bind, identity-only replay, second switch refused), the switch spawn claiming before its first await, and the renderer refusing hosts that do not advertise the switch. Updates label and owner-reveal expectations for the new wording.
…ches back to it Switching a terminal's conversation into the chat that already holds it now starts that chat's agent on its host (agentSession.switchToChat), so the provider open catches up on the terminal's turns before the user sends. The host uses the ordinary operation start and answers success only when that same child is ready; an ended child's typed failure, such as the conversation still open elsewhere, is the answer. The renderer sends it only to hosts that advertise the switch, retires the terminal pane only after the start succeeded and the chat's tab is really active, and keeps the terminal on any refusal.
…k it A switch claim is now owned by the terminal spawn attempt that accepted it (its host session id, else its pane). Only one attempt may hold a conversation: a different attempt is refused while one is accepted or a switched terminal may still hold it, and a retry of the same attempt joins it. Settlement follows the spawn's real result, including a reattach; a spawn that ended without a reply keeps its claim until the host's own session list proves that session absent, so a lost reply can no longer let a chat start beside the terminal. Also from review: a paired Orca server that switches the agent in place now offers the switch back from its terminals, and the paired create names its new tab so the switch back is offered before the first prompt; the presentation seed binds to the switched pane's leaf and PTY and ends when that PTY is replaced or the pane goes, so a split's plain shell is never switched or closed; and an unreadable Windows process identity reads as unverifiable, with only a fresh process table's absence or a different start time proving exit.
…roves the start over The chat to terminal switch now carries one generation and the owner that creates the terminal. The daemon session and the local process are bound to that generation before any later step can fail, and only their own end, or a proved agent exit with that exact shell alone, releases the conversation. The accepted start is saved on the chat it left, so a restart still knows it may exist; a lost owner never speaks for it. The caller-side settlement and the renderer's guessed tab seed are gone. A switched terminal's conversation is presented from the host's launch identity, stamped with the exact PTY and incarnation, and the switch back retires only the pane that still holds that execution.
… just its shell, are proved over - Every release needs each recorded agent proved exited; the owner's root exit alone no longer clears it, and the daemon reports startup settled only once its write gate flushes. - Descriptor writes are compare-and-set on generation, so a retired switch's late evidence never replaces or resurrects one. - After full owner loss, a host reboot since acceptance ends a start with no recorded identity; evidence a save missed is retried. - An owner that cannot answer fails the routed read and holds; only every reachable owner answering without it counts as loss. - The local owner binds the process before any callback or cancellation cleanup can throw. - Snapshots carry the launch stamp, the paired projection drops a stamp naming a replaced incarnation, and the switch back retires a pane only while its host still reports the incarnation it started with.
…reattached switch terminal The saved switch keeps the host boot as its id where the OS has one plus the boot time derived from uptime, so Windows can also prove a later boot (by more than 60 seconds). A reattached switch terminal regains its exact-execution stamp from the saved switch, without persisting it.
…tirement, owner-recovered restamp - Only a changed OS boot id proves a later boot; Windows (no id) never releases on a wall clock. - A paired switch back closes its terminal through the host's terminal.close under the incarnation it started with; the host refuses a replacement under the same handle. - After a restart, a reattached switch terminal asks the original owner for its binding, saves it, and restamps only while that exact execution is still the pane's. - Saved evidence is a copy, so the frozen journal row never freezes the live claim's processes. - A failed local commit callback stops that exact process; the switch ends only on its exit.
… on every platform A saved switch records the host boot id (Linux boot_id, macOS boot session, or the Windows BootId through one read-only reg.exe query) and the uptime at acceptance. After owner loss, a different boot id or an uptime lower than recorded proves a reboot; wall-clock time never does, and macOS uptime, which Node derives from the wall clock, is not used.
|
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. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 6

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:
d2fc5925-078a-4ee7-84d7-1903ff5fc9c2
Files ignored due to path filters: 1-
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
Files selected for processing: 285-
config/main-layout-writer-baseline.txtconfig/scripts/check-layout-writer-ratchets.mjsconfig/scripts/check-layout-writer-ratchets.test.mjsmobile/src/session/MobileNativeChatNoticeRow.held-terminal.test.tsxmobile/src/session/MobileNativeChatNoticeRow.tsxmobile/src/session/MobileSessionActiveContent.tsxmobile/src/session/use-mobile-session-tab-application-launch.test.tssrc/main/agent-hooks/managed-hook-stdin-lifecycle.test.tssrc/main/agent-hooks/server-launch-resume-identity.test.tssrc/main/ai-vault/structured-chat-cli-fork.tssrc/main/ai-vault/structured-session-ownership.test.tssrc/main/ai-vault/structured-session-ownership.tssrc/main/daemon/daemon-pty-session-control.tssrc/main/daemon/daemon-shutdown-final-checkpoint-caller-deadline.test.tssrc/main/ipc/pty/host-env/saved-resume-admission.tssrc/main/ipc/pty/ipc/renderer-kill.tssrc/main/ipc/pty/provider/shutdown-detect.tssrc/main/ipc/pty/runtime/controller-deps.tssrc/main/ipc/pty/runtime/kill-same-id-respawn.test.tssrc/main/ipc/pty/runtime/kill.tssrc/main/ipc/pty/runtime/spawn-commit-response.tssrc/main/ipc/pty/runtime/spawn-state.tssrc/main/ipc/pty/session.tssrc/main/ipc/pty/spawn-commit-assembly.tssrc/main/ipc/pty/spawn-commit-publication.tssrc/main/native-chat/agent-session-wire/structured-agent-session-conversation-lifetime.tssrc/main/native-chat/agent-session-wire/structured-agent-session-create-adoption.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-failed-create-refusal.tssrc/main/native-chat/agent-session-wire/structured-agent-session-failure-text.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host-mutations.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host-types.tssrc/main/native-chat/agent-session-wire/structured-agent-session-host.tssrc/main/native-chat/agent-session-wire/structured-agent-session-idle-sweep.tssrc/main/native-chat/agent-session-wire/structured-agent-session-refusal-details.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-start-failure-row.tssrc/main/native-chat/agent-session-wire/structured-agent-session-switch-admission.tssrc/main/native-chat/agent-session-wire/structured-agent-session-switch-to-chat.tssrc/main/native-chat/agent-session-wire/structured-agent-session-terminal-writer-acquire.test.tssrc/main/native-chat/agent-session-wire/structured-provider-session-ownership.tssrc/main/persistence/loading-store/profile-state-delayed-authority-fixture.tssrc/main/persistence/loading-store/pty-spawn-commit-dependencies-fixture.tssrc/main/persistence/terminal-topology/layout-command-persistence.tssrc/main/persistence/terminal-topology/original-terminal-close-store.test.tssrc/main/providers/local-pty-provider-shutdown.test.tssrc/main/providers/local-pty-provider.tssrc/main/providers/local-pty-termination.tssrc/main/runtime/__fixtures__/orca-runtime-terminal-close-continuity-fixtures.tssrc/main/runtime/__fixtures__/terminal-close-runtime.test-fixture.tssrc/main/runtime/mobile-session-layout-projection.tssrc/main/runtime/mobile-session-switch-placement.test.tssrc/main/runtime/mobile-session-tab-close-outcome.tssrc/main/runtime/orca-runtime-original-terminal-close-store.test.tssrc/main/runtime/orca-runtime-original-terminal-close.test.tssrc/main/runtime/orca-runtime-terminal-close-continuity.test.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/orchestration/chat-assignee.test.tssrc/main/runtime/orchestration/chat-assignee.tssrc/main/runtime/rpc/methods/session-tabs.tssrc/main/runtime/rpc/methods/structured-agent-session-gate-classification.test-fixture.tssrc/main/runtime/rpc/methods/structured-agent-session-switch-to-chat.tssrc/main/runtime/rpc/methods/structured-agent-session-switch-to-terminal.tssrc/main/runtime/rpc/methods/structured-agent-session.test.tssrc/main/runtime/rpc/methods/structured-agent-session.tssrc/main/runtime/rpc/methods/terminal/terminal-lifecycle-methods.tssrc/main/runtime/rpc/runtime-close-attribution.test.tssrc/main/runtime/runtime-layout-apply.test.tssrc/main/runtime/runtime-layout-apply.tssrc/main/runtime/runtime-notifier-contract.tssrc/main/runtime/runtime-pty-controller-contract.tssrc/main/runtime/runtime-terminal-contracts.tssrc/main/runtime/session-graph/session-window-graph.tssrc/main/runtime/session-lifecycle/close/close-mobile-row-in-main-layout.tssrc/main/runtime/session-lifecycle/close/close-mobile-session-tab.tssrc/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.tssrc/main/runtime/session-lifecycle/projection/prune-mobile-session-tab-group-layout.tssrc/main/runtime/session-tabs/explicit-terminal-close-pty-stops.tssrc/main/runtime/session-tabs/explicit-terminal-close-stops.tssrc/main/runtime/session-tabs/explicit-terminal-tab-close.tssrc/main/runtime/session-tabs/paired-host-terminal-close.tssrc/main/runtime/session-tabs/structured-session-cli-writer-host.tssrc/main/runtime/session-tabs/structured-session-terminal-launch-retirement.tssrc/main/runtime/session-tabs/terminal-surface-close-commit.tssrc/main/runtime/structured-agent-cli-writers.test.tssrc/main/runtime/structured-agent-cli-writers.tssrc/main/runtime/structured-agent-session-runtime.tssrc/main/runtime/structured-agent-session-windowless-layout-host.test.tssrc/main/runtime/structured-chat-coordinator-mail-rig.test-fixture.tssrc/main/runtime/structured-chat-dispatch-worker-lifecycle.test.tssrc/main/runtime/terminal-intentional-stops.tssrc/main/runtime/terminal-surface-close.tssrc/main/runtime/terminal/identity/terminal-handle-bindings.tssrc/main/runtime/terminal/launch/failed-start-pane.tssrc/main/runtime/terminal/launch/mobile-terminal-create.tssrc/main/runtime/terminal/launch/mobile-terminal-owned-create.tssrc/main/runtime/terminal/launch/mobile-terminal-renderer-create.tssrc/main/runtime/terminal/lifecycle/floating-session-liveness.tssrc/main/runtime/terminal/output/provider-buffer-capture.tssrc/main/runtime/terminal/query/pty-terminal-summary.tssrc/main/runtime/terminal/recovery/resolve-terminal-pane.tssrc/main/runtime/workspace-session-terminal-tab-retirement-identity.tssrc/main/runtime/workspaces/workspace-process-listing.tssrc/main/window/terminal-tab-close-request-relay.tssrc/preload/api/pty-api.tssrc/preload/api/pty-bridge-session-control.tssrc/renderer/src/components/TerminalLegacyTerminalPanes.tsxsrc/renderer/src/components/native-chat/NativeChatNoticeRow.tsxsrc/renderer/src/components/native-chat/NativeChatPaneHeader.test.tsxsrc/renderer/src/components/native-chat/NativeChatPaneHeader.tsxsrc/renderer/src/components/native-chat/NativeChatResumeInCliButton.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.history-read-state.test.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.tsxsrc/renderer/src/components/native-chat/NativeChatTopRightControls.tsxsrc/renderer/src/components/native-chat/close-holding-terminal.test.tssrc/renderer/src/components/native-chat/close-holding-terminal.tssrc/renderer/src/components/native-chat/native-chat-header-ownership.test.tsxsrc/renderer/src/components/native-chat/native-chat-held-terminal-resend.test.tssrc/renderer/src/components/native-chat/native-chat-held-terminal-resend.tssrc/renderer/src/components/native-chat/native-chat-held-terminal.test.tsxsrc/renderer/src/components/native-chat/native-chat-held-terminal.tsxsrc/renderer/src/components/native-chat/native-chat-orca-stop-context.tssrc/renderer/src/components/native-chat/native-chat-structured-session-notices.tssrc/renderer/src/components/native-chat/structured-agent-session-controller-input.tssrc/renderer/src/components/native-chat/use-native-chat-context-menu.test.tsxsrc/renderer/src/components/native-chat/use-native-chat-context-menu.tsxsrc/renderer/src/components/native-chat/use-structured-agent-session.tssrc/renderer/src/components/right-sidebar/AiVaultPanel.legacy-filter.test.tsxsrc/renderer/src/components/right-sidebar/AiVaultSessionActionMenuItems.tsxsrc/renderer/src/components/right-sidebar/AiVaultSessionDetails.tsxsrc/renderer/src/components/right-sidebar/AiVaultSessionDetailsSwitchButtons.tsxsrc/renderer/src/components/right-sidebar/AiVaultSessionRow.structured-title.test.tsxsrc/renderer/src/components/right-sidebar/AiVaultSessionRow.tsxsrc/renderer/src/components/right-sidebar/AiVaultSessionSurfaceSwitchMenuItems.tsxsrc/renderer/src/components/right-sidebar/AiVaultVirtualRow.test.tsxsrc/renderer/src/components/right-sidebar/SessionRowTrailingActions.tsxsrc/renderer/src/components/right-sidebar/ai-vault-history-native-return.test.tsxsrc/renderer/src/components/right-sidebar/ai-vault-session-cli-fork-copy.tsxsrc/renderer/src/components/right-sidebar/ai-vault-session-in-place-switch.tssrc/renderer/src/components/right-sidebar/ai-vault-session-launch-actions.tssrc/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.test.tssrc/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.tssrc/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-workspace.test.tssrc/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-workspace.tssrc/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat.tssrc/renderer/src/components/right-sidebar/use-ai-vault-panel-session-resume.tssrc/renderer/src/components/tab-bar/CliChatResumeMenuItems.tsxsrc/renderer/src/components/tab-bar/NativeChatCliForkMenuItems.tsxsrc/renderer/src/components/tab-bar/SortableTab.rename-shortcut.test.tsxsrc/renderer/src/components/tab-bar/SortableTab.tsxsrc/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsxsrc/renderer/src/components/tab-bar/SortableTabContextMenu.tsxsrc/renderer/src/components/tab-bar/TabHoverCard.tsxsrc/renderer/src/components/tab-bar/TabSessionSurfaceSwitchMenuItems.test.tsxsrc/renderer/src/components/tab-bar/TabSessionSwitchHoverAction.tsxsrc/renderer/src/components/tab-bar/cli-chat-resume-exit-return.test-fixture.tssrc/renderer/src/components/tab-bar/cli-chat-resume-feedback.test.tssrc/renderer/src/components/tab-bar/cli-chat-resume-feedback.tssrc/renderer/src/components/tab-bar/cli-chat-resume-mocks.test-fixture.tssrc/renderer/src/components/tab-bar/cli-chat-resume-parked-retirement.test-fixture.tssrc/renderer/src/components/tab-bar/cli-chat-resume-run.test.tssrc/renderer/src/components/tab-bar/cli-chat-resume-run.tssrc/renderer/src/components/tab-bar/cli-chat-resume-source.tssrc/renderer/src/components/tab-bar/cli-chat-resume-terminal-capture.tssrc/renderer/src/components/tab-bar/cli-chat-resume-transport.test-fixture.tssrc/renderer/src/components/tab-bar/native-chat-cli-switch-run.test.tssrc/renderer/src/components/tab-bar/native-chat-cli-switch-run.tssrc/renderer/src/components/tab-bar/tab-session-history-switch.test.tssrc/renderer/src/components/tab-bar/tab-session-history-switch.tssrc/renderer/src/components/tab-bar/tab-title-tooltip.test.tsxsrc/renderer/src/components/terminal-pane/TerminalContextMenu.tsxsrc/renderer/src/components/terminal-pane/TerminalOverlaySlot.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneResumeInChatButton.test.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneResumeInChatButton.tsxsrc/renderer/src/components/terminal-pane/layout-owner-pane-close-command.tssrc/renderer/src/components/terminal-pane/pending-pane-close-confirmation.test.tssrc/renderer/src/components/terminal-pane/pending-runtime-pane-close.test.tssrc/renderer/src/components/terminal-pane/pty-connection-types.tssrc/renderer/src/components/terminal-pane/pty-dispatcher.tssrc/renderer/src/components/terminal-pane/pty-exit-delivery.tssrc/renderer/src/components/terminal-pane/pty-transport-types.tssrc/renderer/src/components/terminal-pane/request-active-terminal-pane-close.tssrc/renderer/src/components/terminal-pane/retire-unbound-runtime-terminal-pane.tssrc/renderer/src/components/terminal-pane/terminal-pane-lifecycle-close.tssrc/renderer/src/components/terminal-pane/terminal-pane-mount-cleanup.tssrc/renderer/src/components/terminal-pane/terminal-pane-mount-context.tssrc/renderer/src/components/terminal-pane/terminal-pane-mount-preparation.tssrc/renderer/src/components/terminal-pane/terminal-pane-mount-registration.tssrc/renderer/src/components/terminal-pane/terminal-pane-pane-closed.tssrc/renderer/src/components/terminal-pane/terminal-pane-types.tssrc/renderer/src/components/terminal-pane/terminal-parked-watcher-registry.tssrc/renderer/src/components/terminal-pane/terminal-presentation-retirement.test-fixture.tssrc/renderer/src/components/terminal-pane/terminal-presentation-retirement.test.tssrc/renderer/src/components/terminal-pane/terminal-presentation-retirement.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-close-actions.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-local-close.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-mount-lifecycle.tssrc/renderer/src/components/terminal/terminal-tab-actions.tssrc/renderer/src/components/ui/hover-card.tsxsrc/renderer/src/components/use-terminal-close-actions.tssrc/renderer/src/constants/terminal.tssrc/renderer/src/hooks/ipc-events/agent-status-partial-updates.tssrc/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.tssrc/renderer/src/hooks/ipc-events/terminal-request-ipc-bridge-placement.test.tssrc/renderer/src/hooks/ipc-events/terminal-request-ipc-bridge.tssrc/renderer/src/hooks/useIpcEvents-agent-conversation-cap.test.tssrc/renderer/src/hooks/useIpcEvents-agent-status-batch-projection.test.tssrc/renderer/src/hooks/useIpcEvents-agent-status-owner-ordering.test.tssrc/renderer/src/i18n/en-runtime-required.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/activate-ai-vault-structured-session.tssrc/renderer/src/lib/agent-session/structured-agent-session-provisional-tab.test.tssrc/renderer/src/lib/agent-session/structured-agent-session-provisional-tab.tssrc/renderer/src/lib/ai-vault-tab-title-requests.tssrc/renderer/src/lib/in-place-switch-support.test.tsxsrc/renderer/src/lib/in-place-switch-support.tssrc/renderer/src/lib/launch-ai-vault-session-placement.test.tssrc/renderer/src/lib/launch-ai-vault-session.test.tssrc/renderer/src/lib/launch-ai-vault-session.tssrc/renderer/src/lib/pane-manager/pane-inline-images.tssrc/renderer/src/lib/pane-manager/pane-lifecycle.tssrc/renderer/src/lib/pane-manager/pane-manager-tree-mutations.tssrc/renderer/src/lib/pane-manager/pane-manager-types.tssrc/renderer/src/lib/pane-manager/pane-manager.tssrc/renderer/src/lib/pane-manager/pane-split-close.tssrc/renderer/src/lib/pane-manager/pane-webgl-renderer.tssrc/renderer/src/lib/pending-conversation-surface-switches.tssrc/renderer/src/lib/structured-agent-session-launch-surface.tssrc/renderer/src/runtime/mounted-terminal-tab-registry.tssrc/renderer/src/runtime/structured-agent-session-client.tssrc/renderer/src/runtime/web-runtime-session-tab-lifecycle.tssrc/renderer/src/runtime/web-runtime-session-terminal-pane-delegation.test.tssrc/renderer/src/runtime/web-runtime-session-test-harness.tssrc/renderer/src/runtime/web-runtime-session-types.tssrc/renderer/src/runtime/web-runtime-terminal-actions.tssrc/renderer/src/runtime/web-runtime-terminal-create-operation.tssrc/renderer/src/runtime/web-runtime-terminal-placement-settlement.tssrc/renderer/src/runtime/web-runtime-terminal-switch-placement.test.tssrc/renderer/src/runtime/web-session-tabs-sync/agent-status-primitives.tssrc/renderer/src/runtime/web-session-tabs-sync/state.tssrc/renderer/src/store/agent-conversation-retention.tssrc/renderer/src/store/index.tssrc/renderer/src/store/slices/agent-pane-conversation.tssrc/renderer/src/store/slices/agent-status-authority-actions.tssrc/renderer/src/store/slices/agent-status-drop-actions.tssrc/renderer/src/store/slices/agent-status-drop-reducer.tssrc/renderer/src/store/slices/agent-status-live-actions.tssrc/renderer/src/store/slices/agent-status-live-reducer.tssrc/renderer/src/store/slices/agent-status-provider-session-actions.tssrc/renderer/src/store/slices/agent-status-provider-session.test.tssrc/renderer/src/store/slices/agent-status-runtime.tssrc/renderer/src/store/slices/agent-status-slice-contract.tssrc/renderer/src/store/slices/agent-status.tssrc/renderer/src/store/slices/store-test-helpers.tssrc/renderer/src/store/slices/worktrees/teardown/worktree-purge-surface-patch.tssrc/renderer/src/store/terminals/terminal-actions.tssrc/renderer/src/store/terminals/terminal-state.tssrc/renderer/src/store/terminals/terminal-tab-close-providers.tssrc/shared/agent-session-failure-copy.tssrc/shared/agent-session-holding-terminal.tssrc/shared/agent-session-journal-cursor.tssrc/shared/agent-session-journal-schemas.tssrc/shared/agent-session-journal-types.tssrc/shared/agent-session-refusal-details.tssrc/shared/native-chat-types.tssrc/shared/protocol-version.tssrc/shared/rpc-contract/session-tabs-schemas-params.tssrc/shared/rpc-contract/terminal-unary-params.tssrc/shared/runtime-terminal-contracts.tssrc/shared/session-tab-placement-work.test-fixture.tssrc/shared/session-tab-placement.tssrc/shared/structured-agent-cli-conversation-adoption.tssrc/shared/structured-agent-session-status-block.tssrc/shared/terminal-layout-leaf-retirement.tssrc/shared/terminal-tab-close.tstests/e2e/cli-chat-resume-terminal-capture.unit.test.tstests/e2e/cross-version-wire/cross-version-agent-session-wire.unit.test.tstests/e2e/cross-version-wire/structured-agent-session-host-fixture.tstests/e2e/cross-version-wire/structured-agent-session-surface-calls.tstests/e2e/cross-version-wire/structured-agent-session-surface-execution.tstests/e2e/cross-version-wire/structured-agent-session-surface-manifest.tstests/e2e/terminal-presentation-retirement.unit.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
There was a problem hiding this comment.
Actionable comments posted: 10
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Major · Add nativeChatController to the test fixture. · MobileSessionActiveContent.tsx:95-102
mobile/src/session/MobileSessionActiveContent.tsx:95-102
🎯 Functional Correctness | 🟠 Major | ⚡ Quick winAdd
nativeChatControllerto the test fixture.
MobileSessionActiveContentreadsnativeChatController.nativeChatAgentduring render. The test casts a partial fixture toMobileSessionController, so the missing member can cause a render-timeTypeError. Production code treatsnativeChatControlleras required. Update the fixture instead of adding optional chaining.Suggested fixture update
const scope = { showLoadingState: shown === 'loading', activePendingTerminalTab: shown === 'pending' ? { title: 'Loading terminal' } : null, isPendingTerminalRecoveryParked: false, showEmptyState: false, terminals: [], notifyTerminalFrame, dictation: { isRecording: false }, + nativeChatController: { nativeChatAgent: null }, nativeChatSendError: { message: null, clear: () => {} } }Source: Pipeline failures

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:
d7ec9951-8c92-405f-8d8d-103ea0fd5267
Files selected for processing: 40-
mobile/src/session/MobileNativeChatNoticeRow.held-terminal.test.tsxmobile/src/session/MobileNativeChatNoticeRow.tsxmobile/src/session/MobileSessionActiveContent.tsxmobile/src/session/mobile-held-terminal-context.tsmobile/src/session/mobile-session-route-types.tsmobile/src/session/mobile-terminal-records.test.tsmobile/src/session/mobile-terminal-records.tssrc/main/native-chat/agent-session-wire/structured-agent-session-refusal-details.test.tssrc/main/runtime/session-tabs/structured-session-cli-writer-host.tssrc/main/runtime/structured-agent-cli-writers.test.tssrc/main/runtime/structured-agent-cli-writers.tssrc/renderer/src/components/native-chat/NativeChatNoticeRow.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.tsxsrc/renderer/src/components/native-chat/close-holding-terminal.test.tssrc/renderer/src/components/native-chat/close-holding-terminal.tssrc/renderer/src/components/native-chat/native-chat-held-terminal.test.tsxsrc/renderer/src/components/native-chat/native-chat-held-terminal.tsxsrc/renderer/src/components/native-chat/native-chat-orca-stop-context.tssrc/renderer/src/components/native-chat/native-chat-structured-session-notices.tssrc/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.test.tssrc/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.tssrc/renderer/src/components/tab-bar/cli-chat-resume-feedback.test.tssrc/renderer/src/components/tab-bar/cli-chat-resume-feedback.tssrc/renderer/src/components/tab-bar/cli-chat-resume-terminal-capture.tssrc/renderer/src/components/terminal-pane/pending-pane-close-confirmation.test.tssrc/renderer/src/components/terminal-pane/pending-split-close-test-fixture.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-close-actions.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-local-close.tssrc/renderer/src/components/terminal/running-terminal-close-guard.test.tssrc/renderer/src/components/terminal/running-terminal-close-guard.tssrc/renderer/src/components/terminal/terminal-tab-actions.tssrc/renderer/src/constants/terminal.tssrc/renderer/src/lib/frame-drawn-chat-tab-placement.test.tssrc/renderer/src/lib/frame-drawn-chat-tab-placement.tssrc/renderer/src/lib/structured-agent-session-launch-failure.tssrc/renderer/src/store/pinned-tab-close-guard.tssrc/renderer/src/store/running-terminal-close-confirm.tssrc/shared/agent-session-holding-terminal.tssrc/shared/agent-session-journal-schemas.test.tssrc/shared/agent-session-journal-schemas.ts
Files with no reviewable changes: 2-
- src/renderer/src/components/native-chat/native-chat-orca-stop-context.ts
- src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
|
Opening a conversation in chat could fail without naming the terminal still holding it, and Session History could leave a blank failed tab. This PR names and links the original holding pane and offers Close terminal through normal confirmation. Only that pane closes; the invoking chat remains. After Close, the user presses Send/Retry or reopens through Session History. Nothing continues automatically. Phone naming remains plain text; phone controls are temporary follow-up STA-12161. NOT READY at Measured against fixed stack base Verified app evidence and limits:
Same-machine pairing is supported verified loopback, not real SSH/tunnel QA. No-auto evidence is observed UI and explicit manual input accounting, not exhaustive hidden counters. Driver exit zero alone credits nothing. The Cancel screenshot catches command wording during dismissal; fixed-base source has the same copy and animation behavior, noticed and out of scope. Next DOM and independent terminal state show dismissal/preservation; exact screenshot-frame DOM was not recorded, and no consent bypass is proved. Final Claude setup retains a zero-input stale ownership rejection and a corrected continuation launched before the fresh gate relay; the later check measured 25.6 GB free, with no underfloor observed. All 27 final cleanup identities and 10 driver identities are absent, apps stopped gracefully, ports clear, and the QA ticket and exact lead terminal are closed. The M4Air config-hash change remains an unattributed report note. All 14 CodeRabbit threads received individual evidence-based replies and are resolved. The remaining phone literal-title bug is fixed in 6e61d4046109: The daemon inventory, provider exit-identity and unavailable-switch-tooltip observations are pre-existing at the base and recorded as noticed/out of scope. Supported-ID and caught-host-error traces refute the colon and promise premises. The two bounded Close traces found no stuck busy state or disabled follow-up action: current callers clear cancellation before confirmation, and an expired prompt is removed while the chat remains available. Expiry currently settles Still owed: the held one main sync after #31595, full CI and final readiness. Both affected paired-agent flows are functionally complete with the evidence limits above. The PR is out of draft; CLEAN/full CI remain unestablished. No completed-review marker is posted. The existing rendered Close test keeps a single disabled attempt until deferred completion, including after holder removal; it does not establish uncaptured busy pixels. For Brennan’s review Retained results: Windows named row, pin confirmation, chat after Close, Windows Codex replies, Windows Claude replies, different-holder in-place recovery, Codex acquisition notice, normal Retry, Claude acquisition notice, and Claude acquisition replies. Three code spots for judgment: host-owned refusal identity, paired capture match, and captured Close owner. Name-link reveals the original split and its sibling · Cancel settled, holder retained · Chat and composer after Close; generic historical failure row retained |
|
Closing: #36732 landed the replacement on main (Orca closes the terminal before continuing its conversation in chat). |





The problem
Opening a conversation in Chat UI can be refused while its agent still runs in a terminal, without identifying that terminal. Session History can also leave a blank failed chat after refusing the open. Tracked in #32154 and STA-12161.
What changes for users
The existing notice, not-sent row, and terminal/Session History toast can name the original holding terminal, link to its exact pane, and offer Close terminal. Close uses normal confirmation, closes only that split pane, and stays busy until the captured process exits. Cancel preserves the terminal. Missing or replaced execution evidence keeps today's unnamed sentence and control.
After Close terminal, the user presses Send/Retry in the chat, or reopens the conversation from Session History. Nothing resends, opens, or starts automatically. The invoking chat stays available. Close replaces Retry while the named holder is valid; afterward normal composer/Retry controls return. Definitive Session History refusal leaves no blank failed tab.
The phone shows the terminal name as plain text. Temporary: phone Close terminal follows in its own PR, tracked in STA-12161.
Implementation and compatibility
The existing terminal-writer check supplies optional pane/workspace/original-incarnation evidence beside the unchanged failure fact. Current host evidence must match before the client names, links or closes it. Older records/hosts retain generic guidance. No second writer guard, automatic retry obligation, source/account proof, capability, signer addition or replay-persistence field is introduced. The existing captured close accepts optional pin consent for this one confirmed attempt, while an optional declaration in the actual owner’s existing resolve response says whether that close contract is supported. Older hosts retain verified names and links where available, plus ordinary manual recovery; the new Close action requires positive support. Shared capture and Send/Retry remain available without that declaration.
Close reuses exact terminal capture, normal confirmation and existing close APIs. Pin consent reaches both the stop policy and saved pane removal; unattended captured retirement stays conservative. Dispatch and completion stay on the captured host/lifetime, cleanup handles cancellation and intentional pane teardown, and Close preserves the invoking screen unless later user navigation wins. An explicit terminal link still reveals its pane.
Intended: the independent external-writer check, original terminal-session attribution and independently versioned phone/paired hosts. The notice names the terminal the host’s check is refusing on; within one terminal session that includes later commands, since the check refuses while anything still runs there. A restarted pane with a different terminal incarnation is never attributed by the old refusal. Normal running-process confirmation shows what is running before close. Existing notice/toast surfaces, normal terminal close, invoking-screen preservation and publication after acceptance are reused. Ordinary user-invoked History account selection is unchanged; this PR does not promise terminal-source fidelity after a separate History reopen.
Size and review
Against the original stack base
00a4c508489e, current production6e61d4046109adds 1,385 lines and removes 274 across 56 files (+1,348/−237 ignoring whitespace). This leaves 15 additions under the 1,400 ceiling. Tests/fixtures are +2,039/−70 (+2,038/−69 ignoring whitespace), and locales +10/−0. The preexisting uncommitted lockfile artifact is excluded and untouched.Six source-review rounds finished with explicitly bounded repairs and continued mechanical acceptance. The consent repair carries existing confirmation through process stop and saved-pane retirement. The paired repair replaces an invalid host/client timestamp equality with the existing same-client mirror identity; host handle, original incarnation, presentation and pairing fences remain. Its recorded real mirror/host contract fails before repair and passes afterward, including replacement controls. No new field, RPC or file was needed. The continued reviewer accepted these repairs. There is no seventh source-review round.
Commit
d5c4b15a9835changed only tests/fixtures after productiond90f2f2f5317;42ffbc782fa6contains the bounded host-identity repair described below. Its SQLite fixture repair drains producers/hosts, closes the database through its existing owner, then removes the root. All 42 named contracts passed on macOS. Windows passed all 28 prior cleanup failures once, in disjoint runs of 22 and 6; both exited 0 with no body or teardown failure. Setup-only failures and the selector correction are retained separately. Ordinary hooks and nonforced pushes passed. Earlier 181 Windows boundary passes are retained; this is not a fresh single 209-case run.QA status
All 14 CodeRabbit threads received individual evidence-based replies and are resolved. The remaining phone literal-title bug is fixed in 6e61d4046109:
Budget $&is inserted literally. Its regression failed before the one-line callback repair; all seven existing-table phone cases pass afterward, and the continued reviewer accepted the exact diff. This tests-row change keeps the ordinary phone screenshot and unchanged lifecycle QA from42ffbc782fa6. No new QA or seventh source round ran.The daemon inventory, provider exit-identity and unavailable-switch-tooltip observations are pre-existing at the base and recorded as noticed/out of scope. Supported-ID and caught-host-error traces refute the colon and promise premises. The two bounded Close traces found no stuck busy state or disabled follow-up action: current callers clear cancellation before confirmation, and an expired prompt is removed while the chat remains available. Expiry currently settles
CANCELEDbeforeTIMEOUT; that diagnostic ordering is acknowledged, with no supported user-flow failure established or fix claimed.Not ready. Reviewed head is
6e61d4046109102f4a76feb8dd03b998077bd04d; retained process/lifecycle QA head is42ffbc782fa613af8dac8b6c92eb42475e04e1a9. Main synchronization remains held for #31595; full CI and final readiness are not established. No completed-review marker is posted.The bounded host-identity repair at the retained QA head emits the pane and original incarnation of the actual inspected host PTY. It removes PR-only caller-address plumbing so clients project the host address once. A real-shape producer regression fails on the parent and passes with this repair, and the continued reviewer accepted the exact diff. This is mechanical acceptance after six source rounds, not a seventh round or a QA pass.
The earlier uninstrumented paired Codex generic packet remains unclassified; a later instrumented attempt established and repaired the separate double-projection defect. The same-machine pairing uses supported verified loopback, not real SSH/tunnel evidence. No-auto evidence is observed UI plus explicit input accounting, not exhaustive hidden counters. Driver exit zero alone never credits a flow. The Cancel screenshot catches an agent-to-command wording change during dismissal; the fixed base has identical copy/exit-animation semantics, so it is noticed and out of scope. The next DOM has no dialog and independent terminal state remains intact; exact screenshot-frame DOM was not captured and no consent bypass is proved. Both affected paired-agent flows are functionally complete. Cleanup receipts verify graceful app stops, all 27 recorded final cleanup identities and 10 driver identities absent, and assigned ports clear; the QA ticket is released. The final Claude setup retained a zero-input stale ownership rejection and a corrected continuation that began before the fresh gate relay; the subsequent check showed 25.6 GB free, with no underfloor launch observed. The recorded M4Air config-hash change is an unattributed report note only.
Retained visual results: Windows named refusal, Windows chat after Close, different-holder in-place recovery, Codex acquisition notice, Codex normal Retry, Codex two manual replies, Claude acquisition notice, and Claude two manual replies.
Deferred publication and placement validation
Publication and placement are renderer tests-row flows. The resume integration tests drive pending publication, source-group ordering, frozen predecessors and overlapping completion/reordering. The provisional-tab test leaves pending/refused launches unpublished. The paired placement tests compare the deferred frozen group/predecessor address with the normal tab-present path for supported, unsupported and unknown placement capability, including host-tab mapping. The History launch test retains deferred publication on refusal without automatic retry. These are composed boundary tests, without claiming a real paired History click through transport to final host layout. Existing real runs separately observed no blank tab. No new test or live placement run is required by the current disposition; no fresh test execution is claimed here.
Paired Codex two real replies after explicit History reopen and manual Sends.
Busy behavior has focused test coverage: the rendered Close contract keeps one disabled attempt after the holder disappears until its deferred Close completes. This does not replace the uncaptured real busy pixels or renderer exit event. Final main sync, full CI and readiness remain owed.
Name-link reveals the original split and its sibling · Cancel settled, holder retained · Chat and composer after Close; generic historical failure row retained