Skip to content

fix(workers): cleanup failures lose their cause after a reply - #137828

Merged
fuller-stack-dev merged 9 commits into
mainfrom
steipete/paired-worker-final-46d1cd
Sep 15, 2026
Merged

fuller-stack-dev merged 9 commits into
mainfrom
steipete/paired-worker-final-46d1cd

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Worker cleanup failures could lose their cause after a saved reply and trigger model fallback that repeats an already-performed action. This fix preserves the acknowledged outcome and prevents that replay. This is the current-source port of Peter Steinberger’s canonical PR; original contributor ancestry is retained. The CLI-result prerequisite #137821 is already merged.

  • Settle computer and browser cleanup before the finishing ACK, retaining primary and secondary causes.
  • Capture and consume the applied/ACKed outcome under the exact live run, claim, credential, and sequence; consume before workspace reconciliation releases that owner.
  • Carry the existing cleanup-owned no-replay fact through the launcher and retain diagnostics if reconciliation also fails. Provider-only failures retain legitimate model fallback.

No schema, protocol, configuration, or dependency change. Current async RPC/live-event, transcript-admission, workspace, credential-rotation, and preview-disabled contracts are preserved.

User impact

An answer already saved in the transcript remains available. Cleanup failure is reported with its bounded, redacted cause instead of a generic worker failure. The turn is not automatically replayed on another model. Earlier input is not undone; inspect the desktop and workspace before manually retrying.

Scope

Related to #135944; split from #136049. This does not implement native close/input/tool lifetime, prompt policy, completion-delivery replay, or Mantis lifecycle changes.

Native proof

Actual separate Node worker process, production Gateway launcher, WebSocket admission/live ACK, inference proxy, transcript owners, outer model-fallback loop, and real exec file append. Model responses are controlled; browser disposal rejection is injected through the existing runtime seam. Browser tooling is not invoked. This is native worker/transport proof, not native browser/computer implementation proof.

Cell Unmodified baseline executions / effects Candidate executions / effects
Clean completion 1 / 1 1 / 1
ACKed browser-cleanup failure 2 / 2 1 / 1
Provider-only rate limit 2 / 0 2 / 0

Baseline: e83fa14, AWS Crabbox run https://crabbox.openclaw.ai/portal/runs/run_9e6fe8b232c2. Historical green: https://crabbox.openclaw.ai/portal/runs/run_5d0559e3f167 on 8ee1aff. Previous-head green: https://crabbox.openclaw.ai/portal/runs/run_7548220d66de on e7d4d8f.

Focused regression with candidate test overlay on unchanged baseline: seven failures, three passes, 65 deliberately filtered cases. The baseline was restored and verified clean afterward. Previous e7 native proof and 198 changed-owner cases passed. Historical source-equivalent adjacent tests, production/test typechecks, full build, independent P0–P2 review and aggregate checks are retained. Native review validates the unchanged worker patch. Current head 770dc2529473e50b10fa0d7c4077cbae30eba2b0 integrates landed #148826/#148831/#149016/#149023/#149038. All17 worker/fixture files remain byte-identical to the previously qualified622 head. It also supplies the existing test auth store to the current runtime reader (one test-only line; six-case red/green). Its 6 thinking and 32 unchanged plugin-inspection tests pass; Prior622 worker proof (three runtime cells and198focused tests), artifact validation and native review passed. Fresh770 worker proof passed: three runtime cells,198focused tests, partition/model guards,28Copilot contracts,6thinking and32inspection cases; source-blind validation and18artifact plus manifest readbacks passed. Exact770 native review validates with zero findings. Exact770 hosted CI passed on attempt2 (including the required aggregate); native preparation passed without changing or pushing the head. Native merge completed as 83c1767446cb101f239cbed430524e2934556ebe; GitHub MERGED state, main ancestry, Peter Steinberger’s author credit, and native non-force PR-worktree cleanup are verified. Original failed attempts and the one diagnosed-failure retry are preserved.

Initial fixture failures and the uncommitted-history ratchet failure are retained in the evidence packet, not counted as product regression proof. Prior PR-body evidence is historical and has not been promoted to current-head proof.

Current proof and release-note context

Verified native proof, source hashes, artifacts, review and gate status.

Production +178/−43 (net +135); tests +800/−8; docs +2. Release impact: preserve actual worker cleanup failures and prevent automatic replay of already-performed actions. No release-owned changelog edit.

Keep captured output, usage, and delivery evidence when native CLI session
continuity cannot be saved or remote computer cleanup fails. Record the
failure at its owner, classify replacement results independently, and prevent
another model attempt from repeating effects. Preserve typed frozen errors
through cleanup, rejecting credential cleanup, and the canonical terminal
outcome rather than reporting a false winning model.

This is the result-finalization prerequisite split from #136049 (paired Mac
cleanup and error preservation), related to #135944 (cleanup hides its cause).
It does not include native input lifecycle changes or complete that issue.

Validation: 565 selected tests passed; the final test-only cleanup was covered
by 77 rerun cases. Completed changed-check component plan, production build,
and fresh isolated Codex autoreview (P0 scoped-clean). Live proof follows on
this exact source before landing.

Production +104; tests +621; docs +2. The added production surface owns retained
results and frozen-error no-replay evidence; terminal projection is simplified.
Drain computer and browser disposal before the worker's finishing ACK.
Preserve primary and secondary cleanup causes rather than replacing them
with terminal assistant text or a generic launcher error.

Capture the applied finishing outcome under its exact operational owner,
claim, credential identity, sequence and ACK predicate. Revalidate after
publication listeners, consume once before reconciliation releases the
owner, and discard retained state on closure or replacement. Keep credential
cleanup rejecting and skill-artifact deletion advisory.

This is the worker-outcome slice of #136049 (paired-computer cleanup and
error preservation), related to #135944 (cleanup hides its native cause).
Depends on #137821 (completed CLI actions replay when session saving fails).
Native input/tool-lifetime changes remain separate.

Validation: 347 tests across 14 integrated suites; actual worker-scoped
changed gate; production build; fresh isolated Codex autoreview, P0 scoped-clean.
The 35-file tested integration matches this publication tree exactly.
Real worker/native failure-path proof is still required before landing.

Worker-only delta: production +124, tests +592, docs +2. Tool disposal is
net-neutral; new lines own exact acknowledged, one-use finishing evidence.
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: L maintainer Maintainer-authored PR labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 8:26 AM ET / 12:26 UTC (Revision 10).

ClawSweeper review

What this changes

Worker turns finish tool cleanup before acknowledgement, retain cleanup errors through workspace reconciliation, and prevent automatic model fallback from repeating completed actions.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: current main still loses acknowledged worker cleanup diagnostics. The reviewed patch has no actionable correctness findings, and the recorded production worker proof supports the repair.

Priority: P1
Reviewed head: 770dc2529473e50b10fa0d7c4077cbae30eba2b0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with strong production-path evidence and meaningful regression coverage; no actionable patch defect was found.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The exact-head AWS evidence exercises the changed worker cleanup and Gateway settlement owners through separate processes, real WebSocket acknowledgements, and file effects: injected cleanup failure retains its cause without replay, while provider-only fallback remains functional.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The exact-head AWS evidence exercises the changed worker cleanup and Gateway settlement owners through separate processes, real WebSocket acknowledgements, and file effects: injected cleanup failure retains its cause without replay, while provider-only fallback remains functional.
Evidence reviewed 9 items Pinned patch and review continuity: The checkout is the pinned head 770dc25. The complete local merge-base delta matches the supplied introduced-file inventory. The previous completed review examined this same head and reported no findings or rank-up moves. Initial and final status were clean; diff whitespace validation passed.
Current main still needs the repair: At fetched main, executeWorkerTurn reconciles the workspace before constructing its failure from the final assistant message; it has no acknowledged finishing-outcome consumption. The merged prerequisite #137821 supplies shared result/fallback machinery but does not implement this worker-specific handoff.
Latest release retains the old failure path: The source at the supplied v2026.9.4 release commit likewise constructs WorkerTurnExecutionError from terminal.message.errorMessage or the generic worker failure at lines 490–492.
Findings None None.
Security None None.

