You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(sharing): contract for declining a shared agent, and its purpose on the share list - #48737
When someone shares an agent with you, you will be able to say "no thanks". This PR only adds the wire shapes the cloud and Orca agree on for that, plus a short purpose line the owner can show beside the shared agent.
Files
Added
Deleted
Net
Test
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$52
$\color{#cf222e}{\Huge{\mathbf{−}}}$1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$51
Prod
5
$\color{#1a7f37}{\Huge{\mathbf{+}}}$35
$\color{#cf222e}{\Huge{\mathbf{−}}}$4
$\color{#1a7f37}{\Huge{\mathbf{+}}}$31
What Changed
Additive changes to cloud/packages/connector-contract only:
POST /v1/shares/<shareId>/decline (connector token): request { v: 1 }, answer { status: "declined" }. ConnectorShareDeclineRequestSchema and ConnectorShareDeclineSchema.
A new delivery kind, share_declined (shareId, botId, accountId), on the share's own conversation like the other share deliveries.
CONNECTOR_LIMITS.maxBotPurposeLength = 1000 and a shared BotPurposeSchema (1 to 1,000 characters).
An optional botPurpose on the hello's agent entry (ConnectorBotSchema) and on each /v1/shares/mine entry.
Why
The owner signed off Accept/Decline for shared agents. The cloud half (stablyai/orca-cloud, connector) and the desktop half (the team-sharing stack) both build against these shapes. The cloud pins this commit, and the desktop branch rebases onto it.
Linked Issue
Internal design item 484.
Visual Proof
N/A: wire contract only, no UI.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
pnpm --filter @orca-cloud/connector-contract typecheck and test pass (58 tests). The new tests cover these cases:
the decline request and answer;
a share_declined delivery on its own share's queue (refused on another share's queue, and without accountId);
the purpose: accepted absent, accepted at exactly 1,000 characters, refused at 1,001 or when empty, on both the hello and /mine.
Performance
No runtime cost: these are Zod schemas. A hello agent entry can grow by up to 1,000 characters when the owner writes a purpose. That stays well inside the per-entry hello budget.
Risk
Level: Low. Every new field is optional, so old hellos and old /mine answers still parse. The new delivery kind only reaches a machine from a cloud that sends it. The current desktop parses each delivery on its own (deliveries: z.array(z.unknown())) and settles an unknown kind as unsupported (dispatchDelivery in connector-deliveries.ts), so an older host drops it without failing its poll. A plain revert backs this out once nothing pins it.
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Checklist
This PR is small and focused
I explained what changed and why
I stated the risk: what could break, for whom, and how to back it out
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)
No actionable comments were generated in the recent review.
Walkthrough
The connector contract adds schemas and inferred types for share declines, including a share_declined delivery variant tied to the matching share conversation. It also adds optional botPurpose validation, with a 1,000-character limit, to bot hello and share-list entries. Endpoint and feature documentation now mention the decline route and related delivery messages. Tests cover decline parsing, delivery validation, and purpose limits.
Merge Risk: Minimal · up to 33791
This adds optional, bounded fields and new message schemas to the connector contract without changing runtime behavior. Older payloads stay parseable, and no concrete regression was found. It is ready to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the two main additions in the changeset: a contract for declining a shared agent (decline endpoint, request/response schemas, share_declined delivery) and an optional purpose on the sh…
Description check
The description follows the template sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, Agent skill upstream boundary, and Checklist. It explains the wire-contr…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the two main additions in the changeset: a contract for declining a shared agent (decline endpoint, request/response schemas, share_declined delivery) and an optional purpose on the share list (botPurpose, BotPurposeSchema, maxBotPurposeLength). It is specific and matches the diff, though at 87 characters it is somewhat long.
Full details: Description check
Explanation
The description follows the template sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, Agent skill upstream boundary, and Checklist. It explains the wire-contract changes, the optional-field backwards compatibility, and the rollback path. Gaps: the Linked Issue names only an internal design item (484) rather than a linked issue, the Risk Level is set to Low but the 'Review' and AI Disclosure sections are left empty, the Testing list leaves 'manually tested' unchecked while stating no manual testing was done, and the Performance line is written as a complete sentence rather than the template's 'None, because ...' form.
Resolution
Optional: link a tracked issue in the Linked Issue section if one exists, and fill in or remove the empty Review and AI Disclosure headings.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
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
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
When someone shares an agent with you, you will be able to say "no thanks". This PR only adds the wire shapes the cloud and Orca agree on for that, plus a short purpose line the owner can show beside the shared agent.
What Changed
Additive changes to
cloud/packages/connector-contractonly:POST /v1/shares/<shareId>/decline(connector token): request{ v: 1 }, answer{ status: "declined" }.ConnectorShareDeclineRequestSchemaandConnectorShareDeclineSchema.share_declined(shareId,botId,accountId), on the share's own conversation like the other share deliveries.CONNECTOR_LIMITS.maxBotPurposeLength = 1000and a sharedBotPurposeSchema(1 to 1,000 characters).botPurposeon the hello's agent entry (ConnectorBotSchema) and on each/v1/shares/mineentry.Why
The owner signed off Accept/Decline for shared agents. The cloud half (stablyai/orca-cloud, connector) and the desktop half (the team-sharing stack) both build against these shapes. The cloud pins this commit, and the desktop branch rebases onto it.
Linked Issue
Internal design item 484.
Visual Proof
N/A: wire contract only, no UI.
Testing
pnpm --filter @orca-cloud/connector-contract typecheckandtestpass (58 tests). The new tests cover these cases:share_declineddelivery on its own share's queue (refused on another share's queue, and withoutaccountId);/mine.Performance
No runtime cost: these are Zod schemas. A hello agent entry can grow by up to 1,000 characters when the owner writes a purpose. That stays well inside the per-entry hello budget.
Risk
Level: Low. Every new field is optional, so old hellos and old
/mineanswers still parse. The new delivery kind only reaches a machine from a cloud that sends it. The current desktop parses each delivery on its own (deliveries: z.array(z.unknown())) and settles an unknown kind asunsupported(dispatchDeliveryinconnector-deliveries.ts), so an older host drops it without failing its poll. A plain revert backs this out once nothing pins it.Review
Agent skill upstream boundary
Checklist
N/Awith reasontypecheckandtestpass locally