{{ message }}
Repository navigation
Conversation
terminal switch --environment revealed the terminal on this machine's desktop only when the paired host answered navigated:false. A paired host that is itself a desktop app navigates its own window and answers true, so this desktop never moved and the other machine's window jumped instead. The local desktop is now asked first; the paired host only moves its own window when no desktop here shows that environment. Fixes stablyai#31073 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
fa77de59-f886-494a-be23-846bdb218f33
📒 Files selected for processing: 3
src/cli/handlers/terminal-switch-paired-reveal.test.tssrc/cli/handlers/terminal.tssrc/cli/paired-terminal-desktop-reveal.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
A local desktop that accepted the reveal but never answered held the fallback for the client's default request timeout. The probe now gives up just after the desktop's own 10 s renderer wait. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a144582c-7535-4842-b44d-28d727b4699f
📒 Files selected for processing: 2
src/cli/paired-terminal-desktop-reveal.test.tssrc/cli/paired-terminal-desktop-reveal.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
The runtime-source fence can probe status.get on the local runtime before terminal.reveal, and that probe used the client's 60 s default. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ 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:
55366747-e37f-42fc-b409-444e8b4e043a
📒 Files selected for processing: 2
src/cli/handlers/terminal-switch-paired-reveal.test.tssrc/cli/handlers/terminal.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.
A cold worktree catalog can make terminal.show scan before it answers, and the host fallback waits on it now that the local reveal runs first. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.

ELI5
orca terminal switch --environment <name>should show that terminal in the Orca window on the machine where you ran the command. When the other machine was also running the Orca desktop app, its window jumped to the terminal and yours stayed where it was.What Changed
navigated: false. A headlessorca servealways answers false (orca terminal switch --environment <name>does not move the desktop UI to a terminal on a paired remote runtime #24688, fixed by feat(terminal): show a paired server's terminal in this desktop on terminal switch #28023), but a paired desktop app navigates its own window and answers true, so the local reveal never ran ([Bug]: terminal switch --environment doesn't move the local desktop when the paired environment is a desktop app (follow-up to #24688) #31073).terminal.reveal, same as feat(terminal): show a paired server's terminal in this desktop on terminal switch #28023). If that works, it callsterminal.focuson the host withnavigation: 'caller', which resolves the terminal without moving the host's window, and reportsnavigated: true. Only when no desktop here shows that environment does the host navigate its own window, as before.Why
#28023 already said "the desktop on the CLI's own machine is the one to move"; it just decided that from the host's answer, which is the wrong signal once the host has a window. Asking the local desktop first is the direct form of the same rule, and it also stops the other machine's window from jumping for whoever sits at it.
callerandhostwere added together in #9664, so any server that acceptshostacceptscaller— no mixed-version risk.Linked Issue
Fixes #31073
Visual Proof
N/A — CLI routing only; the window behaviour is the same reveal #28023 added, now also reached for paired desktops.
Testing
src/cli/handlers/terminal-switch-paired-reveal.test.tsnow covers: the local desktop moves and the host getsnavigation: 'caller'for both a windowless server and a paired desktop (both cases fail on main); the host navigates itself when no local desktop shows the environment; local terminals still go straight to the host.pnpm test src/cli/handlers src/cli/paired-terminal-desktop-reveal.test.ts— 55 files, 595 tests pass.tc:cli, oxlint, oxfmt andcheck:code-quality:changedpass.I couldn't run the two-desktop setup from the issue myself; @luisvae, if you have a minute, a run of the repro from [Bug]: terminal switch --environment doesn't move the local desktop when the paired environment is a desktop app (follow-up to #24688) #31073 on this branch would confirm it.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Claude Code (Claude Opus 5.5).
Review
Agent skill upstream boundary
Notes
navigated: falsebecause the desktop briefly has no repo catalog for the paired host). That is a catalog race, already being looked at, and this PR doesn't change it.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code