How this fits together

OpenClaw workers execute agent turns on remote machines and send transcripts and lifecycle acknowledgements to the Gateway. The Gateway reconciles workspace changes and decides whether failures permit another model attempt.

flowchart TD
  A[Remote agent turn] --> B[Saved assistant reply]
  B --> C[Computer and browser cleanup]
  C --> D[Gateway finishing acknowledgement]
  D --> E[Current turn outcome]
  E --> F[Workspace reconciliation]
  F --> G[Report retained failure]
  E --> H[Allow provider fallback or stop replay]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +135, Tests +792, Docs +2. Total +929 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 10 178 43 +135
Tests 6 800 8 +792
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 980 51 +929

Review metrics

Metric Value Why it matters
Failure replay control Cleanup failure: 2 executions/2 effects → 1/1; provider-only control: 2/0 unchanged The recorded production-path comparison demonstrates replay prevention without disabling legitimate provider fallback.
Production versus test growth Production net +135 lines; tests net +792 lines Production growth is justified by single-use outcome retention in the existing claim owner; tests exercise ordering, invalidation, and fallback boundaries.

Technical review

Best possible solution:

Keep cleanup settlement and acknowledged failure retention with the existing turn owner, preserving provider-only fallback and saved transcript content.

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

Yes: a saved assistant reply followed by cleanup failure reaches main's transcript-derived generic error path; the recorded baseline worker run also demonstrates duplicate effects. This review did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes: the patch extends the existing cleanup, claim, acknowledgement, and fallback owners without adding parallel state or a new protocol.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The existing worker failure path can hide cleanup errors and repeat actions already performed through model fallback.
  • 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 (linked_artifact): The exact-head AWS evidence exercises the changed worker cleanup and Gateway settlement owners through separate processes, real WebSocket acknowledgements, and file effects: injected cleanup failure retains its cause without replay, while provider-only fallback remains functional.
  • proof: sufficient: Contributor real behavior proof is sufficient. The exact-head AWS evidence exercises the changed worker cleanup and Gateway settlement owners through separate processes, real WebSocket acknowledgements, and file effects: injected cleanup failure retains its cause without replay, while provider-only fallback remains functional.

Evidence

