Skip to content

fix(nodes): apply the same tool policy to node sessions as Gateway sessions - #160444

Merged
steipete merged 23 commits into
mainfrom
codex/node-parity-p1a-tool-surface
Sep 30, 2026
Merged

steipete merged 23 commits into
mainfrom
codex/node-parity-p1a-tool-surface

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Node-hosted session turns reconstructed a different tool surface and could ignore the Gateway's configured filesystem containment and apply_patch policy. This change prepares one tool catalog and policy for local and node execution, and refreshes the catalog on every admission into a retained worker.

User Impact

Node sessions honor the same global and agent-specific filesystem/patch settings, permission precedence, read budgets, and image sanitization as Gateway sessions. Older nodes retain their declared launch-tool limits. No configuration or stored-data migration is required.

Gateway-owned session, portal, skill-workshop, and presence tools use the generic worker.gatewayTool transport. Handles remain bound to the exact live run, turn claim, placement generation, and environment owner epoch. The existing SQLite worker broker owns durable spawn/send election, replay, cancellation, settlement, and restart recovery. Mixed-media results share the transcript transport's byte-budget owner: encoded image data may use the media allowance, while text, details, and overhead remain within the control budget.

Why This Change Was Made

Integrated main through fad7d345a0c7, preserving warm retention, prompt caching, completion waits, workspace reconciliation, capability negotiation, and busy-child steering before follow-up custody. The direct sessions_send steering path carries sender authority through asynchronous transcript preparation and revalidates it at the final enqueue, including its supported retry. Main’s selected-person wrappers, notification dispatch, and recipient-owned steering custody remain intact; the non-operator enqueue guard does not reattach sender lifetime to accepted operator guidance. A revoked sender cannot enqueue new input; revocation after successful admission does not withdraw accepted input.

Published @openclaw/gateway-protocol 2026.9.6/2026.9.7 spawn/send/portal/presence decoding imports remain available. Prepared spawn/send argument schemas have one canonical protocol owner, with core reexports and legacy envelopes composed from it. Retired RPCs remain unadvertised. The package README names removal in an announced breaking package release after consumer migration.

Production LOC and Deletion Ledger

Production means all files except tests/test support/harnesses/suites and documentation. Against merge base fad7d345a0c7: +4,546 / −4,557 = −11.

Shared protocol argument schemas, tool construction and inventory projection, durable operation kernels, and one generic transport replace the former parallel paths. Published decoding imports remain covered by the compatibility contract above. Gateway-tool and operation-receipt types remain leaf contracts to preserve the acyclic import graph. Transport concurrency and durable-operation limits remain separate because their lifetimes differ.

The exact claim/owner projection excludes host callbacks from database-worker payloads. The landing refresh preserves main's workspace-result receipt checks and recipient-owned steering custody. A final 14-line reduction shares once-only publication settlement, reuses canonical string normalization, and maps tool bindings directly without changing ordering or authority.

Evidence

Merged through the native maintainer workflow at 2026-09-30T08:14:32Z: reviewed head 92da8c64608d3d6af5b132c8a7180441f6354521, squash commit 10ea4739bd0f3d72663fd924197530bef1c4f6b6 on main. No admin exception or CI rerun was used.

  • Addressed ClawSweeper's verified P1 finding: the integrity-checked npm @openclaw/[email protected] artifact (published 2026-09-30T03:29:18.678Z) exports the presence schemas, types, feature constant, and validator. These now remain in the existing decoding-compatibility owner. The shared error-code schema retains its published literal-union representation. Retired presence RPCs remain absent from active method, feature, and schema registration.
  • Built-package comparison retains all 1,632 published root runtime exports. Both presence schemas match the released JSON bytes; valid/invalid parameter decisions also match. Package test types and protocol-generation checks pass. The public-barrel regression fails on the original missing validator (3.85 s wall) and passes on this exact head (3 s wall; 58 ms test body with one worker).
  • A small inventory cleanup selects the configured/bundled model first and applies transport normalization once. Selection precedence, fields, clone behavior, hook inputs, and identity semantics remain covered by existing tests. Production is +4,546 / -4,557 = -11 against fad7d345a0c7. Fresh isolated autoreview is clean at P0–P2 after fixing its test-assertion finding.
  • Current repair proof passes 109 unique focused tests covering compatibility, worker schemas, tool inventory, and Codex settlement/native-hook siblings. Core, extension, and package-test typechecks pass. Typed lint reports zero warnings/errors; formatting, line-cap, max-lines, assertion-safety, and protocol-generation checks pass.
  • The isolated AWS checkout was selected at the exact candidate commit and clean tree 4dcc44aa9022c4a3f72e471ced2abb34e58ceb47 before its runtime build and live run. The QA runtime build passed in 61 seconds. measure.sh npl23 3 returned all six expected local/node responses; warm node final times were 2,744/2,525 ms. The optional phase-marker display exits 1 on this uninstrumented build; all responses were independently asserted.
  • Exact-head CI run 36685740551 passed on attempt 1, including required Windows coverage and openclaw/ci-gate; no rerun was used. ClawSweeper review completed for this head at 2026-09-30T07:54:53.891Z, confirmed the released presence API repair, and reported no actionable defect. The compatibility regression costs 3 s wall / 58 ms test body locally; per-file CI timing was unavailable. Both prior refreshed heads also passed CI without a rerun. The original settlement timeout reproduced 5/5 on clean main and 5/5 on the original PR head, and existing main repair 52e60fb42bc3e is incorporated. The historical Windows declaration timeout remains unexplained; Windows is required for ordinary PR CI and was never treated as advisory.
  • The authorized lead land decision retains the documented untested published-node-host upgrade combination. Node-host/supervisor code, stored SQLite shapes, retention, and config migration are unchanged by this PR. Live proof uses isolated loopback AWS nodes, not a physical device or WAN.
Previous-head evidence and investigations

Previous candidate 0fe1ee3af92de

