Skip to content

fix(qa): isolate candidate release auth serialization and commit patches atomically - #71

Open
petercheng wants to merge 1 commit into
openclaw:mainfrom
petercheng:fix/qa-rtt-atomic-patch-isolated-serialization
Open

petercheng wants to merge 1 commit into
openclaw:mainfrom
petercheng:fix/qa-rtt-atomic-patch-isolated-serialization

Conversation

@petercheng

Copy link
Copy Markdown

Fixes openclaw/openclaw#119679

Summary

Seeding agents that target candidate release auth runtimes previously swapped OPENCLAW_STATE_DIR on the shared process env across an await boundary, letting concurrent Promise.all seeding observe or clobber each other's state root. The candidate serializer now runs in a one-shot child process whose env carries exactly the seeding agent's state dir; the parent never mutates its own env.

Multi-file patch writes now stage sibling .tmp- files and move them into place with fs.rename, restoring already-moved files (best effort) when a later rename fails and reporting paths that still need manual recovery.

Scope is limited to scripts/patch-openclaw-release-qa-harness.mjs and its test file.

Note on the issue reference

The issue references a Telegram patcher file that is no longer present in this repository (retired; no add/delete history, and scripts/telegram-rtt-workflow-contract.test.mjs asserts the retired helper paths are absent). This change addresses the still-relevant part of the contract: isolated candidate-release auth serialization plus atomic patch commit/rollback.

Testing

  • node --test scripts/*.test.mjs: 204 tests / 201 pass / 0 fail / 3 cancelled (pre-existing wait-for-ready cancellations, unchanged from baseline).
  • Patcher suite: node --test scripts/patch-openclaw-release-qa-harness.test.mjs → 6/6 pass.
  • npm run check passes.
  • Independent harness coverage: two-agent concurrent seeding with separate state dirs (no env leakage, no profile cross-talk); fail-closed runtime contract (missing export name surfaced in the worker error); fault-injected rename failure (already-moved files restored, untouched files intact, no .tmp-* residue, rollback guidance in the error); idempotency (second run reports already patched, artifacts byte-identical).

…hes atomically

Seeding agents that target candidate release auth runtimes previously
swapped OPENCLAW_STATE_DIR on the shared process env across an await
boundary, letting concurrent Promise.all seeding observe or clobber each
other's state root. The candidate serializer now runs in a one-shot child
process whose env carries exactly the seeding agent's state dir; the
parent never mutates its own env.

Multi-file patch writes now stage sibling .tmp- files and move them into
place with fs.rename, restoring already-moved files (best effort) when a
later rename fails and reporting paths that still need manual recovery.

Patched-store assertions and worker merge/replace semantics are covered
by overlapping two-agent seeding, fail-closed runtime contract, and
fault-injected staging/rename rollback tests.

refs openclaw/openclaw#119679

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(qa): make release auth seeding state-explicit and patch writes atomic

2 participants