Repository navigation
Conversation
|
🦞👀 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. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR carries signed caller authority into delegated OpenClaw requests, preserves approval ownership across sibling calls, and extends the request timeout. Example: A Gateway-admitted CLI agent with Full Access requests update.checkOnStart=false.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this PR addresses a current delegation bug with meaningful unique work, and no actionable patch defect was found. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe regular-agent OpenClaw tool sends requests through Gateway transport to the system agent, whose approval owner validates source authority before applying persistent operations. flowchart LR
A[Admitted agent run] --> B[OpenClaw delegate tool]
B --> C[Signed Gateway transport]
C --> D[System agent handler]
D --> E[Approval owner]
E --> F[Guarded persistent operation]
F --> G[Application outcome]
Technical reviewBest possible solution: Carry the existing admitted authority through transport while retaining the original approval lease and the existing persistent-effect guard. Do we have a high-confidence way to reproduce the issue? Current-main source shows both the omitted signed-transport method and ambient-only receiver rejection; historical CLI evidence and the independent baseline controls support that path, without a new execution during this review. Is this the best way to solve the issue? The patch restores documented behavior through existing transport, run-authority, approval, and execution owners; the schema and URL extractions preserve their existing responsibilities and avoid duplicate implementations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 37fb9ae95f88. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +103, Tests +388, Other -1. Total +490 across 13 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
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 HistoryReview history (29 earlier review cycles; latest 8 shown)
Reviewed October 17, 2026, 10:16 PM ET / October 18, 2026, 02:16 UTC (Revision 30). |
8259e81 to
fddb1ff
Compare
|
Reworked this revision around the existing host-minted signed runtime identity; it no longer derives any authority from the delegated session. The three P1s are addressed:
I also made signed runtime ownership override model-supplied delegation metadata. The focused suite is 107/107, the repository changed-files gate and build pass, and the effect-phase matrix covers active application plus run/tool/Gateway/worker/session closure before I/O. I am finishing the redacted real harness mutation proof after correcting an unrelated stale generated-chunk reference in the local build; I will update this comment with that result before requesting re-review. |
fddb1ff to
eeb58f4
Compare
|
Real CLI harness proof is now complete on revised head
The PR body now records this redacted real transport evidence. Deterministic effect-phase tests additionally cover run release/replacement, tool abort, Gateway replacement, worker-claim loss, session replacement, and same-session pending-approval reuse. Exact-head CI is rerunning after the metadata-only commit-message correction. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Addressed both P1s on
Proof: pre-fix timeout failure; exact-head runtime shard: 241 files / 5,013 tests; prod types, test types, and format/lint pass. Direct Codex inspection at Production delta versus the reviewed head: net +10; tests: net +112. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…y line cap Move the Zod payload schema for agent runtime identity tokens into a sibling agent-runtime-identity-token.schema.ts. The token module keeps minting, signing, verification, and live-authority binding; the schema module only proves wire shape. The moved block is unchanged apart from export keywords and one dropped type assertion: ChannelId admits any plugin-provided string, so the normalized currentChannelProvider needs no `as ChannelId` narrowing. That retires the file's only grandfathered assertion, so its assertion-safety baseline entry shrinks away. Brings agent-runtime-identity-token.ts from 706 to 550 counted lines (cap 700) without touching the cap.
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
Main's openclaw#196984 gate requires callerIdentity?.assertAutoApproveChangesCurrent before a delegated change may be applied automatically. Wire (CLI-backend) callers cross a process boundary and only carry trustedAgentRuntime, so automatic application was structurally unreachable for them. The preparing host now registers the live policy closure in a server-owned handoff map and the signed runtime identity token carries only an opaque correlation id. The target Gateway redeems it only when the id is bound to the same agent, session, operational run instance and delegated authority claim the token verified, and only for a signed full-permission grant; a missing or unbound handoff still routes the change to a human. The id is never authority and openclaw#196984's rechecks and closure fences are unchanged. Tests: wire Full Access lifecycle suite (active/run/tool/gateway/worker/session) now asserts the revalidated contract; fixtures attach the policy assertion and supply delegationExecAuthority where automatic authority is expected.
|
Merged current main ( What was wrong. Main now applies a delegated change automatically only when Fix (small, additive). The preparing host registers the live policy closure in a server-owned handoff map ( Tests and gates. The six wire Full Access lifecycle cases (active/run/tool/gateway/worker/session) now assert the revalidated contract; fixtures attach the policy assertion and supply Reviewable in isolation: the new module plus three wire-path touch points ( |
# Conflicts: # src/gateway/server-methods/system-agent-approval.ts
…proval An in-process caller identity is admitted by this gateway, so it keeps the existing "restricted only when explicitly denied" posture. Requiring the explicit signed flag there made Full Access delegated chat proposals fall back to the operator prompt, which stalls flows that never expect one. The signed wire identity is not admitted locally, so it still needs the explicit Full Access grant before the current-policy assertion applies.
|
Two follow-ups since the last update, both on the current head ( Test-type check. Clean — the gateway-methods test types compile against the new identity field, so the harness change does not need further type work. Auto-approval boundary, tightened in the right place only. The current-policy assertion now requires an explicitly signed Full Access grant for a wire identity (the CLI-backend path, which is not admitted by the target Gateway), while an in-process caller keeps the existing "restricted only when explicitly denied" posture. Requiring the explicit flag on both sides made ordinary delegated chat proposals fall back to the operator prompt; the three approval/delegation suites are green again (approval lifecycle, approval authority, delegate tool). Net effect for this PR: nothing widens, and the wire path still cannot apply a change without redeeming a host-owned current-policy closure. |
…w-cli-harness-authority # Conflicts: # src/agents/tools/openclaw-delegate-tool.test.ts
Adopt main's apply-time contract (an approved apply finishes; only cancellation or session replacement fences it) and keep the wire automatic-change policy assertion at decision time.
|
Wire-path current-policy hook, on `9b6bef57fac`. The delegated Full Access path now takes its authorization from a server-owned assertion instead of trusting the signed grant alone: when a signed CLI-backend grant arrives, the Gateway asks the current policy whether the delegation still authorizes the change. If the assertion succeeds, the change applies automatically as before; if it throws `DelegatedChangeApprovalRequiredError`, the request becomes a human approval whose description carries the refusal reason; if no assertion is attached, Full Access still requires human approval. Why this shape: it keeps every guarantee from #196984 / `b8980ca9a0` intact — nothing is loosened, and the granted authority is revalidated against live policy rather than the state at signing time. Upstream's approved-apply-finishes callback is preserved, so the apply path and its fencing are unchanged. Tests: `src/gateway/server-methods/system-agent-approval-authority.test.ts` now covers the three wire outcomes above, plus handoff-ledger behaviour (exact-owner redemption, mismatch consumes the id, run-instance disagreement throws, revoke drops the closure). Legacy apply-fencing cases were replaced by upstream's lifecycle cases. Locally: 17/17 in the authority suite, oxfmt and oxlint clean on the changed files, line-cap ratchet OK. One note so the red gate is not misread: the CI workflows on this head are waiting on fork-run approval, so `ci-gate` has not executed any jobs yet. Nothing here is a failing-test signal. Also folded in a merge of current main (`c48837347f4`), which is what removes the conflict. |
…rent main Upstream openclaw#201998 removed forceDenyIfRuntimeAuthorityClosed; keep the pending-object ownership guard and retire foreign proposals via their own owner. Tag the wire Full Access fixtures' delegated authority as local, matching AgentRuntimeDelegatedAuthority's current discriminated union.
Resolve system-agent openclaw.chat conflict by keeping main's approval-signal capture alongside the delegated-runtime identity handoff (inputParams + trustedAgentRuntime).
Resolve the identity-token conflict on upstream zod schemas and normalization helpers, retaining explicit signed Full Access and the server-owned current-policy assertion handoff and refusal path. Remove the superseded extracted schema module. Preserve openclaw#196984 effective-authority gates and initialization abort fencing. Validation: 132 focused tests including the six wire lifecycle cases; gateway-methods types; targeted formatting and lint; diff check; line-cap ratchet against pinned upstream 39c3099.
…w-cli-harness-authority # Conflicts: # src/agents/tools/openclaw-delegate-tool.test.ts
Related: #136036, #137017
What Problem This Solves
Delegated
openclaw.chatcalls from CLI/subprocess and worker harnesses failed withdelegated OpenClaw approval requires an active run authority. Fully in-process agents retained the ambient caller identity, but harness tool calls crossed the Gateway WebSocket boundary, where that process-local identity is intentionally unavailable.User Impact
CLI and worker-harness delegated calls retain their signed source ownership and approval guard, including when optional wire delegation metadata is absent. Existing run, tool-abort and worker-lifetime fencing remains fail-closed.
Why This Change Was Made
Root cause
The approval gate only consulted the process-local Gateway tool caller identity. OpenClaw already has a host-minted, HMAC-signed
agentRuntimeIdentityTokenfor trusted cross-process calls, including the exact admitted run authority and worker turn claim, butopenclaw.chatwas not included in that transport.The first revision attempted to mint replacement authority from the delegated session id. Review identified that as unsafe. The signed-identity revision then exposed two narrower defects:
Design
This revision carries the existing source-run authority instead of synthesizing or transferring it:
openclaw.chatis eligible for the signed agent-runtime identity token.openclaw.chat; model-authored parameters cannot create it.No new configuration keys, SQLite surfaces, dependencies or retries are introduced. The existing transient signed-identity token carries an optional host-prepared Full Access fact. Existing canonical owner and human-wait helpers were sufficient.
Security properties
Evidence
Published head
cea0acc7028934a9609bb656a14cb21a3496db94integrates GitHub-confirmed current-main conflicts against pinned upstream3260d7b41a8c2404b8b3dc800240573dfb1cc7e1. Preserves upstream compact delegate-test layout and PR timeout/permission/session-continuation contracts. Production authority changes merged without manual conflict; removed a now-unused moved import and compacted a local parameter name to satisfy changed-file lint. Validation passed: 91 focused authority/identity/delegate tests across five suites (55.731s wrapper), production core types and all three affected test-type shards, changed-file type-aware lint, formatting, pinned-main diff check, line-cap and assertion-safety ratchets. The newly integrated cron fixture needed a true-or-undefined permission normalization in its test transport only; its affected integration suite and Gateway-method types pass after that correction. Fresh independent scoped review of the frozen production tree found no actionable P0/P1; retained for the final one-line test-adapter correction. No fresh real delayed-human transport proof, replacement-head hosted verdict, or maintainer signed-carrier acceptance is claimed.Prior published head
fad89b4b638381fbb5e964c5d0cade97d01b0afcreconciles a GitHub-confirmed approval-test conflict onto pinned upstreamd1618ccd0b276f985711ff297b1b87a77bdad35d. Upstream removed a redundant ambient-only parameter case; the later maintained cross-lease wire/ambient approval coverage remains intact. Seventeen patches replay identically; the first differs only in its upstream conflict context. Prior independent review is retained for this mechanical delta, not claimed as fresh review. All 10 local gates passed: 99 tests across five focused suites (56.058s wrapper), production core types, all three affected test-type shards (agents-root, agents-other and Gateway-methods), changed-source type-aware lint, formatting, diff, line-cap and assertion-safety checks. The initial lint attempt could not load the newly required eslint-plugin-solid; refreshing the isolated installation from the unchanged frozen lockfile resolved it without source or lockfile workarounds. No replacement-head hosted verdict or fresh live-runtime result is claimed. Real delayed-human-decision proof and area-owner signed-carrier acceptance remain outstanding.Prior published head
db8ec1bb286e5b9bd9a77a7fcaea911869673b9aaddresses revision 24’s test-quality feedback: removed the synthetic delayed-decision mock test and unused fake-timer cleanup. The retained relay test verifies the requested 900-second budget and returned approval outcome. All 15 delegate-tool tests passed (pnpm test src/agents/tools/openclaw-delegate-tool.test.ts --maxWorkers=1, 8.655s wrapper / 6.67s Vitest); affected agents-other test types, type-aware changed-file lint, formatting, diff check, line-cap and assertion-safety gates passed. Production sources are byte-unchanged from the prior validated head, whose exact-head hosted CI was observed SUCCESS at 07:13 UTC and durable revision 24 found no production defect. Those prior-head results are historical. That prior head’s hosted CI was observed SUCCESS at 2026-10-08 17:53 UTC; durable ClawSweeper revision 25 reviewed that head and reports no actionable findings, with area-owner acceptance still outstanding. No fresh independent production review or live run is claimed for this test-only deletion.A real human decision after 30 seconds remains unverified by the historical CLI evidence. The removed synthetic timeout test did not establish that transport behavior; the historical timeout RED/GREEN results below are synthetic test evidence only.
Prior published
4cde0ad5c4cd3cbe31b96320f8a7e01954e2d74breconciled a confirmed import conflict onto pinned upstream2f1f73ccb2224bbe7d961b4c0d3b29cfdd51e7f8. The maintained hosted-routing suite retains the delegated signed-identity case and drops an obsolete Workshop approval import removed upstream. All other patches replay unchanged; delegated authority, method-scoped Full Access and exact approval-lease intent remain unchanged. Fresh validation of the source committed as4cde0ad5c4cd3cbe31b96320f8a7e01954e2d74b: 103 authority tests across five focused suites passed (50.477s wrapper); production core types and all three affected test-type shards (agents-root, agents-other and Gateway-methods) passed. Changed-source type-aware lint, formatting, diff, line-cap and assertion-safety gates passed. Prior independent scoped review is retained for the mechanically reconciled delta, not claimed as a fresh review. Prior 27-test URL-boundary proof is retained for the unchanged canonicalizer. No fresh live-runtime proof or replacement-head hosted CI result is claimed. Assigned-reviewer acceptance of the signed Full Access carrier remains outstanding.Tested head:
cea0acc7028934a9609bb656a14cb21a3496db94(base3260d7b41a8c2404b8b3dc800240573dfb1cc7e1).openclaw.chathandler test failed before the repair, choosing connection ownership instead of signed source ownership. The parameterized regression checks both omitted and spoofed wire metadata, signed session ownership, and delegated-only operator approval. Both regression variants pass after the repair.c6ab9511e93f586626135c67633e5240db04ea32validation: 107 tests across five focused suites passed (36.14s wrapper); production core types, type-aware changed-file lint, formatting, diff check, line-cap ratchet and assertion safety passed. Fresh independent review: the sole P1 concerned the old index version; the reviewer explicitly recognized this working-tree repair as addressing it and reported no other concrete P0/P1 defect. The corrected index was verified and committed. Affected Gateway-method test types: passed (exit 0).bd1287586199249975f6a268ccbf2553686ad3f0had successful exact-head hosted CI; those are not current-candidate CI results. The earlier 27 core-test compiler shards passed with the documented aggregate-wrapper exit-124 limitation. Current validation reruns affected proof rather than claiming those prior results as fresh full coverage.06648dac970failed at the generic 30-second timeout (red runtime job);537130294ac2e1360700ab2f094df4b8e9a8b05dpassed 241 files / 5,013 tests (green runtime job). These are not current-head CI results.db8ec1bb286e5b9bd9a77a7fcaea911869673b9awas observed SUCCESS at 2026-10-08 17:53 UTC; security-owner/maintainer acceptance remains an external gate.Earlier real CLI harness proof
Verified against a locally built Gateway through the real
openclaw agentCodex app-server path:finance-workerCodex turn invoked theopenclawtool over the Gateway WebSocket and changedupdate.checkOnStartfromtruetofalse. The terminal receipt recorded exactly one successfulopenclawtool call. An independent CLI read observedfalse; the test then restored and schema-validatedtrue.openclawtool call, then receivedSIGINTthrough the CLI's same-connection abort path. The persisted tool result wasOpenClaw dynamic tool call aborted.and an independent CLI read remainedtrue.Observer-cancellation ownership
Proposal-failure retirement belongs to the caller that installed the pending approval. A later same-source observer whose distinct lease closes fails its own live-authority check without clearing or force-denying the original owner's still-live approval. Original-owner cancellation remains fail-closed. The current focused approval-authority suite includes this order-sensitive regression.