Skip to content

feat(sharing): contract for declining a shared agent, and its purpose on the share list - #48737

Merged
Jinwoo-H merged 1 commit into
mainfrom
merganser-share-decline-contract
Nov 25, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
merganser-share-decline-contract

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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.

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)
  • contract typecheck and test pass locally

@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 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: 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.

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: 0b291a1d-ebc8-4d7c-b890-884263d3a0c7
Commits

Reviewing files that changed from the base of the PR and between 45d1737 and 3379151.

Files selected for processing: 6

  • cloud/packages/connector-contract/src/connector-endpoints.ts
  • cloud/packages/connector-contract/src/connector-limits.ts
  • cloud/packages/connector-contract/src/delivery-messages.ts
  • cloud/packages/connector-contract/src/hello-messages.ts
  • cloud/packages/connector-contract/src/share-messages.test.ts
  • cloud/packages/connector-contract/src/share-messages.ts

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

@Jinwoo-H
Jinwoo-H merged commit 3f5d638 into main Nov 25, 2026
29 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