Skip to content

fix(claws): route add and update through the local Gateway owner - #168432

Closed
steipete wants to merge 2 commits into
dbasync/ow2-claw-11from
dbasync/ow2-claw-12
Closed

steipete wants to merge 2 commits into
dbasync/ow2-claw-11from
dbasync/ow2-claw-12

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

A separate CLI process can write Claw-owned SQLite state while the Gateway is live, leaving its in-process caches stale. Accepted work also needs physical-owner authority to finish compensation after request cancellation.

User Impact

Claw add and update run through the selected live Gateway, or take exclusive offline ownership when the Gateway is stopped. Their next Gateway reads observe committed changes. Accepted cleanup retains settlement authority, and config publication checks current request authority.

Why This Change Was Made

Activate runWithLocalStateOwner, narrow add/update Gateway methods, and their real CLI callers together. Reuse worker persistence, wait for config application, and never replay uncertain remote delivery locally. Delete superseded readiness/plugin reload adapters and native resume readers with their consumers. Preserve current removal behavior for the following slice.

This is PR 12 of a 13-PR dependency-ordered Claw ownership stack. The first eleven publication heads are unchanged. PR 12 activates add/update with their service callers and settlement repairs; PR 13 activates removal, guards offline migration, and completes worker typing cleanup. Each changed command signature and registration lands with its caller.

Size

Direct diff: production +601/−274 (875 changed); tests/support +492/−302; docs +13/−0; tooling +2/−0. Shared ownership services and complete caller migration account for the size. Schema, durability, retention, and permission contracts are unchanged.

Evidence

Intermediate proof

All first eleven publication heads retain their completed core typechecks (120.33 s total). Intermediate PR 12 at c9dbd8de72c6dd9748ca9a9dc81c0eb6991a4778 passed pnpm tsgo:core in 14.18 s and pnpm deadcode:knip in 101.64 s after a 21.34 s frozen install. The run used the local proof slot under the authorized remote-wait fallback; admission load was below 48 and free disk exceeded 82 GiB. Both service modules are consumed by registered add/update handlers; no unused-file exception or dummy caller is used. Evidence: intermediate-12/result.json, core-typecheck.log, and knip.log. The final PR12 head 4fe3617a60097b750603cd920cf1d2e9e8f5ed31 additionally passed pnpm check:deprecated-api-usage in 58.21 s after its two-line semantic-owner registration; evidence: intermediate-12/deprecated-guard-result.json and deprecated-guard.log.

Focused owner coverage for this slice: src/claws/add.test.ts, src/claws/update-apply.test.ts, src/claws/packages.runtime.test.ts, src/claws/mcp-update.test.ts, src/claws/lifecycle-remove-ownership.test.ts, and src/infra/exec-approvals-store.test.ts.

Source identity

PR base bfa6e27e64b7ba10a0aaeee4ae7a8d1bd1b2402d; head 4fe3617a60097b750603cd920cf1d2e9e8f5ed31; tree 9968382b51fe14165238e41819f052ec0d54cea6. The final PR 13 head 240f037c5469f37c1091d02b2833782a65be8297 and accepted source 32500e05d7f81c893d1134f774aef9611c9ef296 have the identical complete repository tree 0c2855b7e4c86ecd76bd369098e2c1094b76475c, including file modes. The private-index construction preserved the source worktree and its index. This is source-equivalence evidence, not runtime proof.

Regression sensitivity

Seven historical negative-control invocations produced 10 intended assertion failures and eight passing controls, with no import/tool failures, in 401.20 s total. They cover canceled MCP/cron/workspace rollback, update config/partial-state recovery, package runtime settlement, and add preflight authority. The first six use production 5033d4802c38; add uses ef67140233cb plus its recorded historical test blob. Exact commands, blobs, and assertions: local-missing/results.json and local-missing/negative-assertions.txt. These establish regression sensitivity, not positive proof at a later source.

Final-candidate proof

