Repository navigation
fix(agents): keep sender-scoped tools in delegated runs - #110345
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 20, 2026, 2:45 AM ET / 06:45 UTC. Summary PR surface: Source +269, Tests +613, Docs +1, Other +273. Total +1156 across 43 files. Reproducibility: yes. the supplied configuration, delegated-run sequence, and live pre-fix versus post-fix Gateway evidence form a high-confidence reproduction path; this read-only review did not independently execute it against current main. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Keep one canonical requester-policy resolver, retain external-turn re-resolution and strict lineage/provenance validation, and merge only after an authorization owner explicitly accepts the trusted operator-resume and policy-snapshot contract. Do we have a high-confidence way to reproduce the issue? Yes, the supplied configuration, delegated-run sequence, and live pre-fix versus post-fix Gateway evidence form a high-confidence reproduction path; this read-only review did not independently execute it against current main. Is this the best way to solve the issue? Yes, centralizing requester-policy resolution is the most maintainable shape because the same effective policy feeds conversation, Gateway, skill, web-search, compaction, and Codex tool surfaces; the remaining question is whether the persisted trusted-resume contract is the intended product boundary. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against e2e394e1ab80. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +269, Tests +613, Docs +1, Other +273. Total +1156 across 43 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (5 earlier review cycles)
|
|
Additional live field confirmation for #109025 on stable OpenClaw 2026.7.1 (
This confirms the inactive-requester completion-fallback half of #109025 on the current stable release and supports the cross-surface requester-policy approach in this PR. It is distinct from the reply-session initialization/CAS wedge tracked by #101920. |
832dd6a to
16e72d2
Compare
9e4269b to
7f6c2a6
Compare
|
Merged via squash.
|
) * fix(agents): preserve requester policy across delegation * fix(agents): keep policy types internal * test(codex): cover delegated policy forwarding * fix(agents): harden delegated policy contract * fix(agents): preserve split-owner completion policy * fix: version delegated requester snapshots * fix: refresh delegated policy protocol artifacts
Closes #109025
Alternative implementation to #109055.
AI-assisted: yes. I understand the authorization lineage and tool-policy changes in this PR.
What Problem This Solves
Fixes an issue where users with an exact
toolsBySenderoverride could successfully use tools in the inbound parent run, but a spawned sender-less subagent would re-resolve the wildcard sender rule and silently lose filesystem/runtime tools.The same context loss could affect trusted internal completion fallback, and separate tool-discovery consumers could otherwise disagree about the effective requester policy.
Why This Change Was Made
This change centralizes requester tool-policy resolution. External requests resolve current global/group/sender policy normally. Verified internal descendants consume the stored effective requester projection, then intersect it with current agent, sandbox, profile, and subagent restrictions.
Delegation is accepted only from persisted spawned lineage or the private subagent-completion handoff with matching provenance. A new external sender targeting an existing child re-resolves sender policy, forged child-shaped keys fail closed, empty inherited projections remain meaningful, and the same rule now feeds conversation tools, Gateway/node tool resolution, web search, skill dispatch, compaction, and the Codex dynamic-tool surface.
Unlike a spawn-only propagation path, this also covers requester-agent fallback without copying or synthesizing public sender identity.
User Impact
Delegated agents retain the tool authority of the external request that created them, subject to all ordinary child restrictions. Anonymous or newly external requests do not inherit that authority.
Evidence
tbx_01kxshsbhgk1z0jt6ytw8rcc47, real Gateway + qa-channel +openai/gpt-5.4: Actions run859fdd3b7f1: scenarioissue-109025-sender-policy-livepassed; the parent wrote its proof, spawned a real child, and the child read the unpredictable marker.75e4103c57382ddbf16aab1aed8a6e72cfb39951: the same scenario failed withparentProof=PARENT_OK,childTools={}, and no marker returned (reproduced issue 109025).$autoreview --mode uncommittedcompleted cleanly with no accepted/actionable findings.Authorization boundary review
Maintainer decision: senderless authenticated operator calls to a valid persisted child session are trusted resumptions inside the Gateway trusted-operator domain.
spawnedByplus valid subagent metadata. Lineage and inherited-tool mutations throughsessions.patchrequireoperator.admin.toolsBySenderedits are intentionally non-retroactive for that child, while current global, agent, provider, sandbox, and subagent restrictions continue to apply.external_userprovenance each independently force that path.inter_session+subagent_announceprovenance, a source session, and a matching persisted lineage chain.current-request,persisted-child, orcompletion-handofffor diagnostics.Direct sibling Codex inspection completed at
openai/codex@e98765c212d:thread_processor.rsvalidates and passes the client-supplied dynamic-tool list into thread startup, whiledynamic_tools.rsrelays tool responses. Codex does not reconstruct OpenClaw sender policy; OpenClaw owns authorization before supplyingdynamicTools.