Landing candidate: 0fe1ee3af92defb8220825820207149debc94054.

  • The previous candidate 85547eb360609 passed exact-head CI run 36675923646 on attempt 1 with no rerun. Main advanced during native merge admission and introduced a conflict between adjacent type-only imports in service.types.ts. The native wrapper confirmed a pre-dispatch abort with no merge request or outcome record, and its exact operation lock was recovered after all child tools exited.
  • Integrated main fad7d345a0c7, retaining both AnyAgentTool and CloudWorkerSetupMutationAdmission imports. Main's node-enrollment admission callback and equivalent portal property-update loop compose with the existing tool surface; no prepared-tool or transport implementation changed. Production remains +4,499 / -4,503 (net -4). Fresh two-pass whole-candidate autoreview found no actionable P0–P2 issue.
  • On the isolated AWS lease, the source tree matched 4599b496a7ca0ef9e9db6dc02645dc7243793960, which is the committed candidate tree. Core and extension typechecks passed in 16/26 seconds. All 331 focused tool/worker/portal/enrollment tests passed across 20 files in 199 seconds. All 56 Codex sibling tests passed across seven files in 39 seconds, including the original six-file CI settlement composition and native-hook fallback.
  • The exact commit was then selected on the lease with a clean tracked tree. Its QA runtime build passed in 63 seconds. Live measure.sh npl23 3 returned all six expected local/node responses; warm node final times were 3,060/3,501 ms. Its optional phase-marker display exits 1 on the uninstrumented build; responses were independently asserted. Exact-head CI run 36680607340 passed. ClawSweeper subsequently identified the released-presence API issue repaired by the current candidate; this prior head was not merged. The previous candidate's full production build, 4,861-test app-server suite, and live proof are retained below with their original head rather than presented as new-head runs.
  • The original settlement timeout was independently reproduced five times on clean main and five times on the old PR head. Its existing main fixture fix 52e60fb42bc3e is included; no parallel runtime repair was added. The historical Windows declaration timeout is outside the PR runtime and remains unexplained; Windows is required for ordinary PR CI, and the prior refreshed head passed it. Details and limitations are retained below.
  • The authorized lead land decision retains the documented untested published-node-host upgrade combination. Node-host/supervisor code, stored SQLite shapes, retention, and config migration are unchanged by this PR; wire-schema files do not establish a database-schema change. Real proof uses isolated loopback AWS nodes, not a physical device or WAN.

Previous reviewed candidate 85547eb360609

Landing candidate: 85547eb3606094ffacc7e7da7745dcea3c6afc69.

  • Resolved the actual conflict with main bcd3cace19112: retain main's removal of unused browser runtime forwarding exports and keep only the prepared browser-tool definition export required by this PR. Production remains +4,499 / -4,503 (net -4). Whitespace checks pass. Fresh isolated whole-candidate autoreview completed both passes with no actionable P0–P2 findings.
  • Reproduced CI's exact run-attempt.settlement.test.ts failure on AWS with node scripts/run-vitest.mjs extensions/codex/src/app-server/run-attempt.settlement.test.ts --maxWorkers=1, five times on clean main merge-base df2a29cac9ad and five times on PR head 3c200c006909. Every run failed only settles timeout at final with writer release after cutoff at 120 seconds; six sibling cases passed each time. Baseline wall times: 190/150/150/150/150 seconds. PR-head wall times: 194/151/149/151/151 seconds. The conditional original-shard replay was unnecessary because the single-file comparison reproduced the defect on both revisions.
  • Root cause and existing owner: main's native-thread assignment change 5367527c271 rejects reuse of a rotated predecessor's thread ID. The successor fixture still returned thread-1 for fresh thread/start, so the runtime refused it and the fixture waited for an unreachable turn/start. Main already repaired this in 52e60fb42bc3e; that fix is incorporated here without a parallel Codex patch. The fixture sets supportsTools: false, returning before shared tool construction. Personally inspected sibling Codex source at ade0ccacf9182e665cf784de041c51a79e35bc31, including request_processors/thread_processor.rs fresh thread creation and bespoke_event_handling.rs terminal notifications.
  • Windows investigation: CI attempt 2 job 109739667913 timed out in the unchanged synthetic declaration fixture after 186,285 ms (configured timeout 120,000 ms). Its declaration/build inputs are outside the changed tool runtime. Recent hourly main Windows runs 36661253850, 36653919235, and 36645461605 passed; no matching timeout was found in the bounded sample. The earlier Windows failure in 36640080821 was preparation rejection before tests. The timeout cause remains unresolved. Windows is required for ordinary PR CI; the Full Release Validation advisory exception does not apply.
  • The isolated AWS checkout matches the candidate commit and tree b5e81afe550f6f5140477a81f9bdbcb54569b4f6. tsgo:core passes in 14 seconds and tsgo:extensions in 16 seconds. All 280 focused tool/worker tests pass across 18 files in 213 seconds. The normal Codex app-server suite passes 4,861 tests with 11 skips across 319 files in 572 seconds; the formerly hanging final-writer cutoff case passes in 822 ms. Full pnpm build passes in 472 seconds. Live measure.sh npl23 3 returned all six expected local/node responses; warm node final times were 2,624 and 2,860 ms. The script exits 1 only because its optional phase-marker display is empty on this uninstrumented build; all six responses were independently asserted. Exact-head CI run 36675923646 passed on attempt 1, and ClawSweeper completed this exact head at 2026-09-30T06:05:14.205Z with no actionable code finding. Native admission later stopped before dispatch because main introduced a type-import conflict; no merge request or outcome record was created.

The records below are historical evidence, not current-head CI claims. The reproduced settlement cause and landed owner fix above supersede the earlier unresolved attribution.

