Skip to content

fix: keep restart recovery validation stable under load - #163606

Merged
RomneyDa merged 1 commit into
release/2026.9.8from
fix/release-2026.9.8-main-session-recovery
Oct 2, 2026
Merged

RomneyDa merged 1 commit into
release/2026.9.8from
fix/release-2026.9.8-main-session-recovery

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 2, 2026

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: restart-recovery validation can fail under a loaded CI shard even when recovery admission succeeds after the test's fixed one-second polling window.

User Impact

User impact: no user-visible behavior changes; release validation now waits on the recovery owner's persisted admission boundary instead of wall-clock timing.

Why This Change Was Made

The isolated recovery case passes, while the 59-file release shard failed after waitForFast exhausted its fixed one-second window. The test now uses the existing session-change-driven recovery fixture already used by sibling startup-recovery cases, preserving the gateway call and provenance assertions.

Evidence

  • Original failure: checks-node-bundle-infra-small-runtime-12 in run 37012702638, job 110856692678.
  • Focused case: passed; test 2.667s, command 29.04s wall.
  • Full owner file: 222/222 passed; command 241.22s wall.
  • node scripts/check-changed.mjs --base origin/release/2026.9.8 -- src/agents/main-session-recovery/main-session-restart-recovery.test.ts: passed.
  • AutoReview (P0-P2): scoped clean, no findings.

@RomneyDa
RomneyDa marked this pull request as ready for review October 2, 2026 15:33
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Oct 2, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 11:40 AM ET / 15:40 UTC.

ClawSweeper review

What this changes

The PR makes a restart-recovery test wait for persisted recovery admission instead of polling for a Gateway call for one second.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a sound, focused repair for the release branch, with no introduced correctness finding. Current main already uses admission-driven waiting, but that does not make this release-targeted PR unnecessary.

Priority: P3
Reviewed head: 3a70820c6a24aa4b6781db310243e99cc83737e7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, maintainable synchronization repair with preserved assertions and relevant reported validation.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR changes only test synchronization, so external-contributor runtime proof is not required. Reported focused and owner-file runs supplement source review; no production or persisted-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR changes only test synchronization, so external-contributor runtime proof is not required. Reported focused and owner-file runs supplement source review; no production or persisted-data contract changes.
Evidence reviewed 6 items Pinned introduced change: The sole introduced hunk replaces waitForFast with the existing admission fixture; recovery.stop and the session, provenance, and idempotency assertions remain intact.
Assertions are preserved: The fixture subscribes before reading, observes the same session identity until abortedLastRun becomes false, asserts exactly the expected number of Gateway calls, and removes its subscription. It introduces no retry or increased polling timeout.
Current main and release boundary: Current main uses expectAdmission for the same drain-marked recovery case, with scheduler cleanup owned by its newer fixture. The reviewed branch uses the release branch's existing fixture signature and explicitly stops recovery afterward. Main resemblance establishes the supported approach, not grounds to close this release repair.
Findings None None.
Security None None.

How this fits together

Restart recovery resumes agent sessions interrupted by a Gateway restart. This test feeds an interrupted session into the recovery scheduler and checks that its replacement run retains the correct session and provenance.

flowchart TD
  A[Interrupted session] --> B[Recovery scheduler]
  B --> C[Gateway dispatch]
  C --> D[Persisted recovery admission]
  D --> E[Session change notification]
  E --> F[Call and provenance assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests 0. Total 0 across 1 file.

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

Review metrics

None.

Technical review

Best possible solution:

Use the release branch's existing admission fixture while retaining exact Gateway-call, session, and provenance checks.

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

Yes, source establishes the timing-sensitive path: waitForFast allows only one second for asynchronous recovery. The body records a loaded-shard failure; this review did not reproduce it by execution.

Is this the best way to solve the issue?

Yes. Waiting on the existing persisted-admission fixture removes the arbitrary polling window while preserving the exact call-count assertion and downstream recovery checks.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This repairs test synchronization without changing production recovery behavior.
  • 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: This MEMBER-authored PR changes only test synchronization, so external-contributor runtime proof is not required. Reported focused and owner-file runs supplement source review; no production or persisted-data contract changes.

Label justifications:

  • P3: This repairs test synchronization without changing production recovery behavior.
  • 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: This MEMBER-authored PR changes only test synchronization, so external-contributor runtime proof is not required. Reported focused and owner-file runs supplement source review; no production or persisted-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The sole introduced hunk replaces waitForFast with the existing admission fixture; recovery.stop and the session, provenance, and idempotency assertions remain intact. (src/agents/main-session-recovery/main-session-restart-recovery.test.ts:1518, 3a70820c6a24)
  • Assertions are preserved: The fixture subscribes before reading, observes the same session identity until abortedLastRun becomes false, asserts exactly the expected number of Gateway calls, and removes its subscription. It introduces no retry or increased polling timeout. (src/agents/main-session-recovery/main-session-recovery-runtime.test-support.ts:60, 3a70820c6a24)
  • Current main and release boundary: Current main uses expectAdmission for the same drain-marked recovery case, with scheduler cleanup owned by its newer fixture. The reviewed branch uses the release branch's existing fixture signature and explicitly stops recovery afterward. Main resemblance establishes the supported approach, not grounds to close this release repair. (src/agents/main-session-recovery/main-session-restart-recovery.test.ts:1360, eb50c3a61b81)
  • Verified live PR target: GitHub REST confirms the PR remains open and unmerged, targets release/2026.9.8, retains the pinned head, and has MEMBER author association, which prevents automatic cleanup closure. (3a70820c6a24)
  • Recorded validation: The captured PR body reports the original loaded-shard failure, a passing focused case (2.667 seconds test time), 222/222 passing owner-file tests (241.22 seconds command wall), and a passing changed-file check. These are author-reported results; this read-only review did not execute tests. The independent diff whitespace check passed. (3a70820c6a24)
  • Area-history routing: Available current-main logs repeatedly identify Peter Steinberger on recovery tests and fixtures. Deeper blame and historical blob inspection encountered unavailable-object fetch failures, so no source-line introduction attribution is claimed. (src/agents/main-session-recovery/main-session-recovery-runtime.test-support.ts, eb50c3a61b81)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

@RomneyDa
RomneyDa merged commit bd595a0 into release/2026.9.8 Oct 2, 2026
167 checks passed
@RomneyDa
RomneyDa deleted the fix/release-2026.9.8-main-session-recovery branch October 2, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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