Repository navigation
fix(terminals): automation runs, CLI tabs and folder-workspace browser tabs follow the owner - #27246
Merged
Merged
Conversation
…r tabs follow the owner - An automation run on a paired server opens its mirrored pane, or asks the server to focus it when the mirror has not loaded it yet, instead of reporting "Run terminal is unavailable." while the server still runs it. - This desktop's CLI browser tab create/close/profile requests are refused only for a workspace a paired server owns, not whenever a paired server is the Active Server. - browser.tabCreate resolves folder workspaces for server-hosted pages, as it already did for client-hosted ones.
Collaborator
Author
|
P0/P1 review: own review plus an independent reviewer. The cross-model reviewer could not be started (the orchestration run was fenced: consumer_fenced). Result: no P0/P1 findings. Two P2 notes were fixed in d45df1f:
Two P2 notes were left as they are:
|
9 tasks done
7 of 9 tasks
8 of 10 tasks
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
Three actions picked the wrong machine. An automation run on a paired server looked "unavailable" even though the server still had it open. A browser tab asked for by a CLI on this computer was refused just because a paired server was the selected "Active Server". And a paired server could not open a browser tab for a folder workspace at all. Each now follows the machine that owns the workspace.
What Changed
Automation runs on a paired server (#21213).
orca terminal readon the server showed the live run.web-terminal-<host tab>) whose PTY id is the server's terminal handle, so comparing the server's PTY id with local state could never match.resolveAutomationRunTerminalTargetnow also checks the mirrored tab: the same pane, bound to a live PTY from the owning server. The owner comes fromresolveOwner(which never reads the Active Server setting). If there is no mirrored pane yet, the action calls the existingsession.tabs.activatewith a focus intent, the same path tab clicks use.Local CLI browser tabs with a paired server selected (#22275).
orca tab create --worktree path:<local worktree>failed with "Browser tabs are unavailable while a remote runtime is active" whenever a paired server was the Active Server. Tab close and profile change failed the same way.browser:requestTabCreate/Close/SetProfilereplaced its Active Server check with an owner check. An explicit worktree id from main is trusted, because main already resolved it against this computer's own catalog.Browser tabs in a paired server's folder workspace (#21353).
browser.tabCreateused the folder-aware resolver only for client-hosted pages. Every other placement used the git-worktree resolver, which answersselector_not_foundforfolder:ids. It now usesresolveBrowserWorkspacefor every placement (list and close already did).Why
Each fix replaces a focus- or shape-based guess with the workspace's real owner, using primitives that already exist:
resolveOwner, the session mirror's tab ids,session.tabs.activatewith focus intents, andresolveBrowserWorkspace. There is no new RPC, so nothing changes on the wire. An older server still refuses folder browser tabs until it updates, which is today's behavior.Alternatives considered:
Linked Issue
Fixes #21213
Fixes #22275
Fixes #21353
Visual Proof
N/A. This machine is load-capped, so no Electron runs here. The behavior is covered by acceptance tests that fail on
origin/main(see Testing).Testing
Acceptance tests. Each was run against the
origin/mainversions of the source files first and failed there:automation-run-workspace-action.paired-server.test.ts: the mirrored pane opens; with no mirror the server is asked to focus the host tab and pane; "unavailable" appears only when the server refuses. On main, 2 of 3 fail (the third checks the refusal toast, which main also shows).browser-request-ipc-bridge.owner.test.ts: with a paired server as Active Server, an explicit local create succeeds; falling back to a server-owned active workspace is refused; closing a local page works and closing a server-owned page is refused. All 3 fail on main.browser-tab-create-folder-workspace.test.ts: a server-placementbrowser.tabCreateforid:folder:…creates the page. On main it fails withselector_not_found.Also ran:
pnpm tc, focused vitest (automations, hooks/ipc-events, i18n, runtime browser: 1175 tests), oxlint,check:code-quality:changed, owner-routing ratchet, localization catalog/extraction/coverage checks.Review
P0/P1 review: own review plus an independent reviewer (see comments).
Agent skill upstream boundary
Notes
resolveOwner's folder arm.selector_not_foundfor folder browser tabs, andsession.tabs.activateis an existing method.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)