Repository navigation
refactor(plugins): plugin tools take the turn's owner bit; delete the requester-owner continuation (OA2 PR 6j) - #205483
Conversation
… requester-owner continuation (OA2 PR 6j) - Delete bindRequesterOwnerIdentity, PluginToolOwnerContinuation, ownerContinuation and the requesterOwner field chain. - v2 plugin tools see the turn's own senderIsOwner (grant.owner or the agent-run-user-turn ownerAllowFrom match). - Followup capture keys on the channel-owner management entitlement; automation management transfer unchanged. - OWNER_PRODUCER_FILES 15 -> 13; scheduled read-backs regrouped. Co-authored-by: obviyus <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
E2E (one-admission run.sh, isolated Gateway, live model) on exact head |
|
Codex review: needs maintainer review before merge. What this changesThis PR makes plugin tools consume the turn’s owner decision and removes the separate requester-owner continuation chain. Example: A resumed parent has senderIsOwner=false and a retained requester-owner binding.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a useful, focused ownership simplification, with no blocking code defect found; its continuation documentation and stated impact need correction. Reviewed head: Before mergeNone. Findings
Tests
Agent review detailsHow this fits togetherGateway admission prepares turn authority, agent assembly passes it into plugin factories, and registered plugin tools use that context when executing effects. flowchart LR
A[Incoming request or completion] --> B[Gateway turn admission]
B --> C[Turn owner decision]
C --> D[Core tools]
C --> E[Plugin factory context]
E --> F[Plugin tool effects]
B --> G[Automation management continuation]
Technical reviewBest possible solution: Keep the single turn-owned authority path, align the continuation documentation and impact description, and demonstrate the affected plugin flow. Do we have a high-confidence way to reproduce the issue? Current main contains the plugin-only owner override, so the split decision is source-reproducible when a valid continuation binding accompanies a false turn bit; the claimed ordinary asserted-owner yield trigger is not established because requester retention already exists. Is this the best way to solve the issue? Deleting the parallel producer is the smallest coherent implementation, but the impact analysis must account for merged requester re-entry rather than assuming every yield-settle dispatch lacks a personal caller. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d251941b6c27. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -132, Tests -879, Other -1. Total -1012 across 27 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 25, 2026, 1:11 PM ET / 18:11 UTC. |
…ty-context Co-authored-by: obviyus <[email protected]>
|
Held, not merging (stop-and-report). The brief for this PR requires the same owner answer per principal as today; any intended change stops. This head carries one intended change (named in the body): an asserted-identity channel owner (iMessage, SMS, IRC, Tlon, Slack relay, A2A, Feishu) whose Differing cell: asserted-identity channel owner (asserted OWN) × yield resume (E12 requester continuation), v2 plugin tools: main = owner ✓ (through the continuation), this head = owner ✗ (the turn's own bit; [INFERENCE] the settle wake carries no requester origin). Proposed split:
CI on this head: only |
OA2 matrix cell: an asserted-identity channel owner's resume turn after sessions_yield admits as owner and keeps its channel sender, through the retained completion requester (no requester-owner continuation needed). Co-authored-by: obviyus <[email protected]>
|
Retraction of the stop comment above: the stop rested on an New matrix cell on head |
|
Maintainer override: the only red on head Failing case: |
|
Landed as 8027293. v2 plugin tools now take the turn's own owner bit. The requester-owner continuation and its |
… requester-owner continuation (OA2 PR 6j) (openclaw#205483) ## Problem OA2 PR 6j (one admission owner; split from openclaw#205451). A channel owner's requester continuation turn (yield resume after `sessions_yield`, or a `sessions_send` followup returning to the parent) carried a second owner producer next to `grant.owner`: - `cron-creator-authority-context.ts` `bindRequesterOwnerIdentity` read a `requesterOwner` identity that `createReplyCronAuthorityFactory` put on the cron run scope and that `requester-cron-authority.ts` carried to the continuation. - `openclaw-plugin-tools.ts` bound it whenever the turn's own `senderIsOwner` was not `true`, and `tool-factory-context.ts` then made **v2 plugin tools only** see `senderIsOwner = true` and the original owner's `requesterSenderId` / `messageChannel` / `agentAccountId`. - Core tools of the same turn use the turn's own bit. So whenever the continuation changed anything, one turn gave two owner answers: core owner-only tools "not owner", v2 plugin tools "owner". ## Fix - Deleted `bindRequesterOwnerIdentity`, `PluginToolOwnerContinuation`, the `ownerContinuation` parameter (plugin tool resolution and factory context), and the `requesterOwner` field with its whole pass-through chain: cron run scope type and constructor, `createCronCreatorAuthorityCapability`, Gateway cron creator admission, `chat-send-handler`, `chat-send-external-entry`, `agent-run-dispatch`, `requester-cron-authority`, `get-reply-run.cron-requester`. - v2 plugin tools now see the turn's own owner bit (`grant.owner`, or the `ownerAllowFrom` match that `agent-run-user-turn.ts` keeps for asserted-identity requester origins). - `requester-cron-authority.ts` followup capture keys on `managementEntitlement.source === "channel-owner"` instead of `requesterOwner`. Equivalent: the only minter of `channel-owner` (`createReplyCronAuthorityFactory`) always set `requesterOwner`. The automation `manage` transfer is unchanged. - Lint `OWNER_PRODUCER_FILES` 15 → 13 (`openclaw-plugin-tools.ts`, `tool-factory-context.ts` leave). `openclaw-tools.ts` (`spawnSenderIsOwner`), `scheduled-message-invocation.ts` (`profile.sender.isOwner`) and `execution-context-registry.ts` (`memory.owner`) move to the "recorded data read back" group: they read the bit scheduled occurrence admission minted (`facts.authority.owner`), never decide it. `message-action-dispatch.ts` stays as a producer (operator-policy scheduled write, `policy === "operator" ? true`). ## Decisions (recorded, not asked) - **Delete the continuation, do not keep it for asserted owners** (Fable 5.2, pick A): keeping it would keep a second owner producer behind a guard, and it is exactly the split "core says no, plugin says yes" inside one turn. - **No owner answer changes.** In every case where the continuation changed anything, the turn's own bit already says owner: - verified listed owners carry `grant.owner` (since openclaw#205451); - asserted-identity channel owners (iMessage, SMS, IRC, Tlon, Slack relay, A2A, Feishu): both continuation kinds carry the requester's channel origin as `agentToolCaller`, and `agent-run-user-turn.ts` sets the turn's owner bit from it through the `ownerAllowFrom` match (`prepareCommandOwnerAuthority`). `sessions_send` followup return: `sessions-send-reply-flow.ts`. `sessions_yield` resume: the spawn records completion custody with `retainRequester: true` (`subagent-registry-run-launch.ts`), the settle wake delivers inside `runWithRequester`, and `subagent-announce-direct-delivery.ts` passes `readRetainedRequesterToolCaller()`. The sender, channel and account stay on the turn. - Matrix cell (this PR, `subagent-registry.requester-automation-custody.test-support.ts`, run by `subagent-registry.completion-authority.test.ts`): "resumes an asserted channel owner's yielded turn as owner with its channel identity". It goes through the real yield mark, settle wake and `prepareAgentRunUserTurn`, for an iMessage `ownerAllowFrom` owner whose grant owner bit is false. It passes on main and on this head. With the retained caller removed (negative control) it fails: `senderIsOwner: false`, `senderId: undefined`. - The earlier `[INFERENCE]` in this body and in the stop comment ("the settle wake carries no requester origin") was wrong and is retracted. - **Not cut (`message-action-dispatch.ts`):** replacing `policy === "operator" ? true` with the run's bit would narrow operator-authorized scheduled message actions of non-owner operators; left for its own PR. ## User impact - v2 plugin tools give the same owner answer as core tools in every requester continuation turn. - No change to who is owner; only the second producer is gone. ## Evidence - Production (`src` + `scripts`, non-test): +16 / −149. - Deleted tests that asserted the removed plugin-only owner continuation: `agent.followup-owner.test.ts`, `server.sessions-send-owner-continuation.test.ts`, the continuation cases in `tool-factory-context.test.ts` and `requester-cron-authority.test.ts`. `sessions-send-owner-continuation.test.ts` now asserts the channel-owner automation management transfer through each followup outcome. - Pre-push: one `ocx test` call (`OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1`) over the touched tests plus importers of the changed sources and test-support (90 files, exit 0, all passed); `pnpm tsgo:core`, `pnpm tsgo:test` clean; oxfmt clean; `pnpm check:changed` did not finish in 15 min under host load; CI runs it. - E2E (one-admission run.sh Q/R/S, isolated Gateway, live model): pass on `448d60b8b405`; later heads add only the session-identity allowlist and the test-only matrix cell (no production change). Co-authored-by: Ayaan Zaidi <[email protected]>
…chiving (#205026) * fix(sessions): keep inactive chats eligible for cold storage after archiving * test(sessions): align archive fixtures and identity baseline * test(sessions): create a private cold backup restore target (cherry picked from commit 81d69df) Follow-ups: 7cb8975 fix: keep forked Claude chats separate after a Gateway crash (#208048) [separately ordered lane row]; ece7a74 improve(workboard): apply the Control UI glossary and style to Workboard copy [not selected for this narrow backport]; b616036 refactor(subagents): simplify ACP spawn relay ownership (#207023) [not selected for this narrow backport]; 93ca762 improve: reduce allocations when preparing session rows (#207109) [not selected for this narrow backport]; 9993328 refactor(subagents): simplify kill claim and ownership handling (#207025) [not selected for this narrow backport]; 97815bd refactor(subagents): consolidate registry cleanup and publication guards (#207064) [not selected for this narrow backport]; e94f799 refactor(subagents): centralize requester turn matching (#206584) [not selected for this narrow backport]; ea77ca3 refactor: report update failures from recorded runs (#206700) [not selected for this narrow backport]; 4d7e00b fix: let started participant runs and requests finish after an access change (#206747) [not selected for this narrow backport]; f89ae43 refactor(subagents): use cleanup and terminal owners in sweeps (#206533) [not selected for this narrow backport]; a882e0f fix(agents): preserve task answers when sessions are reused (#126263) [not selected for this narrow backport]; 81fc833 refactor(subagents): own dormant child Stop decisions (#206479) [not selected for this narrow backport]; 91d4912 fix(update): stop using foreign recovery records as admission (#206295) [not selected for this narrow backport]; be3c73e fix(subagents): finish claimed stops after session rotation (#206405) [not selected for this narrow backport]; ed8b883 fix(update): settle after plugins and share one completion summary (#205987) [not selected for this narrow backport]; 1de306e fix: pause interrupted shell turns when their result is unknown (#205859) [separately ordered lane row]; 16a6aa4 fix(memory): keep a child's memory audience after its parent resets (#205887) [not selected for this narrow backport]; 50a7368 feat: let agents snooze a conversation after replying [not selected for this narrow backport]; 40f3903 fix(ci): remove unused role and workflow exports (#205720) [not selected for this narrow backport]; e43debf refactor(state): migrate in place and remove copy-and-swap (#205165) [not selected for this narrow backport]; 8027293 refactor(plugins): plugin tools take the turn's owner bit; delete the requester-owner continuation (OA2 PR 6j) (#205483) [not selected for this narrow backport]; 13e2ec3 feat: let participants publish through the session's shared GitHub account (#204914) [not selected for this narrow backport]; 5434992 fix: use the configured runtime when switching model providers (#203973) [not selected for this narrow backport]; 5271519 fix(feishu): honor the filename override on sent attachments (#205287) [not selected for this narrow backport]; ca087d4 refactor(admission): drop the replay automationAdmin bit and the R7 source re-check (#205268) [not selected for this narrow backport] Co-authored-by: RomneyDa <[email protected]>
Problem
OA2 PR 6j (one admission owner; split from #205451).
A channel owner's requester continuation turn (yield resume after
sessions_yield, or asessions_sendfollowup returning to the parent) carried a second owner producer next togrant.owner:cron-creator-authority-context.tsbindRequesterOwnerIdentityread arequesterOwneridentity thatcreateReplyCronAuthorityFactoryput on the cron run scope and thatrequester-cron-authority.tscarried to the continuation.openclaw-plugin-tools.tsbound it whenever the turn's ownsenderIsOwnerwas nottrue, andtool-factory-context.tsthen made v2 plugin tools only seesenderIsOwner = trueand the original owner'srequesterSenderId/messageChannel/agentAccountId.Fix
bindRequesterOwnerIdentity,PluginToolOwnerContinuation, theownerContinuationparameter (plugin tool resolution and factory context), and therequesterOwnerfield with its whole pass-through chain: cron run scope type and constructor,createCronCreatorAuthorityCapability, Gateway cron creator admission,chat-send-handler,chat-send-external-entry,agent-run-dispatch,requester-cron-authority,get-reply-run.cron-requester.grant.owner, or theownerAllowFrommatch thatagent-run-user-turn.tskeeps for asserted-identity requester origins).requester-cron-authority.tsfollowup capture keys onmanagementEntitlement.source === "channel-owner"instead ofrequesterOwner. Equivalent: the only minter ofchannel-owner(createReplyCronAuthorityFactory) always setrequesterOwner. The automationmanagetransfer is unchanged.OWNER_PRODUCER_FILES15 → 13 (openclaw-plugin-tools.ts,tool-factory-context.tsleave).openclaw-tools.ts(spawnSenderIsOwner),scheduled-message-invocation.ts(profile.sender.isOwner) andexecution-context-registry.ts(memory.owner) move to the "recorded data read back" group: they read the bit scheduled occurrence admission minted (facts.authority.owner), never decide it.message-action-dispatch.tsstays as a producer (operator-policy scheduled write,policy === "operator" ? true).Decisions (recorded, not asked)
grant.owner(since refactor(admission): listed channel owner wins over a linked profile; Talk reads grant.owner (OA2 PR 6i) #205451);agentToolCaller, andagent-run-user-turn.tssets the turn's owner bit from it through theownerAllowFrommatch (prepareCommandOwnerAuthority).sessions_sendfollowup return:sessions-send-reply-flow.ts.sessions_yieldresume: the spawn records completion custody withretainRequester: true(subagent-registry-run-launch.ts), the settle wake delivers insiderunWithRequester, andsubagent-announce-direct-delivery.tspassesreadRetainedRequesterToolCaller(). The sender, channel and account stay on the turn.subagent-registry.requester-automation-custody.test-support.ts, run bysubagent-registry.completion-authority.test.ts): "resumes an asserted channel owner's yielded turn as owner with its channel identity". It goes through the real yield mark, settle wake andprepareAgentRunUserTurn, for an iMessageownerAllowFromowner whose grant owner bit is false. It passes on main and on this head. With the retained caller removed (negative control) it fails:senderIsOwner: false,senderId: undefined.[INFERENCE]in this body and in the stop comment ("the settle wake carries no requester origin") was wrong and is retracted.message-action-dispatch.ts): replacingpolicy === "operator" ? truewith the run's bit would narrow operator-authorized scheduled message actions of non-owner operators; left for its own PR.User impact
Evidence
src+scripts, non-test): +16 / −149.agent.followup-owner.test.ts,server.sessions-send-owner-continuation.test.ts, the continuation cases intool-factory-context.test.tsandrequester-cron-authority.test.ts.sessions-send-owner-continuation.test.tsnow asserts the channel-owner automation management transfer through each followup outcome.ocx testcall (OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1) over the touched tests plus importers of the changed sources and test-support (90 files, exit 0, all passed);pnpm tsgo:core,pnpm tsgo:testclean; oxfmt clean;pnpm check:changeddid not finish in 15 min under host load; CI runs it.448d60b8b405; later heads add only the session-identity allowlist and the test-only matrix cell (no production change).