Repository navigation
fix(worker): preserve cloud execution and recovery failures - #134200
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
2602754 to
69e7ee9
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 11:31 AM ET / 15:31 UTC. ClawSweeper reviewWhat this changesThis PR freezes changed cloud-worker files before upload, returns allowlisted workspace-validation reasons, distinguishes approval outcomes, and presents execution and recovery failures separately. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open: current main still has the reported worker failure paths, and this maintainer-labeled PR is the linked candidate repair. The introduced OpenClaw changes are coherent on inspection, but the claimed Codex transport boundary could not be directly checked because the required Codex source checkout is unavailable. Priority: P1 Review scores
Verification
How this fits togetherA cloud worker runs an agent turn on a node, then reconciles changed workspace files back through the Gateway. The changed code captures the worker result, validates it at the Gateway, and projects an actionable terminal outcome to the chat caller. flowchart LR
A[Cloud worker turn] --> B[Node approval]
B --> C[Workspace snapshot]
C --> D[Gateway upload validation]
D --> E[Workspace reconciliation]
E --> F[Terminal error projection]
Decision needed
Why: The implementation fixes OpenClaw-owned paths, but the PR's scope argument includes an upstream Codex runtime claim that this review could not inspect directly. Before merge
Agent review detailsSecurityNone. PR surfaceSource +306, Tests +295. Total +601 across 18 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the immutable snapshot and closed error contract, then confirm the Codex transport boundary and exact-head worker behavior before landing. Do we have a high-confidence way to reproduce the issue? No live reproduction was run in this read-only review, but the current-main owner paths and focused regression scenario make the reported behavior source-reproducible with high confidence. Is this the best way to solve the issue? Unclear: the OpenClaw repair is at the correct snapshot, validation, and terminal-projection owners, but the asserted Codex transport boundary remains unverified in this environment. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c884d51b870b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
69e7ee9 to
f4b6af2
Compare
|
Land-ready work completed; current rebased head is
Validation:
ClawSweeper rank-up move applied: direct sibling Codex source inspection confirms Known proof gap: the original historical cloud run is not resumable, so it was not replayed live. Deterministic owner-boundary regressions, exact-head CI, CodeQL, and repository Testbox preparation are green. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
b118744 to
94551a6
Compare
Freeze uploaded workspace bytes before opening the transfer request, preserve safe validation reason codes, and keep execution failures primary when reconciliation also fails. Co-authored-by: Takhoffman <[email protected]> Worked on by: - @Takhoffman
94551a6 to
1867b35
Compare
|
Merged via squash.
|
Freeze uploaded workspace bytes before opening the transfer request, preserve safe validation reason codes, and keep execution failures primary when reconciliation also fails. Co-authored-by: Takhoffman <[email protected]> Worked on by: - @Takhoffman Co-authored-by: roboclaw-bot <[email protected]>
Closes #134199
What Problem This Solves
Fixes an issue where cloud-worker Codex turns could hide an approval timeout behind a generic denial, upload bytes that no longer matched the captured workspace manifest, discard the reason for a reconciliation rejection, and flatten execution plus recovery failures into one ambiguous terminal string.
Why This Change Was Made
The node now freezes changed file bytes into a bounded, private on-disk snapshot before opening the upload request, and the Gateway returns only an allowlisted validation reason. Approval outcomes are actionable and distinct, while terminal reporting preserves the execution error as primary and labels workspace recovery as secondary.
Upstream Codex remains transport-only here:
environment_addforwards OpenClaw's exec-server URL in../codex/codex-rs/app-server/src/request_processors/environment_processor.rs:16, andupsert_environmentestablishes that remote transport in../codex/codex-rs/exec-server/src/environment.rs:457. OpenClaw therefore remains the approval and reconciliation owner.The production delta is +391/-85 (net +306); tests are +294/-12 (net +282). Production growth is the immutable streaming snapshot owner plus a closed, redacted transfer-error contract; it avoids buffering large workspaces in memory and removes the mutable live-file upload path.
User Impact
Operators now see whether a cloud-node approval was denied or expired and what safe class of workspace validation failed. If execution and recovery both fail, the execution cause stays primary and the message explicitly warns that remote changes may not have been applied. Workspace files changed after capture no longer corrupt the upload payload.
Evidence
node scripts/run-vitest.mjs extensions/codex/src/node-exec-server.test.ts src/node-host/node-worker-transfer-client.test.ts src/gateway/worker-environments/node-workspace-transfer-service.test.ts src/gateway/worker-environments/node-workspace-upload-reader.test.ts src/gateway/worker-environments/worker-turn-launcher-failure-recovery.test.ts src/gateway/server-methods/chat.directive-tags.test.ts— 256 passed, 1 platform-specific skip.node scripts/check-changed.mjs— passed all selected core, core-test, plugin, and plugin-test gates..agents/skills/autoreview/scripts/autoreview --mode uncommitted— scoped clean, correctness 0.97.main: 287 focused tests passed across worker transfer, terminal projection, channel recovery, Gateway kernel, and Codex.Known proof gap: the original cloud worker was no longer resumable, so the exact historical run could not be replayed live. Exact-head CI and the repository landing Testbox gate remain required before merge.
Worked on by: