Repository navigation
fix(bots): refuse share calls from an agent CLI over a paired device - #44825
Conversation
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.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ELI5
Only the bot's owner should be able to share a bot by link. The check let an agent's
orcaCLI through when it called over a paired device's connection. This restores the refusal.What Changed
assertOwnerinsrc/main/runtime/rpc/methods/bots-share.tsguardsbots.share.prepare/publish/view/stop/statusandbots.share.review. It allowlisted thedesktopandpaired-devicecaller kinds, but apaired-devicecaller withagent: true(theorcaCLI using a device's pairing) also passed. It now also refusesisAgentRpcCaller(...), 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 lintandpnpm typecheck:nodepass locally.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Checklist
N/Awith reasonpnpm lint,pnpm typecheckpass locally; tests covered by CIPerformance
No impact: one extra boolean check on an owner-only RPC guard.