Landing candidate: 3c200c0069090a4f93905d8d3fd8127372a20704.

  • Rebased onto main df2a29cac9ad37c31a0f5a0d977ba3e4fd833cb0, including the CI-harness fixes 6c07ebfaf475 and df2a29cac9ad. The former competing repair fix(ci): unblock extracted manifest checks #161569 was closed as superseded. The sibling parity PR perf(nodes): load only what a worker turn needs #160442 remained open at publication.
  • All 20 commits are patch-identical under git range-diff from the prior candidate; the rebase had no conflicts or changed PR code. Main's overlapping files contain disjoint changes to session-list validation, test bootstrap naming, wrapper inventory, and shrinking ratchets. git diff --check passes, and production LOC remains net −4. Existing focused tests, types, builds, live proof, and clean autoreviews below remain prior-candidate evidence; no new lease run is claimed for this mechanical refresh.
  • Exact-head CI run 36667758773 attempt 1 passed preflight, build, and lint, then failed in two unrelated lanes; 23 other jobs were cancelled, and their coverage is not claimed as passing. Job 109736332740 passed its Node subset (962 tests plus 1 skip) and storage subset (716 tests plus 4 skips), but Bun Canary 1.4.3-canary.1 (6b9148b17) crashed with SIGSEGV / address 0x2 459 ms into vitest.gateway-client.config.ts, before any Bun test result. Job 109736332407 timed out at 120,000 ms in run-attempt.settlement.test.ts / settles timeout at final with writer release after cutoff; its other 44 tests passed.
  • Investigation: the settlement fixture blob 4e05d7d7e88d1882081f27aa4342aef791bfbe19 is identical at the merge base, PR head, and main 7894445e4ea54. The Codex implementation/harness, session/transcript owners, relevant Vitest configs, worker bootstrap, package manifest, and lockfile are unchanged by this PR. The fixture sets supportsTools: false; the dynamic-tool builder returns before createToolSurface, so the prepared-tool change does not enter this timeout path. No competing fix was found in current main or the targeted open-PR search. The timeout cause remains unresolved; source attribution is not a reproduced root cause. Per the mechanical-refresh proof constraint, no new lease suite was run. The single permitted gh run rerun 36667758773 --failed request for this refreshed head was submitted after this investigation. No further rerun allowance remains for this head; a passing retry will not be claimed as a fix.
  • Attempt 2 repeated the identical 120,000 ms settlement timeout in job 109739678335 (44 sibling tests passed). The Bun retry lane was cancelled after this failure, so no successful Bun replay is claimed. No further rerun or source change was made. Landing is held for the unchanged Codex settlement failure; its exact awaited stall is unresolved. Open PRs fix(codex): retain complete answers while previews are pending #139260, fix(codex): use monotonic clock for attempt execution deadline #155801, and fix(codex): stop recovery warnings after delivered final replies #153758 concern different preview, execution-clock, or recovery behaviors and do not establish a fix for this writer-cutoff test.
  • Attempt 2 also failed Windows job 109739667913: test/scripts/tsdown-declaration-resolution.test.ts / honors resolved dts=true over the opposite workspace default timed out at 120,000 ms (161 tests passed, 7 skipped). The fixture blob 2e6958e1e8b50f2c3ce96756e909f96b4e98f093, declaration helpers/config, manifest, and lockfile are unchanged by the PR; it builds synthetic declarations rather than worker tool code. Its cause remains unresolved; no matching open repair was found. Latest main e2f73b9c69473 still has both identical failing fixtures and unchanged Codex terminal/transcript owners.
  • ClawSweeper completed review of exact head 3c200c0069090a4f93905d8d3fd8127372a20704 at 2026-09-30T04:20:20.979Z, with no actionable code findings. Its published-host upgrade concern remains the explicitly accepted proof limitation described below; protocol schemas are not a changed persisted database model. No merge request has been submitted.

Previous candidate (31eec699c275)