What I checked:

  • Pinned patch and review continuity: The checkout is the pinned head 770dc25. The complete local merge-base delta matches the supplied introduced-file inventory. The previous completed review examined this same head and reported no findings or rank-up moves. Initial and final status were clean; diff whitespace validation passed. (770dc2529473)
  • Current main still needs the repair: At fetched main, executeWorkerTurn reconciles the workspace before constructing its failure from the final assistant message; it has no acknowledged finishing-outcome consumption. The merged prerequisite fix(agents): completed CLI actions replay when session saving fails #137821 supplies shared result/fallback machinery but does not implement this worker-specific handoff. (src/gateway/worker-environments/worker-turn-execution.ts:507, f1957d9ed690)
  • Latest release retains the old failure path: The source at the supplied v2026.9.4 release commit likewise constructs WorkerTurnExecutionError from terminal.message.errorMessage or the generic worker failure at lines 490–492. (src/gateway/worker-environments/worker-turn-execution.ts:490, 3a9d69db306c)
  • Cleanup ordering and replay ownership: disposeTools attempts both cleanups, retains aggregate causes, and records the existing producer-owned fallback stop. Cleanup settles before terminal emission. The launcher consumes that outcome before reconciliation releases the claim; reconciliation errors retain their existing non-replayable error classification. (src/worker/embedded-agent.runtime.ts:263, 770dc2529473)
  • Live claim and acknowledgement checks: Finishing data captures its original owner before buffering, records only after application, and requires matching credentials plus a current ACK predicate at consumption. Claim closure, run closure, abort, lifecycle rotation, and owner replacement invalidate retained readers. This carries failure facts without granting additional tool authority. (src/gateway/worker-environments/placement-turn-claim-events.ts:177, 770dc2529473)
  • Meaningful regression coverage: Introduced tests cover buffered and duplicate finishing events, credential replacement during publication, retained-reader invalidation, combined cleanup/reconciliation failures, and outer fallback with actual file-effect counting. Provider-only failures remain a positive fallback control. Tests were inspected but not executed during this read-only review. (src/gateway/worker-environments/worker-turn-launcher-terminal-results.test.ts:99, 770dc2529473)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • fuller-stack-dev: 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 (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-04T04:13:42.257Z sha c04014c :: blocked before merge. :: none
  • reviewed 2026-09-04T04:38:37.851Z sha c04014c :: blocked before merge. :: none
  • reviewed 2026-09-04T06:04:50.344Z sha c04014c :: blocked before merge. :: none
  • reviewed 2026-09-15T08:48:39.056Z sha 8ee1aff :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T11:14:16.577Z sha e7d4d8f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T11:25:16.739Z sha e7d4d8f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T11:42:35.453Z sha 6229714 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T11:57:39.591Z sha 770dc25 :: needs maintainer review before merge. :: none

steipete added a commit that referenced this pull request Sep 4, 2026
Bind native input and private references to the exact execution UUID and
original live Gateway route. Reuse the canonical invocation cancellation
registry; fence admission, drain work, release only owned input and retire
references before close completes. Wrong or stale closes cannot affect a
successor, and closing an unacquired execution does not fabricate release.

Make HTTP/RPC requests, CLI/MCP captures and Copilot attempts own the tools
they construct through final cleanup. Remove TTL-driven executable tool
recreation and unissued bearer/header authority. Retain cleanup across warm
CLI transfer; construct Copilot through the existing placement-bound host
surface. Keep returned output and cause diagnostics through the shared
result-finalization prerequisite.

Raw clients must reuse their execution UUID and close in finally. Gateway
and Mac companion must be upgraded together for this ownership repair.
No protocol version, schema, dependency, configuration or product timeout
change is introduced. CUA ownership remains separate.

Lifecycle-only split of #136049 (paired Mac cleanup and failure preservation),
related to #135944 (cleanup hides its cause). Depends on #137821 (CLI actions
replay after continuity failure); receipt compatibility is #137755 and
acknowledged worker outcomes are #137828. Already-landed Talk, Android and
sibling reroute changes are not repeated.

Validation: 2277 targeted tests across 75 files plus five doctor-gate tests;
39 checks for the exact 78 non-Swift integrated paths; full package build;
107 Mac owner tests and 1629 shared tests in the isolated Mac VM, no skips;
fresh isolated Codex autoreview, two complete chunks, P0 scoped-clean.
All 98 integrated source files match the tested/reviewed input. Real signed
companion/input proof remains pending; these are not live desktop claims.

Lifecycle-only production +577, tests +2389, test support +358, tooling +24,
docs +40, assertion ratchet -1. Growth supplies exact native-route and
request/capture/attempt lifetime ownership; old parallel lifetime paths
are removed rather than retained as compatibility shims.
Record replay prohibition at the failing tool-cleanup owner and carry that
fact through the existing finishing replayInvalid field. Retain it with
the exact acknowledged turn outcome, then mark the launcher's error before
workspace reconciliation releases the owner. Provider-only failures keep
their existing fallback behavior.

A boundary regression through run entry, placement admission, finishing
acknowledgement and outer model fallback reproduced a second synthetic
effect after cleanup failure. The repaired path executes once and retains
the original cause, including when workspace reconciliation succeeds.

Proof: 125 owner and 285 sibling cases passed, with eight targeted
legitimate-fallback controls and final fixture reruns. Changed checks,
full build and fresh whole-worker-PR P0 autoreview passed. Synthetic
boundary proof is not live native-input proof. No protocol/schema change.

Follow-up to the acknowledged worker-outcome repair in
#137828.
Incremental LOC: production +20, tests +195, docs net zero.
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head c04014cfe817eb8fa175b6ad92cc503a48ab541f repairs a connected gap found after the previous review: acknowledged cleanup failure could still repeat a completed action through outer model fallback when workspace reconciliation succeeded.

The cleanup owner now records the stop, the existing finishing replayInvalid field carries it through terminal merges and the exact ACK owner, and the launcher marks its error before reconciliation releases that owner. No schema/protocol change or blanket worker-error fallback veto. Three pre-fix boundary cases repeated a synthetic effect; the repair executes once, and legitimate provider-only fallback controls still pass.

The updated body records the red-to-green evidence, 125 owner and 285 sibling cases, explicitly filtered fallback controls, final fixture reruns, passing changed checks/build, and a fresh whole-PR P0 autoreview. Cumulative delta is production +144, tests +787, docs +2; the follow-up accounts for +20 production and +195 tests.

This remains a draft, not a landing request. The previous review's prerequisite/retargeting, exact-head CI, and isolated worker/native proof requirements remain open. Synthetic boundary tests do not replace the missing live input proof. The prerequisite's required npm advisory audit is still red after three CI attempts.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 4, 2026
@steipete
steipete force-pushed the steipete/paired-results-46d1cd branch from 41bc333 to c001a35 Compare September 4, 2026 05:33
Base automatically changed from steipete/paired-results-46d1cd to main September 4, 2026 05:57
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Sep 4, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 4, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 15, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 15, 2026 08:32
@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Sep 15, 2026
@fuller-stack-dev

fuller-stack-dev commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Exact-head worker proof and native review

Current head 770dc2529473e50b10fa0d7c4077cbae30eba2b0 integrates canonical Copilot restoration #149038 (80936b0933a1b21bdb6097916cf69035a14dedc8). All 17 previously reviewed worker/fixture files remain byte-identical; Peter Steinberger’s contributor ancestry is preserved. Superseded #149003 is closed, with its branch and qualification evidence retained.

AWS Crabbox cbx_f253471e2189, run_d748beec45ee, worker-proof1153.sh: exit 0. The same actual separate-worker / production-launcher / WebSocket-ACK / transcript / file-effect flow passes on this exact head:

Cell Workers / effects Result
Clean 1 / 1 pass
Cleanup failure after acknowledged reply 1 / 1 original cause retained; unsafe replay stopped
Provider-only rate limit 2 / 0 legitimate fallback preserved

198 focused worker-owner cases, the partition and model-catalog guards, 28 Copilot registry contracts, 6 thinking and 32 plugin-inspection cases pass. The source-blind validator joined raw run/claim/credential/sequence/ACK/process evidence and effect bytes for all three cells. 18 sanitized public artifacts plus the manifest were downloaded and hash-verified.

Current exact-head source hashes, process/ACK projections, effect files, validation, and source-scoped independent review

Native review-init / checkout / artifact validation pass for this head with zero findings. The retained independent review covers the byte-identical worker sources; the completed exact770 ClawSweeper review (11:57 UTC) has no findings or before-merge requests. A GitHub metadata transport failure during initial native setup is preserved; guarded recovery restored source without changes; after a controller timeout, surviving work was reconciled and only the incomplete artifact step was resumed through the emitted native lock-recovery command. All required validation commands passed; the script then exited2 solely on an unsupported trailing summary command (preserved).

Exact-head hosted CI passed on attempt 2, including required openclaw/ci-gate. The first attempt had an unchanged iMessage-fixture timeout and a checkout-infrastructure failure; the isolated exact-head fixture passed, then both failed jobs passed their single retry. No source or timeout changes. All failed/spent attempts remain retained.

Native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 137828 passed, preserving exact head 770dc2529473e50b10fa0d7c4077cbae30eba2b0 and skipping an unnecessary push. Preparation artifacts were downloaded and hash-verified. MERGED as 83c1767446cb101f239cbed430524e2934556ebe at 13:08:13 UTC on 2026-09-15. Native outcome is complete; GitHub/main ancestry and Peter Steinberger’s author credit are verified. Native non-force PR-worktree cleanup completed. Native completion receipt.

Two pre-submission tooling/transport failures are preserved: remote GitHub CLI 2.46 lacked --slurp (repaired with checksum-verified task-local 2.100), then a GitHub metadata read returned HTTP504. Each was reconciled as still OPEN with no surviving merge tools or outcome, then resumed only via its exact native lock-recovery token. No gate was bypassed or source changed.

Proof boundary: controlled model responses and browser-disposal fault seam; not native browser/computer-close implementation or live-provider-authentication proof. Baseline red remains 2 workers / 2 effects; all earlier evidence below is source-scoped.

Earlier-head qualification and preserved regression evidence

Latest head and gates

Current head: 6229714882d4bb7273236ec7503a6db8406a94c6. Main repairs #149016 and #149023 are landed and integrated; #148933 and #148982 are closed predecessors, not pending dependencies. All 16 reviewed worker files remain byte-identical. One additional test-only line supplies the existing deterministic auth store to the actual runtime reader used by the thinking fixture; its six existing assertions failed before and passed after (native fixture proof). No production behavior is added by that CI repair.

Exact-candidate gates passed: 6 thinking cases and the entire unchanged 32-case plugin-inspection file (run). The prior config-observation failure is the intermittent issue instrumented by #148736, not claimed fixed by this PR; its original failure remains retained.

Exact-head native proof passed on AWS Crabbox lease cbx_f253471e2189: clean 1 worker / 1 effect; ACKed browser-disposal failure 1 / 1, real cause retained and no replay; provider-only rate limit 2 / 0, legitimate fallback preserved. 198 focused tests and the partition/model-catalog guards passed.

The proof uses actual separate Node workers, production launcher, WebSocket admission/ACK, inference proxy/transcript owners, outer fallback, and real exec file append. Provider responses and the existing disposal seam are controlled: not native browser/computer-close implementation proof. Source-blind validation independently joins run/claim/credential/sequence/ACK, process lifetime, and retained effect bytes. 19-file evidence manifest — all files and manifest downloaded and hash-verified; signed links expire after seven days, authoritative private raw evidence retained.

Native exact-head review artifacts validate with zero findings. Prior independent review covers all16 unchanged worker files; the one-line auth fixture correction is separately red/green qualified. Fresh ClawSweeper review is running on this exact head.

Remaining gates: hosted exact-head CI, native preparation, and pinned merge. No merge attempt yet. Earlier evidence below remains scoped to its named head.

Earlier-head qualification and original regression evidence

Current-head qualification

Head e7d4d8f2a2e6f02547644fbe5671705cefaba22e integrates repaired main 3c6800b2b1e71206d33f9c228589fc76d0481561. All 16 reviewed files and the complete worker patch are byte-identical to the prior reviewed head; original ancestry and Peter Steinberger’s credit are preserved.

Exact-head native run, AWS Crabbox lease cbx_f253471e2189, Linux c7a.8xlarge:

Cell Worker executions / file effects Outcome
Clean 1 / 1 Normal completion
ACKed browser-disposal failure 1 / 1 Actual cause retained, no replay
Provider-only rate limit 2 / 0 Legitimate fallback retained

Actual separate runWorkerCommand Node workers, production launcher, WebSocket admission/ACK, inference proxy/transcript, outer fallback and real exec file append. Controlled provider and injected existing browser-disposal seam; not native browser/computer-close or input-lifetime proof. All current cells retain raw effect-file bytes. No IAM role, Tailscale, operator state, or unrelated credentials.

Current-head focused owner tests: 198 passed. The previously failing shard boundary and model-catalog test pass with landed #148826 and #148831. Native review artifacts validate with zero source findings; the maintainer workflow permits retaining independent review for a byte-identical mechanical integration.

Source-blind wire/process/ACK/effect validator · source identity · 18-file evidence manifest. Every published artifact and manifest was downloaded and byte-verified; credentials are removed from public projections. Signed artifact links expire after seven days; authoritative raw evidence remains privately retained.

Command: crabbox run --provider aws --id cbx_f253471e2189 --no-sync --no-hydrate --script recovery-proof-1104.sh.

Remaining gates: exact-head hosted CI and native preparation/merge. Current CI’s lint/typecheck failures are the unchanged main duplicate registry keys; canonical #148982 is actively owned by @vincentkoc (coordination and precise failed-UI evidence). #148933 closed unmerged; its repair landed via #148826. No gate is waived, and no merge has been attempted.

Historical baseline and earlier-head proof (preserved; not current-head CI)

Exact-head native red / green proof

Head: 8ee1affb92ba68c45601df765e40ebf349621257. Original canonical ancestry and Peter Steinberger’s credit are preserved.

Cell Unmodified baseline executions / file effects Exact-head executions / file effects
Clean completion 1 / 1 1 / 1
Browser-disposal failure after an answer 2 / 2 1 / 1
Provider-only rate limit 2 / 0 2 / 0

The repaired cleanup failure retains its cause and no-replay fact; the provider-only control still enters legitimate model fallback. Both tool cleanups settle before finishing. The existing claim owner retains only applied/ACKed evidence from the exact live run, claim, credential, and sequence, then consumes it before reconciliation releases custody.

Runtime boundary: actual separate Node worker process using runWorkerCommand, production Gateway launcher, WebSocket admission/live ACK, inference proxy/transcript owners, outer model-fallback runner, and real exec file append. Model responses are controlled; browser disposal rejection is injected through the existing WorkerBrowserRuntime seam. Browser tooling is unused. This is native worker/transport proof, not native browser/computer close or input-lifetime implementation proof.

  • Provider AWS Crabbox, owned lease cbx_16d1a13946e0, Linux c7a.8xlarge. No instance role, Tailscale, operator Gateway/state, or unrelated credentials.
  • Unmodified baseline run, source e83fa14.
  • Exact-head green run, source 8ee1aff.
  • Sanitized artifact manifest — signed links expire after seven days; durable private raw evidence and runnable fixtures are retained in the maintainer packet. All 39 published files and the manifest were read back with matching hashes.
  • Source-blind validation joins raw run/claim/credential/sequence/ACK records and child lifetimes. Exact-head raw effect files are retained. Baseline/precommit file bytes were cleaned after observation; observed counts, successful exec events and process traces remain.
  • Regression on unchanged baseline with candidate test overlay: 7 fail, 3 pass, 65 deliberately filtered; baseline restored clean. Corrected changed-owner runs cover 198 distinct passing cases; adjacent live/RPC guards add 75 passing cases. The first attempt’s two stale-import failures remain recorded.
  • Production/test typechecks and full build passed on identical reviewed source bytes (validation run). Fresh independent P0–P2 review: no actionable findings. Source hashes match before/after commit.

Production LOC: +178/−43 (net +135). Tests: +799/−8. Docs: +2. Growth adds single-use finishing evidence to the existing claim owner and transports the existing cleanup-owned replay stop. No new store, module, schema, protocol, configuration, or dependency.

Provenance: the raw-parent diff for #121475, commit b5d5ec3, adds browser disposal after terminal handling. Author and merger: @steipete; committer: GitHub; automation trigger unknown. Replay was reproduced on the current baseline, not claimed reproduced at that historical commit.

Committed-head aggregate checks passed: run_76e31e93f1db, including lint, schema/storage guards, import cycles and auth guards.

Native proof command: crabbox run --provider aws --id cbx_16d1a13946e0 --no-sync --no-hydrate --script native-exact-head-green.sh; the script pins the full head and runs clean, browser-fault and provider-only cells through node --import ./scripts/tsx.mjs.

Still pending: full exact-head CI, current ClawSweeper disposition, native review artifacts, required preparation, and head-pinned merge. Initial fixture failures and the old-head/uncommitted-history ratchet failure are preserved, not counted as product success.

