Repository navigation
fix(runtime): reject unsupported renderer-owned tab properties - #32018
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
Co-Authored-By: Claude <noreply@anthropic.com>
…and main typechecks again (#32168) #32018 pushed headless-terminal-tab-close.ts over the 300-line lint limit, and its new test passed sleepWorktree to RuntimeNotifier after #31564 removed it. setMobileSessionTabProps moves unchanged into RuntimeHeadlessTabProperties, which already owns the helpers it calls and directly extends the close class.
ELI5
An agent (or a paired client) can ask Orca to pin, color, or switch the view of a terminal tab with the
session.tabs.setTabPropsRPC. When the Orca desktop window is open, the window owns the tab layout and this path simply ignored pin/color/view-mode, but it still answered{updated: true}. So the caller was told "done" when nothing happened (#31173). If the request also had a new title, the tab got renamed while the rest was silently dropped.After this PR, with a desktop window open, a request that includes
isPinned,color, orviewModeis refused with the existingcapability_unsupportederror, and nothing is changed (no partial rename). The caller now learns the edit did not happen.What does not change:
orca serve, no window) still persist pin/color/view mode as before.ORCA_LAYOUT_OWNER=main, off in shipped builds) still apply the props through main.This does not make pinning work with the window open. That is fixed by design by the single-copy layout refactor (main owns tab props). See related work below.
Related work
updated: true, which is the part this PR covers. A CLI pin command and readback of pin state are still open.setTabPropspath, which this PR leaves alone.Who sees a difference
capability_unsupportedinstead of a falseupdated: true.setWebRuntimeTabPropscatches the new error and logs aconsole.warn. Nothing in the UI changes.session.tabs.setTabProps. No change.capability_unsupportedis an existing RPC error code that clients already handle as a normal failure.Verification
pnpm test src/main/runtime/renderer-owned-tab-properties.test.ts src/main/runtime/rpc/methods/workspace-layout-paired-desktop.test.ts src/main/runtime/rpc/methods/session-tab-agent-capability-mutations.test.ts src/main/runtime/windowless-main-layout-commands-layout-owner.test.ts src/renderer/src/runtime/web-runtime-session-tab-props.test.ts: 5 files, 87 tests pass.session.tabs.setTabPropsthroughRpcDispatcherinto a realOrcaRuntimeService. Only theBrowserWindowlookup is mocked. With the guard disabled, all 12 refusal cases fail: they returnok: true, and the mixed cases rename the tab. With the guard on, they pass. The title-only cases pass both ways.oxlintandoxfmt --checkare clean on the changed files.Visual proof
N/A. The change is RPC-only and there is no UI change.
Notes
headlessTerminalFallbackTitlemoved unchanged intoRuntimeHeadlessTabProperties, with an abstract declaration left behind, soheadless-terminal-tab-close.tsstays under its line limit.