The following records preserve prior-head results and investigations; they are not current-head CI claims.

  • Integrated main's session-owner assignment and CLI-admission changes. The only conflict was explicit owner fields versus the PR's existing options spread; both fields still flow unchanged, and the resolved tool-construction file is byte-identical to the previously reviewed PR. A newly added cron caller was migrated by removing the retired, unused agentDir profile argument; its real tool and MCP consumers still receive the directory.
  • Refreshed whole-branch and focused caller reviews are clean at P0–P2. The 18-file composition run passed 396 tests (219.30 s), including owner assignment, real MCP session ownership, CLI admission, tool projection, portal serialization, runtime imports, and worker lifecycle. All 75 cron tests passed (65.43 s). Core production and package-test typechecks pass. Full architecture checks pass with zero runtime or Madge cycles.
  • The exact final commit was selected on the isolated AWS lease with clean tracked source before its QA runtime build. That build passed in 63.19 s. Earlier full-build and broader proof are retained below with their scope.
  • A real two-turn node session called presence and exec on both turns; canonical history contains all four successful tool results. The final three-turn local/node measurement returned all six expected pong responses. Warm node final times were 3,183 and 2,762 ms; main baseline ca8f24d05fc4 was 2,449 and 4,219 ms. The optional phase-marker display exits 1 on an uninstrumented build; all six responses were independently checked.
  • CI run 36660633932, job 109714839098, timed out only in the unchanged synthetic package-mode fixture (package-openclaw-for-docker.e2e.test.ts, 120,000 ms; 66 other tests passed, 3 skipped). Its offline npm pack <normalized archive> --dry-run --json --ignore-scripts --offline receipt child was still alive at job cleanup. The test, packaging driver, inventory/subprocess helpers, fixture/env helpers, manifest, lockfile, and tsconfig are byte-identical between base 6562480a495d, this PR, and main snapshot f1fc708f75c7; changed worker/tool code does not enter that child. No competing main fix was found. An original-order replay with the CI prebuilt/build flags and two workers passed 67 tests plus 3 skips in 59.13 s on Node 24.19.0. The npm stall cause remains unresolved; the passing replay is not a fix. The single permitted failed-jobs rerun was used; packaging passed as job 109719153581 in attempt 2. No rerun allowance remained for that prior candidate. The first attempt also cancelled 70 jobs; that coverage is not claimed as passing.
  • That rerun exposed a deterministic fixture defect in run.prepared-harness-source-delivery.integration.test.ts (job 109719151079). The complete original-order shard reproduced the same sole failure (648 passed; that first replay had the prebuilt-dist flag set, unlike CI); the CI main parent 9cda3b850b5c passed the full test file while the PR failed it. Exposing the resolver rejection identified an incomplete ask_user mock, not lost TTS provenance: the shared constructor table reads createAskUserTool, but the dispatch fixture mocked only prompt readiness. The integration now restores the real module during harness setup and explicitly checks the resolver promise so dispatcher error handling cannot hide the cause. All ten cases pass in 60.08 s wall (28.18 s Vitest duration, one worker). No production code changed; prior runtime/build/live proof remains applicable. Fresh scoped autoreview is clean; the affected agents-other typecheck, typed lint, and formatting pass.
  • Current-head CI 36666025793 is blocked by check-lint job 109731099094: 20 diagnostics in main-owned scripts/ci-build-manifest.mjs, introduced by 9d75a8fe87af5 (ci(release): regain ci.yml headroom, pin the QA runtime-pair lane, and split Codex plugin tests #161534). This PR does not change that file. Its blob 750ebafba61436189d054bdd63db888e5f130235 is identical at the tested main parent 9c11a9917c51 and current main bc5bc240913e. The exact-main targeted script lint reproduces all 20 errors on the isolated lease (0.358 s). The lockfile, lint config, and lint runner are unchanged; manifest differences are unrelated package files/Windows test commands. The existing repair is fix(ci): unblock extracted manifest checks #161569, still open at this observation. No duplicate repair, CI rerun, or merge request was submitted. Cancelled CI coverage is not claimed as passing.
  • ClawSweeper completed review of 31eec699c27588069b88d4b422ed65a5b3d602c2 at 2026-09-30T04:01:22.937Z with no actionable code findings. Its published-host upgrade concern and schema/config classifications are addressed in the compatibility response below. This is prior-head evidence; the refreshed head requires its own completed review.

Earlier landing refresh (bd740f53b74b / 9223952e3a53)

  • Resolved conflicts with main while preserving both the shared tool-surface changes and main's operator, steering, receipt, and recovery contracts. The final rebase onto main's type-import cycle fix 2a0a65c4ae69 is patch-identical to the reviewed candidate.
  • Full independent autoreview completed with no actionable P0–P2 findings. The 34-file focused/sibling run passed 667 tests in 322.03 s; all 88 tests covering the final cleanup passed in 78.06 s.
  • Core production, package tests, and all source-test typecheck lanes passed. Targeted typed lint and formatting passed. Full architecture checks passed on the composed tree, with zero runtime or Madge cycles. The inherited update-CLI type cycle was repaired by the already-landed main fix, not a parallel PR patch.
  • Full pnpm build passed in 471.96 s. The remote staged source tree matched the final candidate exactly. Runtime/build proof precedes only the disjoint main type-import fix; its architecture proof ran after composition.
  • A real two-turn node session called presence and exec successfully on both turns; canonical history contains all four successful tool results. The three-turn local/node measurement returned all six expected pong responses. Warm node final times were 2,437 and 2,669 ms; the refreshed main baseline was 2,449 and 4,219 ms. The optional phase-marker display exits 1 on an uninstrumented build; all six responses were independently checked.
  • CI run 36656041787, job 109700902583, found one PR-caused stale source assertion in server-import-boundary.test.ts: it required the retired promise-chain loader spelling after the new tool factory switched to await. The exact-head focused replay reproduced the failure (19.42 s). The assertion now names the current lazy call; eager-import and lazy-factory guards remain, and the sibling runtime lazy-startup suite still verifies actual loading behavior. All 15 tests in both files pass (52.38 s), and fresh focused autoreview is clean. Production code and its earlier proof are unchanged. Other unfinished CI shards were cancelled; no CI rerun was used.

Earlier-head evidence (10e831d58093)

  • The new sender regression fails on the original code: revoked input is accepted, while live and unscoped controls pass. All three cases pass after the fix; the test covers final enqueue and persistence into the receiving transcript.
  • Independent review completed for the full integrated candidate. Two findings were rejected with direct evidence: the removed presence decoding exports were introduced September 27 after the latest package's September 23 publication, and copyBeforeToolCallWrapperMetadata directly calls copyPluginToolMeta before copying other metadata. No accepted finding remains.
  • Earlier refresh validation passed all 584 focused/sibling tests. The subsequent localized corrections passed an additional 101 worker-tool and inventory tests, core types, and typed lint. Those corrections retain the existing typed description helper and use single-pass copy-on-write loops.
  • All tsgo:all lanes and extension test types pass on final head 10e831d58093. The full architecture check passes with zero runtime/Madge cycles. Protocol generation/checks, the PR wrapper inventory, formatting, the Control UI catalog, and line-cap/max-lines/assertion-safety ratchets passed. Extension lint (10,563 files), script lint (1,254 files), and affected core files pass with zero warnings/errors.
  • The final QA runtime build passed in 65.1 s. The remote checkout’s full staged tree matched the candidate tree before selecting the exact commit, and tracked source was clean before the build. A live two-turn node session completed presence and exec on both turns. Canonical history contains all four successful tool results, and both node-journal rows bind the same physical worker owner.
  • Live node-origin sessions_spawn and sessions_send passed through the generic transport. The child canonical history contains exactly one message with matching inter-session provenance, sender session, and idempotency key. A cross-tree send returned the expected family-boundary denial; the unrelated root retained zero history messages.
  • measure.sh <lease> 3 returned all six expected local/node pong responses. Warm node final times were 2,270 and 3,219 ms (baseline: 2,339 and 2,574 ms). The optional phase-marker display returns exit 1 on an uninstrumented build; all six client results were independently asserted. The baseline fixture needed the canonical Doctor schema migration after main integration; repair completed before this successful rerun.
  • CI run 36524003513 stopped at check-additional-runtime-topology-architecture: type-only imports through runtime implementations created two cycles. Other unfinished jobs were cancelled. Restored leaf contracts fix the cause; the full architecture check now passes with zero runtime and Madge cycles. The repair passed review, core types, typed lint, line caps, the wrapper inventory, and 135 focused tests. One earlier focused process ended with SIGKILL without an assertion or kernel OOM record; the same-order replay passed, but the termination cause remains unknown.
  • After resolving the actual conflict with main’s participant-aware steering, all 164 affected session-send, participant/custody, spawn production-boundary, and worker-send tests pass (246.04 s wall). A fresh full-branch autoreview of this candidate found no actionable P0–P2 issue.
  • CI run 36531874830, job 109287556130, exposed an inherited fixture defect in ci-node-worker-owner-boundary.test.ts: OPENCLAW_E2E_USE_PREBUILT_DIST=1 leaked from the host CI job into a deliberately sparse historical runner. This triggered an unrelated missing build-prerequisite import before the ownership assertions. Reproduced the same two failures with that CI flag; clearing it only in the fixture makes all six cases pass (3.90 s wall). Production validation stays unchanged, every existing assertion remains, and fresh scoped autoreview is clean. The failure was inherited from main; the same fixture repair subsequently landed there as bb4573cd427c and composes cleanly with this branch. No blind CI rerun was used.
  • CI run 36533312569, job 109292121329, found a PR-caused claim-adapter regression: cloning the whole structural input included a personal-publication authority callback. The real personal-publication suite reproduced both failures. The adapter now captures exactly the claim scalars and owner variant before yielding, and the handoff wrapper captures its exact outer fields. Host callbacks stay with the existing admission guard. All 162 affected publication, claim, worker-tool, workspace-guard, and inventory tests pass (150.75 s); core types, five receipt-worker tests, full architecture, typed lint, line caps, and the wrapper inventory pass. Fresh autoreview is clean. Existing publication failures supply the regression coverage.
  • Exact-head CI run 36537574384 was cancelled after two roots: an unchanged projection timing test measured 107.36 ms against 100 ms; its original Node subshard replay passed 1,044 tests (plus2 skips), with requests 25.98/16.50 ms and no assertion changes. Replay is not claimed as a fix. The other root is inherited from main’s b4ae783fbfd2 (feat: connect Agents API sessions to HTTP MCP servers #160931): three documented callable SDK exports raised actual counts to 4594/2698 while budgets remain 4591/2695. The PR head passes all10 SDK tests; the exact CI main baseline reproduces the mismatch. A two-number correction passes all 10 tests on the CI baseline and current main 52992fb086a7, and fresh review is clean; the budget correction subsequently landed on main as a49e76e18625 and is included in the refreshed base. No CI rerun has been used.
  • ClawSweeper completed review for the earlier head 10e831d58093 at 2026-09-29T07:45:00.670Z. Its failed CI and completed review are retained here as historical evidence.

Full core lint also reported five inherited line-count warnings in files unchanged by this PR: draft-submission-flow.test.ts, sessions.dispatch.device.test.ts, talk/relay/session-create.ts, node-worker-supervisor.ts, and openai-responses-stream-internal.ts. Its two PR-caused errors were repaired and verified with targeted typed lint.

ClawSweeper review response: allowed family delivery and cross-tree denial are exercised through the real node-origin generic transport and verified in canonical target histories. Revocation during asynchronous transcript preparation is deterministic boundary proof using the real session loop and SQLite transcript, with no accepted message or persisted input from the revoked sender. This is not claimed as a live revocation-race trace. The published-node-host upgrade run has not been performed: node-host/supervisor code and bundle admission are unchanged; admission.ts already requires the exact Gateway bundle/version/features, and worker-tool-authority.ts still intersects the catalog with the node’s declared launch names. The new feature belongs to that current worker bundle, not a new node-host protocol. These source contracts and focused sibling tests support the unchanged upgrade boundary; no published-driver proof is claimed. No config option, SQLite schema, stored journal shape, retention, or permission grant changes. Protocol wire schemas are not database schemas.

Live proof uses isolated loopback node hosts on a disposable AWS lease, not physical-device or wide-area-network proof. No baselines, ignores, limits, or assertions were weakened.

Measured cost of changed test files

The new sender test includes cold worker compilation and real session-loop/SQLite transcript preparation; its test bodies take about five seconds. A mock queue would not prove the final enqueue/persisted-transcript boundary.

Single-file measurements use pnpm test <file> --maxWorkers=1 on the isolated 32-core Linux lease. The two new regression costs are from this refresh. Earlier per-file measurements are retained for cost context; the aggregate verification above covers the candidate. Longer inherited integration suites cover real admission, SQLite workers, replay, and process cleanup. The added warm-turn case takes about 0.3 s and uses deferred events, without new timers or polling.

Test file Tests Wall seconds
src/agents/embedded-agent-runner/run.prepared-harness-source-delivery.integration.test.ts 10 60.08 wall / 28.18 Vitest; full host-tool/provenance/dispatch composition
src/gateway/server-import-boundary.test.ts 11 18.56 after fix; single-file pnpm test with --maxWorkers=1
src/agents/openclaw-tools.media-workspace.test.ts 9 48.92
src/agents/tools/openclaw-tools.spawn-session-key.test.ts 7 15.59
src/gateway/github-personal-publication.test.ts 51 146.01 before fix; included in 150.75 s affected run after fix
test/scripts/ci-node-worker-owner-boundary.test.ts 6 3.90
packages/gateway-protocol/src/worker-session-tools-compat.test.ts 1 4.18
src/agents/tools/sessions-send-tool.queue-authority.test.ts 3 58.02
packages/gateway-protocol/src/schema/worker-admission.test.ts 40 3.15
packages/gateway-protocol/src/schema/worker-gateway-tool.test.ts 3 2.84
src/agents/agent-tools.prepared-surface.test.ts 2 39.73
src/agents/apply-patch.operator-hint.test.ts 12 34.71
src/agents/conversation-capability-profile.test.ts 23 16.30
src/agents/embedded-agent-runner/run.overflow-compaction.loop.test.ts 27 41.37
src/agents/prepared-tool-surface.test.ts 14 13.49
src/agents/tools-effective-inventory.policy.test.ts 11 15.99
src/agents/tools-effective-inventory.test.ts 21 14.86
src/agents/tools-effective-mcp-inventory.test.ts 1 3.18
src/agents/tools/scoped-session-access.test.ts 1 13.47
src/gateway/github-repository-publication-restart.test.ts 7 53.13
src/gateway/portals/portal-service.test.ts 22 11.18
src/gateway/server-methods/portals.session.test.ts 11 14.30
src/gateway/server-worker-environment-startup.lazy.test.ts 4 25.77
src/gateway/server.placement-abandonment.test.ts 3 46.36
src/gateway/server/ws-connection/message-handler.worker.test.ts 38 18.17
src/gateway/server/ws-connection/worker-connection.gateway-tools.test.ts 6 11.40
src/gateway/skill-library-authoring.test.ts 7 15.63
src/gateway/worker-environments/computer-transport.connection.test.ts 5 17.65
src/gateway/worker-environments/placement-abandon-lifecycle.test.ts 9 32.17
src/gateway/worker-environments/placement-dispatch-continuity.test.ts 6 22.65
src/gateway/worker-environments/placement-dispatch-staged-results.test.ts 20 53.38
src/gateway/worker-environments/placement-dispatch.test.ts 47 67.47
src/gateway/worker-environments/placement-force-abandon.test.ts 5 15.30
src/gateway/worker-environments/placement-move-abandon.test.ts 22 46.25
src/gateway/worker-environments/placement-session-tool-operations.worker.test.ts 5 14.26
src/gateway/worker-environments/placement-store-terminal.test.ts 13 22.40
src/gateway/worker-environments/placement-turn-authority.test.ts 19 39.01
src/gateway/worker-environments/placement-worker-gate.test.ts 22 34.63
src/gateway/worker-environments/provider-runtime-refresh.test.ts 14 38.05
src/gateway/worker-environments/worker-gateway-tool-runtime.test.ts 16 3.81
src/gateway/worker-environments/worker-portal-tool-executor.test.ts 10 26.34
src/gateway/worker-environments/worker-session-tool-executor.send.test.ts 21 33.61
src/gateway/worker-environments/worker-session-tool-executor.test.ts 31 43.58
src/gateway/worker-environments/worker-tool-authority.test.ts 28 13.55
src/gateway/worker-environments/worker-turn-rpc.gateway-tools.test.ts 6 21.60
src/gateway/worker-environments/worker-turn-rpc.test.ts 19 31.41
src/worker/worker-connection.test.ts 32 3.67
src/worker/worker-gateway-tools.test.ts 4 13.08
src/worker/worker.runtime-imports.test.ts 4 12.34
src/worker/worker.runtime.test.ts 81 75.94
src/gateway/worker-environments/worker-turn-execution.test.ts 23 60.72

@clawsweeper

clawsweeper Bot commented Sep 28, 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 app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling extensions: browser size: XL labels Sep 28, 2026
@steipete
steipete marked this pull request as ready for review September 28, 2026 12:25
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 92da8c64608d3d6af5b132c8a7180441f6354521
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/agent-tools.policy.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/server/ws-connection/worker-connection-dispatch.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server/ws-connection/worker-connection.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/worker-environments/placement-turn-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/worker-environments/worker-skill-authoring.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/worker-environments/worker-tool-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 30, 2026, 3:54 AM ET / 07:54 UTC (Revision 27).

ClawSweeper review

What this changes

The branch prepares one Gateway tool policy and catalog for local and node-hosted sessions, routes Gateway-owned tools through a worker transport, and moves durable session-tool operations to the SQLite worker broker.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: current main still has the reported node policy gap. The current head repairs the released decoder compatibility finding from the previous review, and this review found no new actionable defect.

Priority: P0
Reviewed head: 92da8c64608d3d6af5b132c8a7180441f6354521

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong node and authority evidence supports a substantial owner-level repair, with the prior released API defect corrected on this head.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The Gateway-prepared worker catalog and generic tool transport were exercised on an isolated Linux Gateway/node setup: prior-head evidence records node-origin spawn/send and a denied cross-tree send with no target history, while the exact head returned six expected local/node replies. Real session and SQLite coverage checks revoked-sender rejection at final enqueue; the latest changes concern decoders and inventory projection. No stored-data contract change was identified, so data-model compatibility is not applicable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The Gateway-prepared worker catalog and generic tool transport were exercised on an isolated Linux Gateway/node setup: prior-head evidence records node-origin spawn/send and a denied cross-tree send with no target history, while the exact head returned six expected local/node replies. Real session and SQLite coverage checks revoked-sender rejection at final enqueue; the latest changes concern decoders and inventory projection. No stored-data contract change was identified, so data-model compatibility is not applicable.
Evidence reviewed 12 items Current-main gap: Current main constructs node tools with an isolated worker config and empty image-sanitization limits, supporting the reported policy mismatch.
Prepared policy: The proposed Gateway policy resolves filesystem containment, read-only mode, patch availability, model limits, and image sanitization before worker admission.
Live worker authority: The worker RPC validates the attached placement and credential around tool invocation; the issued runtime checks its generation, handle, arguments, and live turn before execution.
Findings None None.
Security None None.

How this fits together

The Gateway receives session turns and configured tool settings, then admits a node worker with an allowed tool catalog. The worker runs local tools or asks the Gateway to run Gateway-owned tools, and the results enter the session transcript.

flowchart LR
  A[Session turn and tool settings] --> B[Gateway prepares tool catalog]
  B --> C[Node worker admission]
  C --> D{Tool owner}
  D --> E[Node-local execution]
  D --> F[Gateway execution with live claim]
  E --> G[Session transcript]
  F --> G
Loading

Before merge

  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test LOC production +4,546/−4,557 (net −11); tests/support +3,617/−1,066 (net +2,551) The transport and authority replacement has no net production growth; the added coverage guards protocol, policy, and final-effect contracts.

Stored data model

Persistent data-model change detected: database schema: packages/gateway-protocol/src/schema/worker-protocol-primitives.ts, database schema: packages/gateway-protocol/src/schema/worker-skill-workshop.ts, serialized state: packages/gateway-protocol/src/schema/worker-protocol-primitives.ts, unknown-data-model-change: packages/gateway-protocol/src/schema/worker-admission.ts, unknown-data-model-change: packages/gateway-protocol/src/schema/worker-gateway-tool.ts, unknown-data-model-change: packages/gateway-protocol/src/schema/worker-inference.ts, and 5 more. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep the Gateway as the tool-policy owner, retain released decoder imports until an announced breaking package release, and use the documented node-host update path for incompatible hosts.

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

Yes, from current-main source: the node worker constructs tools with an isolated config and empty image limits. This read-only review did not run the failing path.

Is this the best way to solve the issue?

Yes. Gateway preparation is the appropriate policy owner, and retaining released decoder imports avoids a package upgrade break.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1caaef4b6f10.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The Gateway-prepared worker catalog and generic tool transport were exercised on an isolated Linux Gateway/node setup: prior-head evidence records node-origin spawn/send and a denied cross-tree send with no target history, while the exact head returned six expected local/node replies. Real session and SQLite coverage checks revoked-sender rejection at final enqueue; the latest changes concern decoders and inventory projection. No stored-data contract change was identified, so data-model compatibility is not applicable.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P0: Current node turns can bypass configured filesystem containment and patch policy, crossing a file-write security boundary.
  • merge-risk: 🚨 compatibility: The published protocol decoder API is upgrade-sensitive; this head retains the released imports while retiring their RPC registration.
  • merge-risk: 🚨 security-boundary: Gateway-issued tool handles cross the node boundary and require live placement, claim, and handle checks before privileged execution.
  • merge-risk: 🚨 availability: Older published node hosts may need an update before OpenClaw sessions resume; the lead accepted this documented tradeoff for the current change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The Gateway-prepared worker catalog and generic tool transport were exercised on an isolated Linux Gateway/node setup: prior-head evidence records node-origin spawn/send and a denied cross-tree send with no target history, while the exact head returned six expected local/node replies. Real session and SQLite coverage checks revoked-sender rejection at final enqueue; the latest changes concern decoders and inventory projection. No stored-data contract change was identified, so data-model compatibility is not applicable.
  • proof: sufficient: Contributor real behavior proof is sufficient. The Gateway-prepared worker catalog and generic tool transport were exercised on an isolated Linux Gateway/node setup: prior-head evidence records node-origin spawn/send and a denied cross-tree send with no target history, while the exact head returned six expected local/node replies. Real session and SQLite coverage checks revoked-sender rejection at final enqueue; the latest changes concern decoders and inventory projection. No stored-data contract change was identified, so data-model compatibility is not applicable.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Devin Robison: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (26 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-30T03:03:53.001Z sha 0e358a54526b5bbe47f2bc7b0d6982569f90385b :: blocked before merge. :: none
  • reviewed 2026-09-30T04:01:22.937Z sha 31eec699c27588069b88d4b422ed65a5b3d602c2 :: blocked before merge. :: none
  • reviewed 2026-09-30T04:20:20.979Z sha 3c200c0 :: blocked before merge. :: none
  • reviewed 2026-09-30T04:37:00.402Z sha 3c200c0 :: blocked before merge. :: none
  • reviewed 2026-09-30T04:48:36.354Z sha 3c200c0 :: blocked before merge. :: none
  • reviewed 2026-09-30T04:55:33.791Z sha 3c200c0 :: blocked before merge. :: none
  • reviewed 2026-09-30T06:05:14.205Z sha 85547eb :: blocked before merge. :: none
  • reviewed 2026-09-30T07:03:50.601Z sha 0fe1ee3 :: blocked before merge. :: [P1] Restore the released worker-presence decoding exports

@steipete
steipete force-pushed the codex/node-parity-p1a-tool-surface branch 2 times, most recently from d5a6343 to 4d4953e Compare September 28, 2026 18:56
@clawsweeper clawsweeper Bot added 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 28, 2026
@steipete
steipete force-pushed the codex/node-parity-p1a-tool-surface branch from 9b809fc to 49a58fd Compare September 28, 2026 21:12
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
@steipete
steipete force-pushed the codex/node-parity-p1a-tool-surface branch from 49a58fd to bc06aa5 Compare September 29, 2026 01:16
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 30, 2026
@steipete
steipete merged commit 10ea473 into main Sep 30, 2026
237 of 238 checks passed
@steipete
steipete deleted the codex/node-parity-p1a-tool-surface branch September 30, 2026 08:14
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 30, 2026
…d pass (#161737)

Third-pass maintainer-requested Gateway cleanup following #159752 and #161284.
Reuse canonical validation, stable bounded sorting and placement matching; consolidate RPC and workspace projections and remove forwarding wrappers.

Preserve protocol, RPC results and errors, live-owner authority, worker lifecycle/fencing and persisted state. No user-visible behavior change is intended. Drop overlaps already landed in #160444, #161085 and #161642.

Validation: independent Codex review clean at P0-P2; both import-cycle checks report zero; lint clean; 401 tests passed across 28 files and five Vitest shards, with one existing opt-in Podman skip. Rebased protocol generation has zero drift and SDK export/surface checks pass. Full source reading covered 645 production files at the starting base.

Hosted CI run 36693161484 executed its build/test lanes. The sole failed test, session-activity-summaries.test.ts relocated-store recovery (expected 2 to be 3), also fails on unrelated PR #161714 head 8080a45, run 36692028664 job 109811633901. The changed RPC/workspace code is outside the failing execution path. Land under the explicitly authorized pre-existing-failure exception; retain this failure for the main-CI coordinator.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
…ssions (openclaw#160444)

* fix(nodes): apply the same tool policy to node sessions as Gateway sessions

Share Gateway tool preparation and resolved filesystem/apply_patch policy with worker turns. Deliver the issued surface during admission and route Gateway-owned tools through one build-gated transport. Move session-tool grants and durable operation journals to the SQLite worker broker while preserving live authority, replay, cancellation, and recovery.

* fix(nodes): repair worker tool surface CI contracts

Keep worker-only schemas outside the operator registry, distinguish worker tool proxies from Gateway executors, and split runtime and receipt contracts from their implementations. Extract coherent source and test siblings without weakening authority checks or removing coverage. Remove unused profile inputs and migrate their internal callers.

Validation: 67 focused test files pass on the isolated Linux lease; core, package, source-test, extension, and UI-test typechecks pass. Protocol generation, export contracts, architecture, formatting, assertion safety, and line-cap checks pass. The changed-set Node matrix has 93 rows against its 130-row cap; aggregate production LOC remains negative.

* refactor(nodes): retire unused worker tool exports

Keep worker protocol primitives, local tool grouping, and the Skill Workshop descriptor private now that shared constructors own their callers. Remove the unused worker session-tool name type; no runtime implementation or public package entry point changes.

Validation: full Knip production and export scans, protocol generation/checks, core and package typechecks, and nine affected test files pass on the isolated Linux lease. The export-only diff passed independent review through P2.

* fix(nodes): preserve authority receivers and async fixture ordering

Bind portal authority methods to their owner, await worker recovery and authorization in affected fixtures, and preserve immutable tool descriptors while projecting tools. Enforce required braces and exhaustive operation handling, remove obsolete policy inputs and duplicate projections, and retire the no-longer-needed max-lines allowance.

Validation: typed lint on all changed files, core and complete source-test typechecks, and 88 focused test files pass on the lease. The portal receiver regression fails against the prior implementation. Independent repair review is clean through P2.

* refactor(agents): colocate configured main-session helpers

Keep configured-main lookup and creation with the existing sessions-send delivery owner after rebasing. Preserve roster, sentinel, optional agent identity, and Cron authority behavior while removing the line-cap growth. The main-key constructor is the same owner called by the previous constant-main adapter.

* test(workers): reuse the shared gateway tool capability

The attached environment fixture already advertises worker-gateway-tools-v1. Appending it again violated the admission schema uniqueItems contract and rejected both queued launches before the browser custody assertions could complete. Remove only the redundant import and entry; keep skill-resource admission and every custody assertion unchanged.

* fix(workers): register tool cancellation before yielding

Admission already prepares and issues the exact tool handles. Consume those validated handles synchronously during invocation so immediate cancellation and close can see the call before it yields. Preserve live authority checks, FIFO barriers, active-call joining, four-call bounds, and cooperative settlement.

The Gateway RPC regression fails on the prior implementation and passes with the fix. All 210 tests in 11 affected files pass; production LOC is unchanged by this repair.

* fix(tooling): include worker tool protocol dependencies in PR wrapper

Keep the trusted wrapper extraction inventory closed over the worker-admission runtime imports by including the worker Gateway-tool schema and its validation-error dependency. Preserve the extracted-context and inventory closure assertions.

* fix(workers): preserve control budgets across mixed-media results

Share encoded frame accounting with transcripts and keep unreadable input rejection inside its owner. Verify fresh catalogs and handles across warm retained turns, preserve current node launch limits, and align the async authority fixture after the main rebase.

* fix(workers): preserve protocol imports and live sender authority

Share canonical session-tool schemas and collapse duplicate tool, receipt, and teardown plumbing. Preserve published 2026.9.6 decoding imports without advertising retired RPCs. Carry sender authority through direct steering to the final enqueue.

* fix(agents): retain the typed tool description projection

* style(workers): retain compact type import layout

* refactor(tools): construct projected tools in a single pass

* fix(workers): preserve acyclic tool and receipt contracts

Keep cross-owner tool and receipt types in leaf modules. Consolidate preparation and live/abort checks without changing validation order, and reuse the canonical timeout and captured caller facts.

* style(workers): distinguish the prepared catalog binding

* fix(workers): project claim data before database dispatch

* refactor(workers): share publication settlement and string normalization

Preserve commit, rollback, invalidation, and tool binding order after main integration. Reuse the canonical string normalization owner and keep the complete production diff net negative.

* test(gateway): track lazy prepared tool construction

* fix(cron): use the prepared capability profile contract

* test(agents): restore real tools in prepared delivery fixture

* fix(protocol): preserve published worker presence decoders

Retain the schemas, types, validator, and feature constant shipped in
@openclaw/gateway-protocol 2026.9.7 as decoding-only APIs. Keep the retired
worker RPC unadvertised and preserve the published error-code schema shape.

Extend the compatibility regression and share static inventory transport
normalization. Production remains net -11 lines against the PR base.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
…d pass (openclaw#161737)

Third-pass maintainer-requested Gateway cleanup following openclaw#159752 and openclaw#161284.
Reuse canonical validation, stable bounded sorting and placement matching; consolidate RPC and workspace projections and remove forwarding wrappers.

Preserve protocol, RPC results and errors, live-owner authority, worker lifecycle/fencing and persisted state. No user-visible behavior change is intended. Drop overlaps already landed in openclaw#160444, openclaw#161085 and openclaw#161642.

Validation: independent Codex review clean at P0-P2; both import-cycle checks report zero; lint clean; 401 tests passed across 28 files and five Vitest shards, with one existing opt-in Podman skip. Rebased protocol generation has zero drift and SDK export/surface checks pass. Full source reading covered 645 production files at the starting base.

Hosted CI run 36693161484 executed its build/test lanes. The sole failed test, session-activity-summaries.test.ts relocated-store recovery (expected 2 to be 3), also fails on unrelated PR openclaw#161714 head 8080a45, run 36692028664 job 109811633901. The changed RPC/workspace code is outside the failing execution path. Land under the explicitly authorized pre-existing-failure exception; retain this failure for the main-CI coordinator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation extensions: browser gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant