Skip to content

perf(nodes): finish remote session turns faster when files did not change - #160231

Merged
steipete merged 1 commit into
mainfrom
codex/node-parity-l5-reconcile
Sep 28, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/node-parity-l5-reconcile

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Remote session turns spend hundreds of milliseconds reconciling workspaces even when no files changed.

User Impact

Paired-node and cloud-worker sessions finish unchanged turns sooner. Warm reconciliation fell from 719 / 718 ms in the original baseline to 396 / 397 ms on the same lease (about 45% lower); the final rebased candidate measured 313 / 292 ms on a replacement machine. Changed files retain the full reconciliation and conflict-handling path.

The 150 ms reconciliation target remains unmet. Live measurements cover Linux loopback, not Windows or real network latency.

Why This Change Was Made

The existing finalizer always applied a staged result and repeated its post-apply checks, while node manifest verification started fresh child processes. This change accepts the unchanged path only when both the Gateway and remote workspace match the accepted base. It verifies both sides around quiescence renewal, revalidates live authority before acceptance/publication, and retains journals, durable result refs, cancellation settlement, and recovery behavior.

Manifest capture uses the shared bounded computation owner and the same canonical program used by the standalone transport. Git subprocesses remain host-owned. The unused immediate-apply reconciliation path is removed: repository-wide searches at the original base and rebased main confirmed every production local caller already requests durable staging.

Compatibility: the existing worker.workspace.exec.v1 contract and argv/result formats are unchanged. Resident capture admits only an exact built-in program and validated workspace arguments; other program versions continue through the existing child executor. No new capability, dialect, schema, configuration, or migration is required.

Evidence

Second refresh uses main eed9d9bf225e517e4be07048bb66bec604eb2bb7; one commit, final candidate dba037a3a4f0681d9f80ab21da4caeca6427b8fe. This base contains all six requested main fixes: 136cfdc7a6cf, 6d1826f1ad1f, 7510c4bd5289, d923cd088b8d, ea6bf83e821f, and 6dd3011e9f56. Production LOC versus the merge base is +462 / −462, net 0. No instrumentation is committed.

The initial rebase was patch-identical. Its CI exposed two PR-caused gaps: the newer shutdown recovery fixture still returned the retired reconciliation shape, and inline spread iteration violated lint. The fixture now uses the production staging owner's prepare/apply/publish hooks instead of manually staging, recording, and applying the result. Conflict lifting retains an explicit snapshot, preserving bounded iteration while the conflict set changes. A subsequent CI run found session-delete fixtures failing at the first pre-apply fence instead of their intended post-apply fence. Those existing worker-turn/remote-exec cases and the analogous dispatch case now use the existing third-verification failure hook, with manifest and live-claim assertions added. Recovery assertions were strengthened. Exact byte-estimator formula checks tied to the retired estimator were removed from the publication artifact test; exact Git artifact equality, transfer detachment, caller immutability, and the canonical byte-limit boundary remain asserted. No protocol, authority, or recovery behavior changed in these repairs.

The latest rebase resolved actual merge conflicts while preserving main's shared launcher fixtures and canonical captureWorkspaceManifest naming. The shared unchanged-reconciliation fixture supplies the required publish/discard callbacks once. A redundant private manifest-projection wrapper was removed; all three production callers destructure the existing decoder result with the same expected ref and abort signal. The full post-rebase run exposed a test fixture whose default staging directory was the caller workspace, so cleanup deleted the workspace before verification. The fixture now requires a separate staging directory and both callers provide one.

Validation on the replacement Linux AWS Crabbox lease covers 1,389 passing tests across 38 full files, with one existing Windows-only skip:

  • node scripts/run-vitest.mjs <36 changed and affected test files> plus the repaired full-file recheck: 876 passing tests across 36 files. The initial run exposed the staging-fixture ENOENT described above; after repair, the full node-worker-tunnel.test.ts passed 20 tests / 14.43 s. Retention and unchanged-reconciliation siblings passed 11 tests / 33.85 s; agent-runner-node-authority.test.ts passed 33 tests / 90.33 s. Previously passing files remain unchanged. The skipped case preserves foreign executable modes through Windows workspace transfers; this Linux run is not Windows proof.
  • node scripts/run-vitest.mjs test/scripts/ci-workflow-planning.test.ts test/scripts/ci-workflow-evidence.test.ts: 513 passed / 164.21 s. The existing routing guard's 324 cases also passed in the 36-file run.
  • pnpm tsgo:core: passed, latest 9.10 s incremental after the fixture repair; initial post-rebase run 51.08 s.
  • node scripts/run-tsgo-core-test-shards.mjs --ci-graphs-json '["core-test-gateway-other"]': passed, latest 7.87 s.
  • pnpm tsgo:test:root: all four graphs passed, 210.97 s.
  • node --import ./scripts/tsx.mjs scripts/run-oxlint-shards.mts --files-json '<changed source paths selected by isOxlintSourcePath>': passed / 33.37 s. Tooling tests outside that canonical source inventory are covered by formatting and root test types.
  • pnpm check:workflows: passed / 29.35 s. Scoped pnpm exec oxfmt --check and git diff --check: passed.
  • Independent Codex autoreview of the complete final candidate against the pinned main base through P2: scoped-clean, no actionable findings. The reviewed and committed source trees match exactly.

Fresh instrumented qaRuntime build passed in 56.6 s. Live measure.sh … 3 used a loopback node, a real provider, and openai/gpt-5.6-luna. Warm turns 2 / 3, milliseconds:

Metric Original baseline at 204b00bf083e, 32-core lease Final candidate, replacement 16-vCPU lease
Reconciliation 719 / 718 313 / 292
Node client TTFT 2480 / 2276 2804 / 2432
Node client final 3595 / 3335 3410 / 3076
Node client tail after first delta 1115 / 1059 606 / 644

The fresh local comparator measured TTFT 1409 / 1857 ms and final 1653 / 2827 ms. The original 32-core lease expired and final validation used a 16-vCPU replacement. Hardware, main, and provider timing differ, so these end-to-end numbers are not a controlled attribution of every difference to this PR. Earlier same-machine candidate measurement was 396 / 397 ms reconciliation versus the original 719 / 718 ms baseline. The 150 ms target remains unmet.

Retained earlier proof: a real node file write reconciled byte-for-byte to the Gateway. The real-Gateway browser test pnpm test ui/src/e2e/worker-initial-setup.real-gateway.e2e.test.ts --maxWorkers=1 passed on prior head c306bc689eef (1 test, 173.80 s wall including runtime preparation; case 29.708 s). That browser test was not repeated for these internal repairs. The complete architecture command passed on the previous repaired lease candidate, and the hosted architecture job passed on this refresh's initial CI run.

Review disposition

The prior ClawSweeper P2 asks for another remote/lease fence after unchanged acceptance. Source inspection does not support that as an introduced gap: unchanged acceptance only performs unchanged.verifyLocalStable(), the current-owner assertion, and a synchronous journal commit. It does not apply workspace files. The final tail remains remote verification, local verification, then durable publication, matching the full path after its last renewal. The extra renewal and verification on the full path surround actual awaited workspace application. Existing quiescence heartbeat renewal remains active. Late writes at the final remote/local fences and stale authority are covered by the unchanged-reconciliation tests. This finding is not accepted; the existing final live-authority and durable-result safeguards remain required.

Exact-head CI