The accepted source 32500e05d7f81c893d1134f774aef9611c9ef296 and final publication head 240f037c5469f37c1091d02b2833782a65be8297 have the identical full repository tree 0c2855b7e4c86ecd76bd369098e2c1094b76475c. The results below identify the source actually tested; they do not imply every intermediate passed every gate.

Completed behavior proof Tested source Result Wall time
Separate CLI process: Claw dry-run/add, then immediate serving agents.list and persisted-install readback 068229eeee73 1 real CLI/Gateway scenario passed 38.967 s
MCP update, package runtime, update apply, and plugin install batch 1e3fa270e59f 52 tests / 4 files passed 219.42 s
Claw CLI, legacy resume, and read-only schema compatibility 19cf5ce92b18 36 tests / 3 files passed 105.00 s
Removal ownership regression / config-boundary guard regression 19cf5ce92b18 16 tests / 8 tests passed 243.71 s / 3.29 s
Approval-removal retry after the other process closes its database 32500e05d7f8 Targeted case passed; 16 cases filtered out 118.51 s
MCP removal sibling / native MCP config mutation sibling 32500e05d7f8 9 tests / 10 tests passed 159.97 s / 102.04 s

The focused commands use pnpm test <listed files> --maxWorkers=1. The latest CLI/schema run covers src/cli/claws-cli.test.ts, src/cli/claws-cli-legacy-resume.test.ts, and all three cases in src/claws/read-only-state-compat.test.ts. It verifies the repaired test ownership/ordering contracts and Doctor guidance for legacy schema failures without a new schema probe. Evidence: ow2-root-proof/local-root-claw/claw-owners.log, local-repair-proof/results.json, and local-final-targets/results.json. CI seconds are unavailable before publication.

The 26-file run at 1e3fa270e59f completed all selected files in 1,539.75 s: 319 tests passed, 14 failed. It also passed 22 Gateway package/removal-journal cases and the other reader/provenance coverage. The CLI/schema failures are superseded by the passing 36-case run above. Earlier MCP cancellation, package cleanup, and update-order failures are superseded by the passing 52-case owner run. The final approval-removal retry and its two sibling files passed all 20 selected cases in 380.52 s; the 16 unselected cases in the targeted file were filtered out, not rerun. Exact commands and counts: local-mcp-repair/results.json. No mixed earlier invocation is presented as wholly passing.

Completed static proof Tested source Wall time
Final core typecheck / MCP core test graphs 32500e05d7f8 13.96 s / 28.66 s
Repaired core-test-other and core-test-config-cli type graphs 19cf5ce92b18 23.56 s
Lint repaired core files / script files 19cf5ce92b18 30.41 s / 13.71 s
Deprecated API usage guard 19cf5ce92b18 34.33 s
First-party mock export ratchet 19cf5ce92b18 29.57 s
Worker inventory check / changed-file formatting 19cf5ce92b18 11.10 s / 0.72 s
Final runtime import cycles / Madge import cycles 32500e05d7f8 51.20 s / 66.69 s
Final Knip files and dependencies 32500e05d7f8 130.86 s
Final MCP typed lint 32500e05d7f8 32.17 s
Script erasability / script typecheck 32500e05d7f8 0.92 s / 11.89 s
Final worker inventory, initial / final check 32500e05d7f8 8.22 s / 6.81 s
SQLite worker ratchet: no T1 call-count growth 1e3fa270e59f 10.93 s

All 10 final follow-up commands at 32500e05d7f8 passed in 351.38 s total. The source-static gate list has no unexecuted checks after composing retained evidence. The preceding 19cf5ce92b18 checkpoint retains all 19 passing commands (675.16 s). All 27 canonical core test graphs are covered: 24 unchanged graphs from 1e3fa270e59f, core-test-config-cli from 19cf5ce92b18, and core-test-agents-root plus core-test-other from 32500e05d7f8. Static T1 inventory sites fell 749→707 (−42); these are source sites, not runtime SQL or worker-request savings. Exact pins, commands, times, and inherited exceptions: static-final-32500e05.md/.json and static-checkpoint-19cf5ce9.md/.json. Runs used the shared local proof slot under the authorized remote-wait fallback, with load below 48 and sufficient disk at admission.

The remote build at c00514bd22a6 passed in 451.13 s. The final SDK comparison at 32500e05d7f8 passed in 691.31 s, with digest b35261b1c710197e15c516c267119755b8469d8b291f29341f840ec535c7f7ad exactly equal to the earlier inventory comparison. It reports 148 reachable export impacts, 15 unique dependency declaration changes, zero direct export declaration changes, and zero added or removed entrypoints. The workspace worker contract retains strict read/insert/status types and raw inventory list/restore types. Evidence: mcp-sdk-result.json, mcp-sdk.json, and mcp-sdk.md; declaration deduplication is recorded in inventory-sdk-unique-declarations.json. Cumulative SQL evidence and its unchanged-owner attribution follow below.

The mcp_cleanup_failed result observed at 19cf5ce92b18 is resolved by the tested final repair: MCP cleanup runs under the existing deletion state lease and physical database context, preserving lock scope/key, timing, and the strict authority guard. All required lane proof is complete with the documented inherited/LOC exceptions. The published-driver × candidate update cell remains pending (lander); CI seconds are unavailable before PR creation.

Known exceptions are explicit: the inherited unused exports are isTelegramReadOnlyControlLaneText in extensions/telegram/src/sequential-key.ts and resolveContextTokens in src/auto-reply/reply/model-selection.ts (coordinator-confirmed on main; fixed upstream by afb4f0ff366b, PR #168048, run 38004851105). The line-cap ratchet reports agent-lifecycle-registry.ts 700→718 and claws/packages.ts 700→709; these production-size exceptions follow the task's non-gating LOC instruction, with no baseline suppression added. The original full core lint also found 12 untouched foundation errors in config-state-owner.process.test.ts, config-journal-snapshot.ts, io.audit.ts, and config-state-mutation.ts; the separate foundation repair is 35f80e7942cb. The 21 Claw lint findings were fixed and the repaired files passed typed lint. No additional inherited exception is asserted.

Statement and request impact

This is shared cumulative Claw-group evidence for all thirteen PRs, not a separate measurement of each intermediate. Under the coordinator's one-pair override, the shared harness ran one alternating whole-workload base→candidate pair on the owned remote lease: base 74f5fe25a6b34d53b818faa557bf421bcf3f182b (tree 231170bd664e60fcd6d54fc91c1f43f260d0e354) and candidate c00514bd22a6def1280522b27efc2a84636ea29a (tree 396f35af21d7dc06953895af2f1dcc5ba2d00eb8). N=1 per side; each median/min/max therefore describes one run. Warmed values are the ten-turn mean within that run, not a median of individual turns. The duration ratio for warmed covers the full ten-turn window. Phase movement and timing are diagnostic under this override.

Phase Base all Candidate all Δ all Base MAIN Candidate MAIN Base requests Candidate requests Base MAIN requests Candidate MAIN requests Duration C/M
01.boot 3,323 [3,323–3,323] 3,317 [3,317–3,317] -6 1,980 [1,980–1,980] 1,980 [1,980–1,980] 68 [68–68] 66 [66–66] 68 [68–68] 66 [66–66] 0.994
01.connect 503 [503–503] 456 [456–456] -47 84 [84–84] 84 [84–84] 56 [56–56] 58 [58–58] 54 [54–54] 56 [56–56] 0.99
02.first-turn 1,829 [1,829–1,829] 1,875 [1,875–1,875] 46 34 [34–34] 34 [34–34] 280 [280–280] 279 [279–279] 273 [273–273] 272 [272–272] 1.023
03.warmed-mean 1,147.3 [1,147.3–1,147.3] 1,141.7 [1,141.7–1,141.7] -5.6 14.5 [14.5–14.5] 13.6 [13.6–13.6] 204.4 [204.4–204.4] 204.1 [204.1–204.1] 201.4 [201.4–201.4] 201.1 [201.1–201.1] 1.013
04.second-session 4,356 [4,356–4,356] 4,266 [4,266–4,266] -90 140 [140–140] 126 [126–126] 738 [738–738] 683 [683–683] 729 [729–729] 674 [674–674] 1.029
05.control-plane 33 [33–33] 33 [33–33] 0 0 [0–0] 0 [0–0] 5 [5–5] 5 [5–5] 5 [5–5] 5 [5–5] 0.997
06.cron 1,222 [1,222–1,222] 1,448 [1,448–1,448] 226 44 [44–44] 67 [67–67] 178 [178–178] 217 [217–217] 175 [175–175] 214 [214–214] 0.999
07.compaction 406 [406–406] 405 [405–405] -1 25 [25–25] 25 [25–25] 84 [84–84] 84 [84–84] 81 [81–81] 81 [81–81] 1.002
08.shutdown 187 [187–187] 195 [195–195] 8 124 [124–124] 129 [129–129] 15 [15–15] 15 [15–15] 15 [15–15] 15 [15–15] 0.979
boot+connect 3,826 [3,826–3,826] 3,773 [3,773–3,773] -53 2,064 [2,064–2,064] 2,064 [2,064–2,064] 124 [124–124] 124 [124–124] 122 [122–122] 122 [122–122] 0.994
boot+connect+first 5,655 [5,655–5,655] 5,648 [5,648–5,648] -7 2,098 [2,098–2,098] 2,098 [2,098–2,098] 404 [404–404] 403 [403–403] 395 [395–395] 394 [394–394] 1.004
control+cron 1,255 [1,255–1,255] 1,481 [1,481–1,481] 226 44 [44–44] 67 [67–67] 183 [183–183] 222 [222–222] 180 [180–180] 219 [219–219] 0.999
compaction+shutdown 593 [593–593] 600 [600–600] 7 149 [149–149] 154 [154–154] 99 [99–99] 99 [99–99] 96 [96–96] 96 [96–96] 0.994
entire-workload 23,332 [23,332–23,332] 23,412 [23,412–23,412] 80 2,576 [2,576–2,576] 2,581 [2,581–2,581] 3,468 [3,468–3,468] 3,448 [3,448–3,448] 3,414 [3,414–3,414] 3,394 [3,394–3,394] 1.01

The whole workload changed by +80 all-thread statements, +5 MAIN statements, −20 worker requests, and +0.695 s. Warmed-turn values changed by −5.6 statements and −0.3 requests per turn. No statement or request savings are claimed. The coordinator accepted the whole-workload gate using unchanged-owner noise attribution: all eighteen nonzero source-attributed caller files have identical base/candidate Git blobs. Operation shifts include database preparation +76 statements/+2 requests, domain execution −48/−7, corpus inventory +35/+2, entry reads +30/0, and plugin compare-delete −26/−4. These are invocation-count and phase-distribution differences, not removed SQL classes.

Statement-attributed caller Δ statements Source identity
extensions/memory-core/src/memory/manager-cpu-worker-runtime.ts +18 Identical blob
src/config/config-state-mutation.ts -7 Identical blob
src/config/sessions/session-accessor.sqlite-entry-admission.ts +4 Identical blob
src/config/sessions/session-accessor.sqlite-reclamation-run.ts -8 Identical blob
src/config/sessions/session-accessor.sqlite-replacement-worker.ts -1 Identical blob
src/config/sessions/session-entry-patch.ts +5 Identical blob
src/config/sessions/session-entry-read-ordered.ts +23 Identical blob
src/config/sessions/session-entry-read-writable.ts +3 Identical blob
src/config/sessions/session-lifecycle-projection.ts -4 Identical blob
src/config/sessions/session-pending-input-store.ts +5 Identical blob
src/config/sessions/session-transcript-execution-read.ts +5 Identical blob
src/config/sessions/session-transcript-read-worker-runtime.ts +8 Identical blob
src/config/sessions/session-transcript-worker-runtime.ts +38 Identical blob
src/config/sessions/session-turn.ts +20 Identical blob
src/plugin-state/plugin-state-worker-client.ts -56 Identical blob
src/state/openclaw-agent-execution-native.ts +71 Identical blob
src/state/openclaw-agent-worker-store.ts -68 Identical blob
src/state/openclaw-state-read-worker.ts +10 Identical blob

Existing same-pin root74 runs from the four required group pairs span 23,218–23,684 statements and 3,465–3,505 requests; these are descriptive controls, not extra pairs:

Existing sample Whole-workload statements Whole-workload requests First-turn statements First-turn requests Warmed statements/turn Warmed requests/turn
root/candidate 23,564 3,482 1,731 267 1,158.7 205.1
migration/base 23,218 3,465 1,754 268 1,121.3 203.8
plugins/base 23,684 3,505 2,428 344 1,116.6 200.8
claw/base 23,332 3,468 1,829 280 1,147.3 204.4

Attribution evidence is retained in groups/claw/phase-table-and-operations.md, groups/claw/source-owner-identity.json, and same-root74-control.json/.md under remote proof invocation 17a52631a749/collected. The later assertion/record-type, generated-inventory, static cleanup, and missing-schema error-translation repairs do not change emitted statement/request classes; they are not presented as a new SQL measurement.

Moving persistence to a worker is an ownership correction, not a saving. Administrative Claw operations can add worker dispatches and broader ownership reads; lease/deletion checks remain in totals. The ordinary tool-policy and prepared-provenance read modules are unchanged.

Review closure

The cumulative source reached the third P2 review round. The accepted config-publication and canceled-work settlement corrections are retained, along with subsequent focused failure and static-analysis repairs in the pinned source. Publication partitioning changes only grouping; no additional review round or new review result is claimed.

Depends on #168431. Land after its prerequisite; this PR remains unmerged.

Activate command services and their add/update callers together; retain accepted-work settlement.
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes scripts Repository scripts size: XL labels Oct 10, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR routes Claw add and update through the serving Gateway or an exclusive offline state owner.

Example: Add the agent claw-worker while its Gateway is running, then request agents.list.

  • Before: The separate CLI could commit state without updating the Gateway's resident facts.
  • After: The Gateway owns the operation and confirms config application before returning.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful ownership work with two actionable defects and incomplete authority and upgrade validation.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Separate CLI mutations can leave a running Gateway's state stale, and canceled requests need safe completion of accepted cleanup.
Reason: The ownership correction addresses an established lifecycle invariant without adding configuration knobs or a competing persistence owner.

Merge readiness

⛔ Blocked before merge - 8 items remain

Keep open: the ownership repair is useful, but config confirmation can trigger incorrect workspace cleanup, and an added test depends on the following stack slice.

Priority: P2
Reviewed head: 4fe3617a60097b750603cd920cf1d2e9e8f5ed31

Before merge

  • Add real behavior proof - Authority-chain proof required: demonstrate add/update through the registered Gateway handlers for an allowed local administrator, reject local non-admin and nonlocal callers before effects, and show revocation blocks new writes while accepted compensation retains custody only under the current physical owner. The full body reports a real CLI/Gateway add scenario and helper cancellation coverage at cumulative sources, but supplies local evidence filenames without inspectable final-effect traces for this boundary. Publish redacted logs or terminal output tied to the reviewed behavior, removing credentials and private endpoints. The published-driver × candidate compatibility cell is explicitly pending. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Preserve committed config state when application confirmation fails (P2) - After transformConfigFileWithRetry saves the agent entry, application.confirm can still throw if another config write supersedes its receipt or request authority is revoked while application is pending. applyClawAddPlan sets configCommitted only after this service returns, so it treats that exception as an uncommitted write and removes the empty workspace at add.ts:548. A minimal Claw can therefore remain configured with a deleted workspace and incorrectly recorded partial state. Carry the durable commit fact separately from application confirmation so this path preserves the workspace and resumable config_committed state.
  • Move the migration refusal test alongside its offline guard (P2) - This new table entry expects stderr to contain exclusive-offline-owner and stop-the-Gateway guidance. At this head, runClawsMigrateCommand still proceeds directly into migration planning and consent validation; it never invokes runWithLocalStateOwner or emits that refusal. The synthetic plan digest therefore reaches a different error path and cannot satisfy these assertions. Move this case into the following slice with the migration guard, or move that guard here with its caller.
  • Resolve security review attention item - No concrete authorization bypass was found, but the new retained-settlement boundary still needs final-effect authority evidence.
  • Resolve merge risk - Before merge, establish that retained settlement permits only accepted compensation and cannot authorize new effects after administrator revocation or physical-owner replacement.
  • Complete next step - Inspect the baseline-ratchet failure and establish whether it requires a branch repair or documented outside-cause attribution; its job logs were unavailable to this review.
  • Improve patch quality - Add final-effect proof for forbidden local/nonlocal callers and show revocation or owner replacement invalidates authority before new I/O.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Preserve committed config state when application confirmation fails — src/gateway/server-methods/claws-command-runtime.ts:217-218
  • [P2] Move the migration refusal test alongside its offline guard — src/cli/agent-roster-owner.process.test.ts:66-69

Tests

  • Missing end-to-end proof: Supply current-source allowed/forbidden/revoked final-effect evidence, including cancellation after config persistence, plus the pending stable-driver upgrade validation.
Agent review details

How this fits together

The CLI supplies source paths, options, and consent to the selected state owner, which invokes shared Claw composition, worker persistence, and config publication and returns command output.

flowchart TD
 CLI[Claw CLI] --> Selection[Local owner selection]
 Selection --> Gateway[Serving Gateway]
 Selection --> Offline[Exclusive offline owner]
 Gateway --> Composition[Shared Claw composition]
 Offline --> Composition
 Composition --> Persistence[Worker persistence]
 Composition --> Config[Config publication]
 Persistence --> Output[Command result]
 Config --> Output
Loading

Technical review

Best possible solution:

Keep the shared owner routing while distinguishing durable config commits from runtime confirmation and preserving resumable state.

Do we have a high-confidence way to reproduce the issue?

Source tracing establishes the post-write cleanup failure and the migration test mismatch; no target code or tests were executed during this read-only review.

Is this the best way to solve the issue?

Reusing the existing local state owner and shared composition is appropriate, provided persisted success is not confused with a failed application acknowledgment.

Full review comments:

  • [P2] Preserve committed config state when application confirmation fails — src/gateway/server-methods/claws-command-runtime.ts:217-218
    After transformConfigFileWithRetry saves the agent entry, application.confirm can still throw if another config write supersedes its receipt or request authority is revoked while application is pending. applyClawAddPlan sets configCommitted only after this service returns, so it treats that exception as an uncommitted write and removes the empty workspace at add.ts:548. A minimal Claw can therefore remain configured with a deleted workspace and incorrectly recorded partial state. Carry the durable commit fact separately from application confirmation so this path preserves the workspace and resumable config_committed state.
    Confidence: 0.98
  • [P2] Move the migration refusal test alongside its offline guard — src/cli/agent-roster-owner.process.test.ts:66-69
    This new table entry expects stderr to contain exclusive-offline-owner and stop-the-Gateway guidance. At this head, runClawsMigrateCommand still proceeds directly into migration planning and consent validation; it never invokes runWithLocalStateOwner or emits that refusal. The synthetic plan digest therefore reaches a different error path and cannot satisfy these assertions. Move this case into the following slice with the migration guard, or move that guard here with its caller.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 45c7bc9e9ca9.

Merge-risk options

Maintainer options:

  1. Hold for authority evidence (recommended)
    Keep this PR unmerged until final-effect evidence establishes rejection of forbidden callers and invalidation of stale authority.

Provenance checked

  • Agent creation and empty-workspace cleanup keeps the original intent (88a7306: Create one consented agent and workspace, preserving existing settings and removing an empty reservation when config commit fails.)
  • Gateway readiness changes intended behavior with a stated reason (6299236: Scheduling must wait until applied Gateway config contains the requested agent; the new application receipt replaces polling.)
  • Plugin requirement runtime handoff keeps the original intent (e93b01b: Apply committed requirements together after compensation and lease release; the new services retain this batch owner while removing its CLI transport adapter.)

Testing

Proof path: in-process harness.

Security

Needs attention: No concrete authorization bypass was found, but the new retained-settlement boundary still needs final-effect authority evidence.

Evidence

What I checked:

  • Verified introduced change: Reviewed the pinned base-to-head changes; live GitHub still identifies the same head and reports mergeable true. (4fe3617a6009)
  • Persistence precedes application confirmation: commitConfig saves the config before awaiting confirmation; confirmation can throw for cancellation or a superseded receipt, while add records configCommitted only after commitConfig returns. (src/gateway/server-methods/claws-command-runtime.ts:218, 4fe3617a6009)
  • Cleanup assumes no durable commit: When configCommitted remains false, the catch path removes the empty workspace and can mark the install partial even though the saved agent entry references that workspace. (src/claws/add.ts:548, 4fe3617a6009)
  • Intermediate test depends on later behavior: The added migration case expects exclusive-offline-owner guidance, but this head's migration command performs planning and consent validation without that owner guard. (src/cli/agent-roster-owner.process.test.ts:67, 4fe3617a6009)
  • Full discussion and proof claims inspected: Retrieved the full body beyond the supplied excerpt and both comments; the body describes cumulative results at other sources, references local evidence filenames, and explicitly leaves the published-driver compatibility cell pending. (4fe3617a6009)
  • Current CI failure remains unattributed: The baseline-ratchet job and aggregate CI gate failed in https://github.com/openclaw/openclaw/actions/runs/38049020686; annotations only report exit code 1, and fetching job logs was blocked at the artifact host, so no diff attribution is established. (4fe3617a6009)

Likely related people:

  • Peter Steinberger: Raw commit e93b01b adds src/claws/plugin-runtime.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e93b01b32de0; files: src/claws/plugin-runtime.ts)
  • Gio Della-Libera: Raw commit 88a7306 adds src/claws/add.ts:116 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 88a7306308f7; files: src/claws/add.ts)

PR surface

Source +327, Tests +190, Docs +13, Other +2. Total +532 across 58 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 31 601 274 +327
Tests 25 492 302 +190
Docs 1 13 0 +13
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 58 1108 576 +532

Labels

Label changes:

  • add P2: The defects affect bounded experimental Claw administration and intermediate validation.
  • add merge-risk: 🚨 security-boundary: The new Gateway services transfer accepted cleanup from request authority to retained physical-owner authority.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: The defects affect bounded experimental Claw administration and intermediate validation.
  • merge-risk: 🚨 security-boundary: The new Gateway services transfer accepted cleanup from request authority to retained physical-owner authority.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

Reviewed October 10, 2026, 7:43 AM ET / 11:43 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Superseded by #168586, which merged. Claws CLI mutations now refuse while a live Gateway owns the state and use the existing exclusive offline owner otherwise, in 43 production lines. That meets the outside-writer requirement in AGENTS.md without moving Claw provenance writes into workers. Closing this part of the chain unmerged, following the "choose good compromises" guidance. The branch is preserved.

@steipete steipete closed this Oct 10, 2026
@RomneyDa
RomneyDa deleted the dbasync/ow2-claw-12 branch October 22, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant