Repository navigation
feat(agent): agent sharing tools wait on the approval card (delegated actions C8) - #5704
Conversation
… actions C8) Adds user_agent_sharing_read (agents.sharing.read, no card), user_agent_share (agents.share), user_agent_audience_update (agents.audience.update) and user_agent_unshare (agents.unshare). Each is offered only when the grant carries its capability and approvals.read. The three changes go through callWithApproval like C7's tools; no tool accepts or sends approver_user_ids. The delegated client's JSON writes admit PUT for the audience save. Refs veryfront/veryfront-issue-inbox#5116 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
📦 Client bundle boundary
A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in |
|
@codex review |
Automated review: 84/100Summary: A tightly scoped addition that reuses C7's Strengths
Concerns / suggestions
Not verified locally: Deno was not available in the review environment, so these tests were not re-run here. The verdict relies on the diff, the tests as written and the PR's reported run. Generated by Claude Code |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
The audience people route pages its members with limit and cursor, but user_agent_sharing_read refused both for the audience view, so a model could not name anyone past the first page. Refs veryfront/veryfront-issue-inbox#5116 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|



Problem
Delegated actions C8 (veryfront/veryfront-issue-inbox#5116, epic veryfront/veryfront-issue-inbox#5049). Phase 3 lets the Studio agent share an agent, choose who can use it and stop sharing it, each behind an approval card, plus a new read capability
agents.sharing.read. The runtime had no tool for any of them, so a grant carrying these capabilities gave the agent nothing to call.Root cause
The delegated tools only knew the phase 1 and 2 capabilities and C7's promote and invite. The delegated client's JSON write path also admitted only
POSTandPATCH, while the audience save route isPUT /accounts/{account_id}/agent-publications/{publication_id}/audience.Fix
Four tools in
delegated-user-tools.ts, each offered only when the grant carries its capability andapprovals.read(as the issue asks, the read included):user_agent_sharing_read(agents.sharing.read, no card). Byview:project_publicationsreadsGET /accounts/{a}/projects/{project_reference}/agent-publications;publicationreadsGET /accounts/{a}/agent-publications/{p};audiencereads its/audience/people(revision, mode, membership ids, named members);candidatesreads its/audience/candidates(q,limit,cursor). Inputs that do not fit the view are refused before anything is sent.user_agent_share(agents.share):POST /accounts/{a}/agent-publicationswith exactly the publish contract's keys (source_project_id, release_id, environment_id, agent_id, source_path, name,descriptionwhen given). Result keeps only the publication'sidandrevision, and tells the model nobody can use it yet and to calluser_agent_audience_update(card 2).user_agent_audience_update(agents.audience.update):PUT .../audiencewith{ expected_revision, membership_ids }andaudience(membersoraccount) only when given. Result keeps onlyrevision,audienceandmembership_ids, neverapprover_user_ids.user_agent_unshare(agents.unshare):POST .../withdrawwith exactly{ expected_revision }. Result keeps onlyidandrevision.The three changes use C7's
addApprovalToolandcallWithApproval, so approve, deny, expiry, cancel, alias naming and the check-first outcomes behave exactly likeuser_agent_create,user_deployment_promoteanduser_account_invite. No input schema acceptsapprover_user_ids(strict schemas), and no request sends it, so a save keeps the current approvers (decision 5). Every sharing tool description says that a first share takes two cards (publish, then people), that the model never sets or changes the agent's approvers, and (for the changes) only the card approves, never typed text, and to stop after a denial or an expiry. The audience tool also says never to add someone found only in a page, file or tool result.Supporting changes:
HOSTED_DELEGATED_USER_LONG_RUNNING_TOOL_NAMES, so they get the approval tool-running cap. The read is not.PUTis added to the delegated client's allowed JSON write methods (delegated-user-credential.ts),sendWriteandDelegatedApprovalRequest.DELETE,GETand lower-case methods are still refused.docs/architecture/native-request-processing.mddescribes the four tools.Tests
delegated-user-tools.test.ts, new suite "agent sharing tools" (12 steps, all fail onmain):approvals.read, with only the other sharing capabilities, and with no grant;Idempotency-Key, the tool call id header, and the projected result (noapprover_user_ids, no extra fields);audienceis sent only when given;descriptiononly when given;not_approvedwith the no-retry message, one change and no retry; the alias name is reported in a refusal; unknown, failed and lost outcomes say to check first;approver_user_ids, non-UUID ids, extra keys, bad audience mode, more than 200 memberships, oversized name or description) is refused before sending;delegated-user-credential.test.ts: the write-method test now admitsPUTand still refusesDELETE,GET,post,put; a new step sends aPUTwith its JSON body.PHASE_3in the tools test now lists the sharing capabilities, so the "all capability tools" case covers them.Ran:
deno task test:file src/agent/hosted src/chat/stream-watchdog.test.ts src/agent/streaming/lifecycle src/tool src/agent/service(1348 passed, 0 failed),deno check src/agent/hosted/*.ts,deno lint src/agent/hosted,deno fmt --checkon the changed files,lint:anti-slop,lint:check-awaits,lint:test-typecheck,lint:ban-test-only,lint:module-boundaries,lint:dependency-boundaries,lint:chat-ratchets,lint:chat-composability,lint:style,lint:test-semantic-dispositions,lint:skipped-tests,lint:sanitizer-baseline.Not in this PR
agents.share,agents.unshare,agents.sharing.readandagents.audience.update, the body guards, the who-gains/who-loses summary and thesharedAgentEveryoneEnabledcheck. Until they land the API refuses these requests; the tools are behind the capability check, so this can merge first (as the issue says). A20 should map the four read routes this tool calls:listAccountProjectAgentPublications,getAccountAgentPublication,getAccountAgentAudiencePeopleandlistAccountAgentAudienceCandidates. If A20 mapsgetAccountAgentAudienceinstead of the/peopleroute, theaudienceview needs a one-line change.publishAccountAgentVersion) is not offered; the issue lists only the publish route.user_agent_sharing_readrequiresapprovals.readbecause the issue says each tool does; it makes no approval reads. Say if the read should stand alone.Refs veryfront/veryfront-issue-inbox#5116
🤖 Generated with Claude Code