The landing refresh rebased the branch without conflicts onto main 4f94275e92cc92dfabe8ce222bd5ca207c16401e, including the bounded Vitest fixture repair 4902e4ae49a6. Published head: 861c439c9f151f27fc0dfcaefa78bef304027775. git range-diff confirms the PR patch is identical to dba037a3a4f0; production/tooling stays +462 / -462, net zero. The existing focused tests, typecheck, live proof, and clean independent autoreview remain prior-head evidence. No fresh local test or live measurement is claimed. The only overlapping staging-owner change on main awaits retained cleanup refs and is disjoint from this PR's preparation/acceptance path. Exact-head CI run 36454487474 completed successfully: 151 successful jobs, 13 skips, no failures or cancellations, including docker-seed-e2e and openclaw/ci-gate (job 109051974936). Required checks report SUCCESS. No rerun or additional source push was needed. ClawSweeper completed this exact head at 17:03:54 UTC on September 28, 2026; its repeated finding is addressed in the review disposition above. Native review artifacts validated READY and GitHub-pending preparation completed at this same head. Landing is being submitted through the native workflow.

Previous-head CI investigation is retained below.

Run 36440583897 is attached to final head dba037a3a4f0681d9f80ab21da4caeca6427b8fe. As of 15:42 UTC on September 28, 2026, it has 77 successful jobs, 1 originating failure, 83 fail-fast cancellations, and 13 skips. The downstream gate (job 109000406618) is still queued for ubuntu-24.04, with no assigned runner and no executed steps; the workflow has no final conclusion yet. Preflight, security-fast, and all five core-lint rows passed. The repository's externally selected github runner override means those lint results validate hosted fallback, not native hybrid allocation. The PR remains open, mergeable, and unmerged.

The sole originating failure is independently reproduced on current main, not caused by this PR. Job 108992030996 (checks-node-compact-small-25) failed two cases in test/scripts/run-vitest-bounded.test.ts: prepares the direct E2E reader generation once: success observed runtime, ai, ai instead of runtime, ai; ...: prebuilt observed ai instead of an empty build list. Its exact checkout was merge 03f7282648d9afe65fdae2fa161d47c352c10190, whose main parent is 741c9cb56bdec3bc62e1ca7594e82b31a0b838e3.

Main commit 9c69495d6f0c added preparePrebuiltAiPackage. At scripts/lib/vitest-build-prerequisites.mts:465–475, missing declarations cause another AI build; the bounded fixture at test/scripts/run-vitest-bounded.test.ts:276–282 only records a successful builder and exits without materializing declarations. Its assertion at line 364 consequently sees the extra build. The preparation owner, runner, and test file match current main and are untouched by this PR.

A clean checkout of current main 1b919d5ee2ec6abe413a4d6c148370d308a4b709 on the Linux lease reproduced the exact same two failures, with 248 passing tests, in 102.40 s wall. Replay used CI=1, four-CPU affinity, NODE_OPTIONS=--max-old-space-size=8192, the unchanged core-tooling-6-hosted-2 group and two-worker group setting from CI, through node --import tsx scripts/ci-run-node-test-shard.mts. The full four-file group was ci-platform-checkout.test.ts, macos-native-test-launch.test.ts, preflight-frozen-target-contracts.test.ts, and run-vitest-bounded.test.ts, all under test/scripts/. No case filters, test edits, retry, timeout changes, or declaration artifacts were used to hide the failure. The latest inspected scheduled-main run preceded the introducing commit and cannot establish this case; the clean-main reproduction supplies independent evidence.

This meets the work order's stopping condition of only documented main-caused failures remaining. The gate is not green, and cancelled jobs remain unverified. No blind rerun or additional push was made. The task-owned replacement lease was released; the native owner confirmed cleanup complete and no remaining resource.

Run 36422187813 tested de6878250b03d35ef21c7f8a58890010f4f7340f and completed cancelled: 122 succeeded, 1 failed, 1 cancelled, 19 skipped. All test jobs passed, including the previously failing publication and requester-wake shards. check-lint-core-2 (job 108932443319) exceeded its 15-minute job limit while processing its final core stripe; it emitted no lint diagnostic. The downstream openclaw/ci-gate (job 108940212387) failed solely because that required job was cancelled. This is not a green gate or a proven inherited-main failure.

The final head contains the bounded capacity repair: retain the existing first-row 16-class route and give the second packed row the same class only for the resolved hybrid backend. Trust, hosted/retry/frozen/manual and RunsOn routing, the 15-minute deadline, coverage, job/registration counts, and max-parallel remain unchanged. The exact earlier CI merge tree 46f86f8e8e84ff18b1d79e95d5c7344ef4a9fcdb passed all packed stripes 3/4/5 with zero warnings/errors in 137.37 s on the lease with four-CPU affinity, a 16-GiB cgroup cap, and the existing larger-runner Go policy. The failed stripe alone passed in 125.00 s with the smaller-runner Go policy; an initial 8-GiB hard-cap experiment OOMed and is not timing proof. Guard, planning/evidence siblings, workflow validation, types, and independent review all passed on the final rebased source. Head 3304094cafee first carried this repair but was conflicting; the current rebase resolved those actual conflicts before publication.

Run 36417798839 tested 6e63119540dd895bcf23c4df7b2b855590a6b13a and ended cancelled after fail-fast: 96 succeeded, 3 failed, 26 cancelled, 19 skipped. Preflight, security-fast, all hosted core test types, repaired core lint, and the previously failing session-lifecycle shard passed. The originating failures were:

  • Job 108913936520, checks-node-changed-compact-large-13: three publication-input cases asserted the retired size-estimator formula (663 / 1506 bytes instead of the generic estimator's 1551 / 2394 bytes). The test-only cleanup above removes these implementation mirrors while retaining artifact, transfer, immutability, and canonical byte-limit contracts; all 17 cases now pass.
  • Job 108913940220, checks-node-changed-1: one requester-wake E2E case, preserves serial continuation without replaying an accepted wave (cli, next child accepted=false, requester final=false), failed with a persisted worker task timed out result. The test, requester-wake lifecycle, worker pool, and session admission owners are byte-identical between the PR and CI's main parent bff74e5f0b6d57d9bb383bbadbfed799bd371af6. Advancing fake time by 151,000 ms across asynchronously launched native work is a plausible cause, not a proven diagnosis. A clean main build and the original first three isolated invocations in order, on two CPUs with CI worker/heap settings, all passed: 1 / 14 / 18 cases, 55.41 / 71.50 / 76.34 s. The same ordered candidate replay also passed: 1 / 14 / 18 cases, 139.69 / 61.51 / 70.77 s. This is unreproduced and not proven fixed or independently failing on main. No timeout, retry, assertion, or runtime behavior was changed to mask it.

The third failed job was the downstream gate. Cancelled jobs remain unverified. Later run 36422187813 passed the requester shard. This does not establish a fix for the earlier timeout; subsequent pushes carried verified source/fixture/capacity repairs rather than a blind retry.

Run 36415467201 tested 43a197f1a0e6457706d9fb68e7497f32da3d4aaa and ended cancelled after fail-fast: 56 succeeded, 2 failed, 66 cancelled, 19 skipped. Preflight, security-fast, and the repaired check-lint-core-1 passed. The sole originating failure was checks-node-changed-compact-large-20, job 108906148608: two session-delete recovery cases expected a retained pending result after injecting failure at the pre-apply fence. Both cases now target the post-apply fence and retain stronger recovery assertions. The downstream gate failed; test types were cancelled, not passing. The pinned base's full main run 36410528009 passed, confirming this fixture migration belongs to the PR. The test-only repair is independently reviewed and verified above; no production changes or new performance run were needed.

Run 36412033041 tested initial refreshed head a42d3e96dbb96c9bafc53b1a284a5f8e9278dbde and ended cancelled after fail-fast: 59 succeeded, 3 failed, 64 cancelled, 19 skipped. Preflight, security-fast, and check-additional-runtime-topology-architecture passed. Originating failures were check-test-types-core-1 (job 108895944187: shutdown fixture missing publishStagedResult / discardPreparedStagedResult) and check-lint-core-1 (job 108895944201: unicorn/no-useless-spread in preflight conflict iteration). The third failure was the downstream openclaw/ci-gate. Both originating defects are repaired and locally verified above. Cancelled jobs are not passing proof; no blind rerun was used.

Previous run 36406651773 ended cancelled after the independently confirmed main ACP mock failure; ea6bf83e821f fixes that source and is included in the current base. Run 36402999792 ended cancelled after the earlier PR type-import cycle; the repaired computation-contract direction passed the complete architecture command and the new hosted architecture job. Run 36392840008 ended cancelled after inherited package-update reliability-export and container-timeout failures, fixed by da2efd83b and 136cfdc7a6cf in the current base.

Measured test costs and retained coverage

Rows retain prior-head measured costs from one standalone pnpm test <file> --maxWorkers=1 invocation on the lease; wall time includes compiler/runner startup and teardown. The shutdown case took 7.535 s. The final post-rebase run revalidated these suites; standalone costs below were collected on the original lease before the last rebase.

Summed test-case execution for the new manifest suite was 0.427 s, unchanged reconciliation 0.929 s, and finalizer 0.062 s; these remain within the 5 s test-time target.

File Tests passed Wall time
src/gateway/worker-environments/workspace-publication-input.test.ts 17 12.76 s
src/gateway/server.sessions.worker-placement-lifecycle.test.ts 31 100.70 s
src/gateway/worker-environments/placement-dispatch.test.ts 47 68.22 s
src/auto-reply/reply/agent-runner-node-authority.test.ts 33 98.55 s
src/gateway/worker-environments/cloud-transcript-write-admission.test.ts 14 47.84 s
src/gateway/worker-environments/node-worker-tunnel.test.ts 20 16.40 s
src/gateway/worker-environments/node-workspace-transfer-retention.test.ts 6 44.99 s
src/gateway/worker-environments/placement-dispatch-reclaim.test.ts 31 42.49 s
src/gateway/worker-environments/placement-dispatch-staged-results.test.ts 18 47.52 s
src/gateway/worker-environments/worker-turn-attachments.boundary.test.ts 2 21.38 s
src/gateway/worker-environments/worker-turn-execution.test.ts 21 53.99 s
src/gateway/worker-environments/worker-turn-launcher-build-recovery.test.ts 31 58.42 s
src/gateway/worker-environments/worker-turn-launcher-claim-admission.test.ts 13 32.75 s
src/gateway/worker-environments/worker-turn-launcher-computer.test.ts 25 64.62 s
src/gateway/worker-environments/worker-turn-launcher-failure-recovery.test.ts 11 45.91 s
src/gateway/worker-environments/worker-turn-launcher-initial-setup.test.ts 17 33.07 s
src/gateway/worker-environments/worker-turn-launcher-media.test.ts 21 56.50 s
src/gateway/worker-environments/worker-turn-launcher-reclaimed-placement.test.ts 12 27.37 s
src/gateway/worker-environments/worker-turn-launcher-reconciliation-authority.test.ts 15 29.86 s
src/gateway/worker-environments/worker-turn-launcher-remote-handoff.test.ts 2 19.38 s
src/gateway/worker-environments/worker-turn-launcher-terminal-results.test.ts 16 59.69 s
src/gateway/worker-environments/worker-turn-launcher.test.ts 32 46.55 s
src/gateway/worker-environments/worker-turn-shutdown.test.ts 1 51.86 s
src/gateway/worker-environments/workspace-finalize.test.ts 9 3.52 s
src/gateway/worker-environments/workspace-local-reconciliation.test.ts 5 11.86 s
src/gateway/worker-environments/workspace-result-finalize.test.ts 11 32.61 s
src/gateway/worker-environments/workspace-result-repository.test.ts 23 89.80 s
src/gateway/worker-environments/workspace-sync-tunnel.git.test.ts 1 18.16 s
src/gateway/worker-environments/workspace-sync-tunnel.memo.test.ts 1 12.55 s
src/gateway/worker-workspace-recovery-binding.test.ts 8 45.14 s
src/node-host/node-worker-workspace-manifest.test.ts 6 13.33 s

Longer existing authority, placement, launcher, and repository suites retain their integration case sets. Their real admission, persistence, rollback, and shutdown interactions cannot be established by the new manifest helper tests. The fixture migrations add required staging hooks rather than new Gateway/process boots, sleeps, polling, or test cases to those suites. Two tests tied solely to the removed unstaged path were deleted. Exact arithmetic checks of the retired estimator were also deleted; the publication artifact and canonical byte-limit assertions remain, and the worker-pool admission tests passed. The new behavior is covered by the focused manifest and unchanged-reconciliation suites plus the finalizer's ordering/error-disposition cases.

Production cleanup keeping this change net neutral
  • Removed the unused immediate-apply branch and finalizer fallback; durable staging is now the sole internal contract.
  • Removed missing-staging/publisher guards made redundant by that required contract.
  • Reused the shared manifest computation adapter instead of a node-specific computation owner.
  • Consolidated duplicate command/result types, byte accounting, transfer cases, and UTF-8 decoding.
  • Removed naming-only manifest wrappers and one-use argument, reporting, encoding, memo, and staged-entry wrappers. The final rebase also removes the private parse projection; its three callers consume the canonical decoder directly.
  • Removed duplicate private argument validation/reconstruction while retaining authenticated argv admission and canonical manifest validation.
  • Removed redundant filtered-path budget checks and the pack-removal helper; candidate admission enforces the same limits.
  • Consolidated final-fence error handling without changing retry versus preserve-result dispositions.
  • Removed duplicated preflight signature declarations; the existing computation contract owns the types. A named snapshot bounds conflict lifting while new ancestor conflicts are added.

@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 size: XL labels Sep 28, 2026
@steipete
steipete marked this pull request as ready for review September 28, 2026 07:05
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 28, 2026, 1:03 PM ET / 17:03 UTC (Revision 18).

ClawSweeper review

What this changes

The branch speeds unchanged remote session turns by skipping workspace application, moves node manifest capture into a resident worker, adjusts a CI lint runner route, and updates tests and documentation.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 6 items remain

The optimization remains useful and is absent from current main. The earlier blocking finding remains on this head: unchanged acceptance occurs after the last remote and lease checks, leaving a window for stale workspace state to reach durable publication.

Priority: P2
Reviewed head: 861c439c9f151f27fc0dfcaefa78bef304027775

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Real performance measurements and broad focused validation support the optimization, but the final authority gap and missing fault-path proof limit readiness.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: The captured PR body reports improved real-provider Linux loopback turns and an earlier byte-for-byte node file write, but no production-path fault trace shows a late writer or lost or reassigned lease being rejected before durable publication. Manifest and journal formats are unchanged, so stored-data migration proof is not applicable. 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.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: The captured PR body reports improved real-provider Linux loopback turns and an earlier byte-for-byte node file write, but no production-path fault trace shows a late writer or lost or reassigned lease being rejected before durable publication. Manifest and journal formats are unchanged, so stored-data migration proof is not applicable. 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.
Evidence reviewed 10 items Introduced finalization gap: The unchanged branch awaits acceptance at line 78 after its last remote verification and lease renewal, then publishes at line 88 without repeating either check.
Acceptance and durable effect: Unchanged acceptance awaits local verification and commits the journal. Publication moves the prepared Git ref to the durable result ref and records it; its current-owner assertion does not renew remote quiescence or recapture remote files.
Remote verification boundary: The remote stability check captures a fresh node manifest and rejects a changed reference; publication does not invoke this check itself.
Findings 1 actionable finding [P2] Recheck the remote lease and manifest after unchanged acceptance
Security Needs attention Stale remote authority before durable publication: If quiescence expires during awaited unchanged acceptance, the Gateway can record the old base as accepted without another remote lease or manifest check.

How this fits together

After a remote session turn, the Gateway compares the node workspace with its last accepted state and records a durable result before settling the turn. The node host captures manifests, while the Gateway manages reconciliation, quiescence, and publication.

flowchart LR
  A[Remote session turn] --> B[Node manifest capture]
  B --> D{Both workspaces match base?}
  C[Gateway workspace] --> D
  D -->|Yes| E[Unchanged acceptance]
  D -->|No| F[Full reconciliation]
  E --> G[Durable result publication]
  F --> G
  H[Quiescence lease] --> G
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: The captured PR body reports improved real-provider Linux loopback turns and an earlier byte-for-byte node file write, but no production-path fault trace shows a late writer or lost or reassigned lease being rejected before durable publication. Manifest and journal formats are unchanged, so stored-data migration proof is not applicable. 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.
  • Recheck the remote lease and manifest after unchanged acceptance (P2) - The fast path awaits local verification and commits the unchanged journal after its last remote and lease checks, then publishes the result. A remote write or lease loss during that interval is not checked by the publication step, which only revalidates the placement owner. Renew quiescence and verify the remote manifest before publication, including a fault injected after acceptance.
  • Resolve security concern: Stale remote authority before durable publication - If quiescence expires during awaited unchanged acceptance, the Gateway can record the old base as accepted without another remote lease or manifest check.
  • Resolve merge risk (P1) - An unchanged turn can publish a durable result after a remote write or lost quiescence lease during awaited acceptance; final-effect fault proof for that interval is absent.
  • Complete next step (P2) - Repair the unchanged final fence and add a redacted production-path trace showing late writes and lease loss or reassignment rejected before durable publication. Redact private endpoints, IP addresses, keys, and phone numbers; update the PR body to trigger re-review, or ask a maintainer to comment @clawsweeper re-review if it does not.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

  • [P2] Recheck the remote lease and manifest after unchanged acceptance — src/gateway/worker-environments/workspace-finalize.ts:77-79
  • [medium] Stale remote authority before durable publication — src/gateway/worker-environments/workspace-finalize.ts:77
Agent review details

Security

Needs attention: The workflow edit adds no supply-chain privilege, but unchanged-result publication can outlive the last verified remote quiescence lease.

PR surface

Source 0, Tests +573, Docs +6, Config 0. Total +579 across 54 files.

View PR surface stats
Area Files Added Removed Net
Source 17 461 461 0
Tests 31 681 108 +573
Docs 5 15 9 +6
Config 1 1 1 0
Generated 0 0 0 0
Other 0 0 0 0
Total 54 1158 579 +579

Review metrics

Metric Value Why it matters
Production and test LOC production/tooling +462/−462; tests/support +681/−108 The production refactor is net neutral while the test surface grows substantially.
Finalization checks unchanged: 2 remote, 1 lease; full apply: 4 remote, 2 lease The reduced checks explain the latency path and identify the authority interval requiring review.

Stored data model

Persistent data-model change detected: serialized state: src/gateway/worker-environments/workspace-result-staging.ts, unknown-data-model-change: src/gateway/worker-environments/workspace-result-staging.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Restore the final authority fence (recommended)
    Renew quiescence and recheck the remote manifest after unchanged acceptance, then prove a late write and lease loss are rejected before durable publication.

Technical review

Best possible solution:

Keep the fast path only when the remote lease and both workspaces remain valid at publication, while preserving durable result recovery when a final check fails.

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

No production fault trace reproduces the late-authority failure. The current-head finalizer and focused test ordering establish a clear source-level path for injecting a write or lease loss after the second remote check.

Is this the best way to solve the issue?

No: skipping application when both workspaces match is a reasonable optimization, but the proposed finalization must revalidate remote state and quiescence after acceptance before publishing.

Full review comments:

  • [P2] Recheck the remote lease and manifest after unchanged acceptance — src/gateway/worker-environments/workspace-finalize.ts:77-79
    The fast path awaits local verification and commits the unchanged journal after its last remote and lease checks, then publishes the result. A remote write or lease loss during that interval is not checked by the publication step, which only revalidates the placement owner. Renew quiescence and verify the remote manifest before publication, including a fault injected after acceptance.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The PR offers a bounded session-latency improvement but has a merge-blocking finalization race.
  • merge-risk: 🚨 session-state: A late remote change can leave the session associated with a stale accepted workspace result.
  • merge-risk: 🚨 security-boundary: The unchanged path consumes quiescence authority before awaited acceptance without checking that authority again at publication.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: The captured PR body reports improved real-provider Linux loopback turns and an earlier byte-for-byte node file write, but no production-path fault trace shows a late writer or lost or reassigned lease being rejected before durable publication. Manifest and journal formats are unchanged, so stored-data migration proof is not applicable. 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.

Evidence

Security concerns:

  • [medium] Stale remote authority before durable publication — src/gateway/worker-environments/workspace-finalize.ts:77
    If quiescence expires during awaited unchanged acceptance, the Gateway can record the old base as accepted without another remote lease or manifest check.
    Confidence: 0.91

What I checked:

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Restore remote and lease verification after unchanged acceptance while preserving recoverable result handling.
  • Add final-effect proof for a late remote writer and lease loss or reassignment before durable publication.

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 (17 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-28T12:39:39.513Z sha de6878250b03d35ef21c7f8a58890010f4f7340f :: needs real behavior proof before merge. :: [P2] Recheck the remote workspace after unchanged acceptance
  • reviewed 2026-09-28T13:10:20.280Z sha de6878250b03d35ef21c7f8a58890010f4f7340f :: needs real behavior proof before merge. :: [P2] Recheck remote lease and manifest after unchanged acceptance
  • reviewed 2026-09-28T14:03:07.841Z sha de6878250b03d35ef21c7f8a58890010f4f7340f :: needs real behavior proof before merge. :: [P2] Recheck remote lease and manifest after unchanged acceptance
  • reviewed 2026-09-28T14:12:15.015Z sha 3304094 :: needs real behavior proof before merge. :: [P2] Recheck the remote lease and manifest after unchanged acceptance
  • reviewed 2026-09-28T14:36:39.156Z sha 3304094 :: needs real behavior proof before merge. :: [P2] Recheck remote state after unchanged acceptance
  • reviewed 2026-09-28T15:18:19.652Z sha dba037a :: needs real behavior proof before merge. :: [P2] Recheck the remote lease and manifest after unchanged acceptance
  • reviewed 2026-09-28T15:42:51.882Z sha dba037a :: needs real behavior proof before merge. :: [P2] Recheck remote lease and manifest after unchanged acceptance
  • reviewed 2026-09-28T15:52:00.428Z sha dba037a :: needs real behavior proof before merge. :: [P2] Recheck the remote lease and manifest after unchanged acceptance

@steipete
steipete force-pushed the codex/node-parity-l5-reconcile branch 2 times, most recently from c306bc6 to 50fb25e Compare September 28, 2026 09:21
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Sep 28, 2026
@steipete
steipete force-pushed the codex/node-parity-l5-reconcile branch 6 times, most recently from de68782 to 3304094 Compare September 28, 2026 14:04
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 28, 2026
@steipete
steipete force-pushed the codex/node-parity-l5-reconcile branch from 3304094 to dba037a Compare September 28, 2026 15:02
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. and removed merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Sep 28, 2026
…ange

Require both workspaces to match the accepted base before skipping apply.
Reuse the shared manifest computation owner while retaining quiescence,
live authority, cancellation settlement, and durable result recovery.
Remove the unused immediate-apply path and consolidate manifest adapters.
@steipete
steipete force-pushed the codex/node-parity-l5-reconcile branch from dba037a to 861c439 Compare September 28, 2026 16:55
@steipete
steipete merged commit 1730d1c into main Sep 28, 2026
239 of 240 checks passed
@steipete
steipete deleted the codex/node-parity-l5-reconcile branch September 28, 2026 17:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…ange (openclaw#160231)

Require both workspaces to match the accepted base before skipping apply.
Reuse the shared manifest computation owner while retaining quiescence,
live authority, cancellation settlement, and durable result recovery.
Remove the unused immediate-apply path and consolidate manifest adapters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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