Skip to content

fix(bots): refuse share calls from an agent CLI over a paired device - #44825

Merged
AmethystLiang merged 1 commit into
mainfrom
AmethystLiang/fix-bot-share-paired-agent
Nov 19, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
AmethystLiang/fix-bot-share-paired-agent

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Only the bot's owner should be able to share a bot by link. The check let an agent's orca CLI through when it called over a paired device's connection. This restores the refusal.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2

What Changed

assertOwner in src/main/runtime/rpc/methods/bots-share.ts guards bots.share.prepare/publish/view/stop/status and bots.share.review. It allowlisted the desktop and paired-device caller kinds, but a paired-device caller with agent: true (the orca CLI using a device's pairing) also passed. It now also refuses isAgentRpcCaller(...), as the original owner-only check (3e90cb1) did. Owner windows and paired devices used by a person are unchanged.

Why

Restores the intended owner-only boundary on bot sharing. The agent check was dropped when the guard moved to a kind allowlist, and that version landed on main in a6918ec.

Linked Issue

N/A (maintainer fix)

Visual Proof

N/A: authorization check only, no UI change.

Testing

  • bots-share.test.ts: added a paired-device agent caller to the "refuses every share call before it reaches the service" cases (fails without this change). Added a person on a paired device to the "owner may share" cases.

  • pnpm lint and pnpm typecheck:node pass locally.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck pass locally; tests covered by CI

Performance

No impact: one extra boolean check on an owner-only RPC guard.

assertOwner allowed every paired-device caller, including the orca CLI
calling with a device's pairing (--environment, agent: true). Refuse
agent callers again, as the original owner-only check did, while keeping
the desktop/paired-device allowlist.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

assertOwner now rejects agent RPC callers, including agent CLI callers using a paired device’s pairing. Tests cover this refusal and successful share calls from an Orca window and a paired device.

Merge Risk: Minimal · up to 1148d

This change stops agent CLI callers on a paired device from using bot-sharing calls, while owner windows and people on paired devices stay allowed. Tests cover both cases, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: bot share calls from an agent CLI over a paired device are now refused. It matches the raw summary, which says assertOwner now rejects agent RPC callers, and the PR ob…
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.
Description check Passed The description covers the core of the change: it states the bug (an agent orca CLI call over a paired device passed the assertOwner guard), the fix (refusing isAgentRpcCaller(...)), and the rea…
Full details: Title check

Explanation

The title names the main change: bot share calls from an agent CLI over a paired device are now refused. It matches the raw summary, which says assertOwner now rejects agent RPC callers, and the PR objectives, which describe the same fix. The title is short, specific, and follows the conventional commit style.

Full details: Description check

Explanation

The description covers the core of the change: it states the bug (an agent orca CLI call over a paired device passed the assertOwner guard), the fix (refusing isAgentRpcCaller(...)), and the reason it was dropped. It lists the testing done and the ELI5 section. Several template sections are missing or incomplete. The Visual Proof section says N/A with a reason, which is acceptable. The Linked Issue section says 'N/A (maintainer fix)' with no issue link. The Risk section is absent, including the risk level and the revert plan. The Testing section does not say which platforms were tested. The AI Disclosure and Agent skill upstream boundary sections are absent, and the Notes section is not addressed. The Review checkbox section is absent. The description is mostly complete, so this check passes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

The configuration directory could not be loaded. This review used the available YAML and UI settings; directory instructions and checks were not evaluated.

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

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: 3b1842af-1740-4fca-a1df-e91ad31aca32
Commits

Reviewing files that changed from the base of the PR and between 805f671 and 1148d0f.

Files selected for processing: 2

  • src/main/runtime/rpc/methods/bots-share.test.ts
  • src/main/runtime/rpc/methods/bots-share.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@AmethystLiang
AmethystLiang merged commit b041ddc into main Nov 19, 2026
51 checks passed
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