Hosted CI prerequisite status

Native exact-head review artifacts validated with zero source findings. Hosted CI tested against newer main and failed the unrelated core boundary guard because #148885/#148889 assigned secrets test roots twice. Canonical #148933 is the required repair; its hosted boundary check passed, and independent native red/green proof is recorded in this prerequisite evidence comment. No worker source change is indicated by this failure. Required exact-head CI, native preparation and merge remain pending; no gate is waived.

@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Sep 15, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 15, 2026
@fuller-stack-dev
fuller-stack-dev merged commit 83c1767 into main Sep 15, 2026
350 of 354 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the steipete/paired-worker-final-46d1cd branch September 15, 2026 13:08
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
…aw#137828)

* fix(agents): preserve results when finalization fails

Keep captured output, usage, and delivery evidence when native CLI session
continuity cannot be saved or remote computer cleanup fails. Record the
failure at its owner, classify replacement results independently, and prevent
another model attempt from repeating effects. Preserve typed frozen errors
through cleanup, rejecting credential cleanup, and the canonical terminal
outcome rather than reporting a false winning model.

This is the result-finalization prerequisite split from openclaw#136049 (paired Mac
cleanup and error preservation), related to openclaw#135944 (cleanup hides its cause).
It does not include native input lifecycle changes or complete that issue.

Validation: 565 selected tests passed; the final test-only cleanup was covered
by 77 rerun cases. Completed changed-check component plan, production build,
and fresh isolated Codex autoreview (P0 scoped-clean). Live proof follows on
this exact source before landing.

Production +104; tests +621; docs +2. The added production surface owns retained
results and frozen-error no-replay evidence; terminal projection is simplified.

* fix(workers): retain acknowledged cleanup failures

Drain computer and browser disposal before the worker's finishing ACK.
Preserve primary and secondary cleanup causes rather than replacing them
with terminal assistant text or a generic launcher error.

Capture the applied finishing outcome under its exact operational owner,
claim, credential identity, sequence and ACK predicate. Revalidate after
publication listeners, consume once before reconciliation releases the
owner, and discard retained state on closure or replacement. Keep credential
cleanup rejecting and skill-artifact deletion advisory.

This is the worker-outcome slice of openclaw#136049 (paired-computer cleanup and
error preservation), related to openclaw#135944 (cleanup hides its native cause).
Depends on openclaw#137821 (completed CLI actions replay when session saving fails).
Native input/tool-lifetime changes remain separate.

Validation: 347 tests across 14 integrated suites; actual worker-scoped
changed gate; production build; fresh isolated Codex autoreview, P0 scoped-clean.
The 35-file tested integration matches this publication tree exactly.
Real worker/native failure-path proof is still required before landing.

Worker-only delta: production +124, tests +592, docs +2. Tool disposal is
net-neutral; new lines own exact acknowledged, one-use finishing evidence.

* fix(workers): stop fallback after acknowledged cleanup failures

Record replay prohibition at the failing tool-cleanup owner and carry that
fact through the existing finishing replayInvalid field. Retain it with
the exact acknowledged turn outcome, then mark the launcher's error before
workspace reconciliation releases the owner. Provider-only failures keep
their existing fallback behavior.

A boundary regression through run entry, placement admission, finishing
acknowledgement and outer model fallback reproduced a second synthetic
effect after cleanup failure. The repaired path executes once and retains
the original cause, including when workspace reconciliation succeeds.

Proof: 125 owner and 285 sibling cases passed, with eight targeted
legitimate-fallback controls and final fixture reruns. Changed checks,
full build and fresh whole-worker-PR P0 autoreview passed. Synthetic
boundary proof is not live native-input proof. No protocol/schema change.

Follow-up to the acknowledged worker-outcome repair in
openclaw#137828.
Incremental LOC: production +20, tests +195, docs net zero.

* test(agents): use runtime auth reader in thinking fixture

---------

Co-authored-by: Jason (Json) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

2 participants