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>
|
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:
Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
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>
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>
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>
Upstream dropped paired-terminal-desktop-reveal.test.ts as low-value (stablyai#38642). Keep only the two cases this PR adds: both reveal steps are bounded before the host fallback, and a slow host asks no desktop. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@AmethystLiang ping on this since you're on #31073. Two more people ran into it this week (the comment on #31073 and #38927), so it'd be nice to get it in. The workflows need an approval to run since it's from a fork. |
|
Thank you @Velm14 . Look into it |
Upstream moved the terminal CLI into src/cli/terminals and dropped the handlers test; keep our switch reveal coverage there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks! Fwiw two more people hit the same thing on #31073 since, and worktree activate and file open --focus have the same root cause, happy to follow up on those after this one. |
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