Skip to content

fix(test): prevent config CI hangs after cold-read optimization - #186152

Closed
roboclaw-bot wants to merge 4 commits into
mainfrom
openclaw/wild-prawn
Closed

roboclaw-bot wants to merge 4 commits into
mainfrom
openclaw/wild-prawn

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Related: #185955

What Problem This Solves

Fixes: the config CI shard times out when its archive-retirement fixture waits for a raw transcript read to start cold restoration.

User Impact

No production behavior changes. The existing regression again exercises idle archive retirement and cold restoration without hanging the shard. No configuration, schema, migration, or timeout changes are required.

Why This Change Was Made

Raw hydration intentionally reads verified cold archives without restoring them after #185955. Request restoration explicitly, then perform the original read. Preserve both open-scope variants and every existing worker-exit, replacement, lease, snapshot, and cleanup assertion.

Evidence

  • Original failure: main run 40532514201, attempt 1, job 122289584880, head c168d2b0b7fb11f4cd463191a4f508c6775fbc9b. The native case reaches its 120-second test and 180-second hook timeouts before the later 300-second no-output termination.
  • Recovered and replayed the original four-group job input with frozen dependencies and the pinned Bun fork. The same case and watchdog failure reproduced. Passive diagnostics confirmed the history read completes without entering restoration or the mutation gate. The full-job replay used Node 26 orchestration; subsequent focused proof used CI Node 24.22.1 and pinned Bun 1.4.4-canary.1+807211511.
  • Corrected complete archive-session file: 22/22 pass, including both scope variants, with one worker and unchanged ordinary test/hook lifetimes and no-output watchdog. Wrapper wall time: 86.55 seconds, including 36.12 seconds preparing compiled workers; native Vitest duration: 82.89 seconds. CI job cost is not yet available.
  • Targeted agents-sessions typecheck, typed lint, formatting, and git diff --check pass. Reversing only the import and restoration-trigger changes reconstructs the original file byte-for-byte, including all assertions and finally blocks.
  • Local ClawSweeper is unavailable. Context-complete local autoreview using Codex gpt-6.1-sol, P0–P2, reviewed the complete candidate against c168d2b0b7fb11f4cd463191a4f508c6775fbc9b with the full fixture and relevant owners: no actionable findings. Runtime results were author-supplied evidence, not independently executed by the reviewer. A separate read-only source check independently confirmed the intentional read-contract change and the explicit-restoration correction.
  • Tested commit 6ba9861ba12a4111be09c8224d2ade180389fe04 and managed-worktree commit abc57855ad1ebf14ce0ff1f258c58d81713d6281 have the identical complete tree a1c4df6897d9753e0d66fdfe35a46098d71d0fc3. Registered-worktree history was preserved without a reset; only this fixture differs from the verified failing head.
  • Required unused-file scan: production 0 entries; full-tree scan remains failed on six unchanged performance scripts. This is not an aggregate pass. The broad local replay also exposed one unrelated conversation-registry wall-clock assertion and three live-dist fixture refusals caused by a retained host artifact lock; those were not repaired or hidden, and no lock was removed.
  • Direct main submission was rejected as non-fast-forward; no force push or retry was used.

Requested and co-authored by @vincentkoc.

Work sessions

Worked on by

roboclaw-bot and others added 4 commits October 27, 2026 13:11
Refuse the retained post-open validation publication instead of the redundant
schema-open checkpoint intentionally removed by #185760. Keep the during-open
refusal, all four failure rows, real reader barrier, exact refusal count,
physical-owner rejection, and cleanup assertions. Production code is unchanged.

Reproduced scheduled main run 40496973076, attempt 1, job 122165204064 at
8d9d946: 11 passing tests and the same
after-open failure. The final candidate and schema-admission keeper pass all
16 tests in 22.69 seconds wall time. Typed lint, formatting, line ratchets and
independent P0-P2 review pass. The patch adds zero net test lines.

At the tested a4a8f63 base, the full-tree unused-file scan reports eight
untouched scripts; production scan passes and no changed path is reported.
The subsequently incorporated main changes are disjoint from the reviewed
reader, worker, state, transcript, test-runner and dependency inputs.

Work session: https://team.openclaw.ai/chat/roboclaw/~key/dashboard/f2d13397-ed54-4d44-ade1-12b2edc3d0e3

Co-authored-by: vincentkoc <[email protected]>
Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: b4478a06-9f85-4034-aeec-975c3e197b4c
Reconcile the completed worktree with the verified failing main head and preserve its history. Explicitly restore the cold transcript before the lifecycle fixture reads it.

Co-authored-by: vincentkoc <[email protected]>
Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: f37bdf97-875f-4437-ac04-32a29baab130
@clawsweeper

clawsweeper Bot commented Oct 27, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR explicitly restores the cold transcript before reading it in the existing archive-worker retirement test.

Example: The retirement test requests a historical transcript containing three events after the archive worker reaches its five-minute idle deadline.

  • Before: The raw read completes without restoration, leaving the test waiting indefinitely for mutation admission.
  • After: Explicit restoration enters mutation admission, waits for the retiring worker to exit, and returns the three events through its replacement.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct fixture repair supported by production-owner integration evidence and passing targeted CI, with no shipped-entry-point proof required for this test-only change.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored, test-only repair changes the fixture's restoration trigger; supplied evidence reports the original failing shard replay and 22 passing cases using real native workers, while current-head changed-node checks also pass.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: The config CI shard hangs because an archive-retirement regression waits for a mutation that raw transcript reads no longer initiate.
Reason: The maintainer-authored repair restores useful lifecycle coverage while respecting the approved production optimization.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep this useful, maintainer-authored PR open: it repairs an obsolete test trigger while preserving the intentional cold-read behavior and all lifecycle assertions; no actionable patch defect was found.

Priority: P2
Reviewed head: 53b231938dd33e407dda8c881028a515d41c2f96

Before merge

None.

Findings

None.

Agent review details

How this fits together

The archive lifecycle fixture supplies synthetic session state to production cold-storage and archive-worker owners, then checks native worker exit, transcript contents, database leases, and cleanup.

flowchart TD
  A[Archive lifecycle fixture] --> B[Explicit cold restoration]
  B --> C[Existing archive mutation owner]
  C --> D[Retiring worker exits]
  D --> E[Replacement worker restores transcript]
  E --> F[Raw transcript read]
  F --> G[Lifecycle and snapshot assertions]
Loading

Technical review

Best possible solution:

Use the existing explicit restoration owner in this fixture and retain the non-restoring raw-read contract.

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

The current-main fixture awaits mutation admission after a raw read whose owner intentionally performs no restoration; the body reports the matching failing replay, but no target code was executed during this review.

Is this the best way to solve the issue?

The patch is the smallest complete repair: it invokes the existing restoration owner before the original read and preserves both lifecycle variants without weakening assertions or increasing timeouts.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Archive retirement fixture keeps the original intent (fa9ca88: Prove five-minute idle retirement and safe cold restoration with released and retained archive scopes.)
  • Raw transcript read contract keeps the original intent (35494b6: Read verified cold archives directly instead of making read-only probes and raw exports restore resident transcript rows.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced change is confined to the test trigger: The pinned introduction diff adds the existing restoration import and chains the original transcript read after restoration; it changes no assertions, cleanup, production code, or timeouts. (src/config/sessions/session-accessor.sqlite-archive-session.test.ts:360, 53b231938dd3)
  • Intentional read-contract change explains the stale fixture: perf(sessions): avoid cold restores for transcript probes #185955 deliberately removed restoration from full raw hydration; its merged diff removes readRestoredSessionTranscriptInWorker from the raw-events owner, and the hydration worker reads verified cold records directly. (src/config/sessions/session-transcript-events.ts:65, 35494b66324a)
  • Original retirement invariant is retained: fix(sessions): release archive worker memory after idle bursts #183410 introduced both scope variants to verify that restoration waits for native exit, recreates execution, preserves transcript state and leases, and allows the replacement to expire; this PR preserves those checks. (src/config/sessions/session-accessor.sqlite-archive-session.test.ts:295, 83c57bf38402)
  • Fetched main still contains the obsolete trigger: The fixture is unchanged between the failing pinned base and fetched main, so the repair remains necessary on the reviewed main revision. (src/config/sessions/session-accessor.sqlite-archive-session.test.ts:357, 83c57bf38402)
  • Supplied reproduction and exact-head validation: The body reports reproduction of the original shard hang and 22 passing archive-session cases after repair. GitHub confirms the cited original shard failed at the pinned base; current-head changed-node and config-boundary checks pass, with PostgreSQL and baseline checks still running. The original log download redirects to a blocked artifact host, so its timeout trace was not independently inspected. (53b231938dd3)
  • History and repository policy checked: The full root policy, complete changed fixture, restoration and archive-session owners, test guidance, and simplification steps were reviewed; no scoped ancestor policy or maintainer-notes directory exists. Feature history identifies Peter Steinberger as the central archive-reuse and cold-read contributor, with Jason O'Neal contributing native retirement safeguards. Following history eventually reaches an unavailable old object; this does not obscure the relevant changes. (AGENTS.md:1, 53b231938dd3)

Likely related people:

  • Jason O'Neal: Raw commit 8f1f7cf adds src/config/sessions/session-accessor.sqlite-archive-session.test.ts:276 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 8f1f7cf3a86c; files: src/config/sessions/session-accessor.sqlite-archive-session.test.ts)

PR surface

Tests +5. Total +5 across 1 file. Added test files: 0.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Repairs a deterministic CI fixture hang with a narrow test-only change and no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 27, 2026, 1:25 PM ET / 17:25 UTC.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Closing as superseded.

Superseded by #186193. The test explicitly restores the transcript before reading it; existing scope, worker, snapshot and cleanup assertions remain.

This closes the PR without deleting its branch.

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

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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