Skip to content

fix(ci): session concurrency test flakes during child handshake#99212

Merged
steipete merged 1 commit into
mainfrom
fix/reply-init-concurrency-marker-atomic
Jul 2, 2026
Merged

fix(ci): session concurrency test flakes during child handshake#99212
steipete merged 1 commit into
mainfrom
fix/reply-init-concurrency-marker-atomic

Conversation

@steipete

@steipete steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a CI problem where the reply-session initialization concurrency test could read its child-process JSON readiness marker while that file was only partially written. The same Unexpected end of JSON input failure reproduced across unrelated PRs #95973 and #94385.

Why This Change Was Made

The child now writes each JSON marker to a same-directory temporary path and atomically renames it into place. File existence therefore remains the synchronization signal, but readers can only observe a complete JSON document; product session behavior is unchanged.

User Impact

No product behavior change. Maintainers get a deterministic concurrency test instead of unrelated PRs failing on a marker-file race.

Evidence

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 2, 2026
@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 2, 2026, 3:25 PM ET / 19:25 UTC.

Summary
The branch changes the reply-session concurrency test helper to publish child-process JSON readiness markers via a temporary file followed by rename.

PR surface: Tests +2. Total +2 across 1 file.

Reproducibility: no. deterministic high-confidence reproduction was run in this read-only review. The source race is clear because current main waits for marker existence and immediately parses a file that the child writes directly, and the PR body reports the same JSON parse failure across unrelated CI attempts.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: src/config/sessions/session-accessor.reply-init-concurrency.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • [P1] The protected maintainer label means maintainers should decide merge timing after CI; there is no narrow automated repair to queue.

Security
Cleared: The diff is limited to a test helper and does not add dependencies, permissions, scripts, secrets handling, workflows, or product code execution paths.

Review details

Best possible solution:

Land this exact narrow test-helper fix after required CI and maintainer review; no product/session runtime changes should be added for this flake.

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

No deterministic high-confidence reproduction was run in this read-only review. The source race is clear because current main waits for marker existence and immediately parses a file that the child writes directly, and the PR body reports the same JSON parse failure across unrelated CI attempts.

Is this the best way to solve the issue?

Yes. Publishing the same marker path with a same-directory temp write and rename is the narrowest maintainable fix because it preserves the existing synchronization signal while preventing partial JSON reads.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: The PR fixes a real CI flake affecting unrelated pull requests, but the blast radius is limited to one test helper and no product runtime changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-labeled PR changes only a test harness, so the external contributor real-behavior proof gate is not applied.

Label justifications:

  • P2: The PR fixes a real CI flake affecting unrelated pull requests, but the blast radius is limited to one test helper and no product runtime changes.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-labeled PR changes only a test harness, so the external contributor real-behavior proof gate is not applied.
Evidence reviewed

PR surface:

Tests +2. Total +2 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 4 2 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 4 2 +2

What I checked:

Likely related people:

  • moguangyu5-design: Git blame and PR history show this contributor introduced the cross-process reply-init concurrency test and its direct marker write in the merged identity-fields fix. (role: introduced test helper; confidence: high; commits: 826c84ea1942; files: src/config/sessions/session-accessor.reply-init-concurrency.test.ts, src/config/sessions/session-accessor.test.ts, src/config/sessions/session-accessor.ts)
  • jalehman: PR metadata for the merged source fix shows jalehman authored late session-accessor repair commits and merged the commit that introduced this test. (role: recent area contributor and merger; confidence: high; commits: 61fc7d2ece1a, 826c84ea1942; files: src/config/sessions/session-accessor.ts, src/config/sessions/session-accessor.reply-init-concurrency.test.ts, src/auto-reply/reply/session.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jul 2, 2026
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready at 7eb95f9dbe3dbc9230c6b361e19c25d7b9a97398.

No runtime behavior, docs, or changelog change.

@steipete
steipete merged commit a004e18 into main Jul 2, 2026
134 of 140 checks passed
@steipete
steipete deleted the fix/reply-init-concurrency-marker-atomic branch July 2, 2026 19:30
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 3, 2026
RomneyDa pushed a commit that referenced this pull request Jul 14, 2026
RomneyDa added a commit that referenced this pull request Jul 14, 2026
* test(sessions): publish concurrency markers atomically (#99212)

(cherry picked from commit a004e18)

* chore(release): refresh 2026.6.33 candidate record

---------

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

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

1 participant