Repository navigation
Windows terminals can Switch to Chat: the terminal owner ends its job and reports every process - #29367
Closed
brennanb2025 wants to merge 7 commits into
Closed
Windows terminals can Switch to Chat: the terminal owner ends its job and reports every process#29367brennanb2025 wants to merge 7 commits into
brennanb2025 wants to merge 7 commits into
Conversation
…option The terminal's owner (daemon or in-process provider) records every job member with its creation time, then ends the job; only a successful job termination counts as proof. WSL panes and panes with a wsl.exe member refuse. Older daemons answer not-terminated through the protocol gate, keeping PR1's refusal.
…e-adopt' into brennanb2025/flip-pr1b-windows-job # Conflicts: # src/main/runtime/structured-agent-cli-stop.ts
…e-adopt' into brennanb2025/flip-pr1b-windows-job # Conflicts: # src/main/daemon/daemon-foreground-confirmation-protocol.test.ts # src/main/daemon/daemon-protocol-version.ts # src/main/daemon/macos-daemon-launchd.test.ts # src/shared/local-build-compatibility-contract.json # src/shared/local-build-compatibility-contract.ts
brennanb2025
marked this pull request as ready for review
October 16, 2026 06:36
brennanb2025
marked this pull request as draft
October 16, 2026 06:39
brennanb2025
marked this pull request as ready for review
October 16, 2026 06:39
…hub.com/stablyai/orca into brennanb2025/flip-pr1b-windows-job
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.
Stacked on #29242 (merge that first). Part of STA-10705.
Problem
#29242 makes "Switch to Chat" stop the terminal's agent and prove every process under that terminal is gone before a chat takes over the same conversation. Without that proof, two programs end up writing one conversation (real-app runs showed Claude and OMP transcripts branching on macOS and Linux).
On Windows #29242 cannot give that proof yet, so it refuses the switch while the terminal's agent is running ("Exit Claude in the terminal first, then resume this conversation in chat."). Windows processes can leave their parent chain: a Windows QA run saw a Codex branch detached from the shell's ancestry and a child process that outlived its pane by 30 seconds. Only the terminal's Windows job object lists everything the terminal started, and only the process that holds the terminal (the terminal daemon, or Orca itself when the daemon is off) can read it.
What changes for users
On Windows, "Switch to Chat" / "Stop and Switch to Chat" now works for PowerShell, CMD and Git Bash terminals the same way it does on macOS and Linux: the terminal closes and the chat continues the same conversation with its full history.
It still refuses, with the same message as before, when Orca cannot prove everything stopped:
wslis running (Windows cannot see the Linux agent inside it);Mechanism
terminatePtyJobAndReport, answered by whoever holds the terminal (the daemon's subprocess handle, or the in-process terminal provider). It records every member of the terminal's job object with its creation time, then ends the job. It reports success only when ending the job itself succeeded; ending a job takes every process in it at once, including any started after the read.Why this approach
Reading parent ids from Orca's own process table can't prove completeness on Windows (the detached branch above). The job object can, and the terminal's owner already ends jobs this way during forced teardown, so the proof and the stop are one operation instead of a stop followed by a hope. The common pattern for this kind of handoff is to wait for the exit of a process the app spawned itself; a terminal agent's parent is the user's shell, so here the terminal's owner reports what it contained instead (intended difference, same as #29242).
Limitations
Testing
Unit tests for the job report (complete read, WSL refusal, retry after a new member, failed job termination), the old-daemon gate, and the Windows survivor probe. Real Windows QA (PowerShell, CMD, Git Bash, WSL, and a terminal on the previous daemon) follows before this leaves draft.