Skip to content

fix(runtime): reject unsupported renderer-owned tab properties - #32018

Merged
nwparker merged 2 commits into
mainfrom
nwparker/renderer-tab-props-refusal
Oct 23, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/renderer-tab-props-refusal

Conversation

@nwparker

@nwparker nwparker commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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.setTabProps RPC. 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, or viewMode is refused with the existing capability_unsupported error, and nothing is changed (no partial rename). The caller now learns the edit did not happen.

What does not change:

  • Title-only edits still go to the window and rename the tab.
  • Headless hosts (orca serve, no window) still persist pin/color/view mode as before.
  • Builds where main owns the layout (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

Who sees a difference

  • Agents/scripts calling the raw RPC: they get capability_unsupported instead of a false updated: true.
  • Paired desktop/web clients pinning or coloring a host tab while the host's window is open: the edit was already dropped. setWebRuntimeTabProps catches the new error and logs a console.warn. Nothing in the UI changes.
  • Mobile app: does not call session.tabs.setTabProps. No change.
  • Mixed versions: no new wire fields. capability_unsupported is 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.
  • The new regression test dispatches the real session.tabs.setTabProps through RpcDispatcher into a real OrcaRuntimeService. Only the BrowserWindow lookup is mocked. With the guard disabled, all 12 refusal cases fail: they return ok: true, and the mixed cases rename the tab. With the guard on, they pass. The title-only cases pass both ways.
  • oxlint and oxfmt --check are clean on the changed files.
  • Not verified live: this is pure main-process logic with no platform branches, so it was not run against a live desktop window or the remote hosts.

Visual proof

N/A. The change is RPC-only and there is no UI change.

Notes

  • headlessTerminalFallbackTitle moved unchanged into RuntimeHeadlessTabProperties, with an abstract declaration left behind, so headless-terminal-tab-close.ts stays under its line limit.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent 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: 1b6e6e61-2c28-497c-bc9d-56325f8cf615
📥 Commits

Reviewing files that changed from the base of the PR and between 2ca6412 and f127ed7.

📒 Files selected for processing: 1
  • src/main/runtime/session-tabs/headless-terminal-tab-close.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • src/main/runtime/session-tabs/headless-terminal-tab-close.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.

📝 Walkthrough

When a desktop window owns the layout, edits to color, isPinned, or viewMode throw an error with code capability_unsupported. Title-only edits continue to forward the trimmed title, or null. The headless terminal fallback-title method selects the first nonempty trimmed value from the tab’s generated title, title, and default title. It returns Terminal if none is available.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to f127e

The reviewed property edits are rejected without partially renaming the tab. No merge-blocking issue was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: rejecting unsupported renderer-owned tab properties.
Description check Passed The description clearly explains the problem, behavior change, scope, related work, testing, and visual proof. It is mostly complete, although it does not include the template's explicit "Fixes #" iss…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description clearly explains the problem, behavior change, scope, related work, testing, and visual proof. It is mostly complete, although it does not include the template's explicit "Fixes #" issue field or checklist sections.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude <noreply@anthropic.com>
@nwparker
nwparker merged commit 8f2f620 into main Oct 23, 2026
45 checks passed
Jinwoo-H added a commit that referenced this pull request Oct 23, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant