Skip to content

fix: isolate release QA credentials between concurrent agents - #71

Merged
steipete merged 2 commits into
openclaw:mainfrom
opensourcevalley:fix/qa-rtt-atomic-patch-isolated-serialization
Sep 23, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
opensourcevalley:fix/qa-rtt-atomic-patch-isolated-serialization

Conversation

@petercheng

@petercheng petercheng commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Related: openclaw/openclaw#119679

What Problem This Solves

Fixes concurrent release QA agents writing credentials under another agent’s state directory and prevents failed compatibility patches from leaving a partly updated harness.

User Impact

Release QA seeding preserves the parent environment and isolates each agent’s candidate auth runtime. Failed patch commits attempt to restore the original files, preserve permissions, and identify any files needing manual recovery.

Why This Change Was Made

Candidate runtimes cache paths during import, so temporarily changing the shared environment cannot safely isolate concurrent agents. Each serialization now runs in a bounded child process. File changes are staged in unique sibling directories before replacement; rollback is best effort across the file set, not a filesystem transaction.

Finishes @petercheng’s original fix with subprocess error handling, collision-free staging, preserved file modes, and tests that execute the generated auth writer. Removes the unused in-process runtime loader. The linked issue also mentions a retired Telegram helper; this PR covers the active release QA patcher only.

Evidence

  • The generated-writer regression fails on main because concurrent calls change the parent state directory; it passes with this change.
  • The original PR also fails the new permission/staging regression; the completed patch preserves 0600 and unrelated staging files.
  • Seven focused patcher tests pass, covering isolation, failed contracts, staging/rename failure, rollback, permissions, and idempotence.
  • Independent Codex review of the final staged change found no actionable P0–P2 findings.
  • Remote Linux full gate: all 225 tests passed with zero failures or cancellations; npm run check passed data validation and unchanged README generation.
  • Exact-head Scripts, Actionlint, and CodeQL checks passed at de0d19282803034f3ec22eda536eeea1cce334ca: https://github.com/openclaw/openclaw-rtt/actions/runs/35834657972

liantian and others added 2 commits September 23, 2026 00:49
…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
@steipete
steipete force-pushed the fix/qa-rtt-atomic-patch-isolated-serialization branch from fdb7d73 to de0d192 Compare September 23, 2026 07:59
@steipete steipete changed the title fix(qa): isolate candidate release auth serialization and commit patches atomically fix: isolate release QA credentials between concurrent agents Sep 23, 2026
@steipete
steipete requested review from a team and vincentkoc September 23, 2026 08:16
@steipete
steipete merged commit c072359 into openclaw:main Sep 23, 2026
5 checks passed
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.

3 participants