Repository navigation
test(recovery): await final exhaustion reconciliation - #155007
roboclaw-bot wants to merge 2 commits into
Conversation
Replace one-second state polling in the two final-startup exhaustion tests with the existing root-admission completion boundary. Join every final-target recovery promise before retaining the original row, charge, reservation, call-count, fresh-row and distinct-store assertions. Stop and join recovery before fixture teardown, including cancellation before final reconciliation begins. Keep runtime behavior, schemas, authority, test routing and timeouts unchanged. A temporary controlled 1.5-second startup-admission delay reproduces both original assertions and passes with this fixture repair; diagnostic source was removed and hash-restored before final proof. Focused tests, an eight-file original-plan subset, admission siblings, scoped types/lint/format and independent P2 review pass locally. Node26 proof does not establish the historical hosted Node24 slowdown cause or a full original-shard pass. Related: #154829 Co-authored-by: steipete <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 1:53 PM ET / 17:53 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR moves two startup-recovery tests into a shared harness that waits for final reconciliation and joins recovery before fixture cleanup. Merge readiness✅ Ready for maintainer review The prior extraction concern is resolved, and no actionable correctness defect was found. Current main still uses the vulnerable polling assertions, so this remains a useful, focused test repair. Priority: P3 Review scores
Verification
How this fits togetherStartup recovery resumes interrupted agent sessions and records failure when their retry budget is exhausted. These tests exercise that scheduler against isolated session stores and inspect the resulting records. flowchart TD
A[Interrupted session fixtures] --> B[Startup recovery scheduler]
B --> C[Final retry exhausts budget]
C --> D[Reconcile each affected store]
D --> E[Test harness awaits all targets]
E --> F[Assert final session records]
F --> G[Stop recovery and clean fixtures]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +116. Total +116 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep these exhaustion assertions synchronized with actual recovery completion while preserving the existing scheduler, test registration, and fixture lifecycle. Do we have a high-confidence way to reproduce the issue? Yes, for the test race: current main polls asynchronous final reconciliation with a one-second deadline, and the PR reports a controlled 1.5-second delay reproducing both failures. This review did not execute that reproduction or establish the historical hosted slowdown's cause. Is this the best way to solve the issue? Yes. Observing and joining the existing admission promises fixes the synchronization boundary without increasing timeouts, weakening assertions, or adding a production testing API. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6d65c8b7f229. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Move the two final-startup exhaustion cases and their admission-completion fixture into a coherent sibling test harness. Keep registration at the original position with unchanged case names, all original assertions, shared parent fixtures, and the same database-worker routing. Return the recovery cleanup callback to the parent try/finally teardown so all admitted targets join before stores close, including timeout and cancellation paths. This forward commit extends the exact signed draft head 1a9576c. Measure line-cap and max-lines ratchets against original PR base2559f8f7cc9f1b2f74910915265ccd15d9d6606d; no ratchet, baseline, formatting compression, runtime or timeout exceptions. Preserve original red evidence and rerun extracted controlled-delay/cleanup, focused/full-file, sibling, static and independent P2 proof. Co-authored-by: steipete <[email protected]>
Move only the suspended-exhaustion scenario into the existing broker-backed admission suite. Observe the real reconciliation attempt and stop it while admission remains suspended; preserve durable state and dispatch assertions. Wait for actual approval publication and task-lane completion in the hosted lifecycle fixture instead of polling worker-backed state. Keep the startup fix landed in #155006. Leave the exec/plugin agent-runtime cases to active #154977 and the two other exhaustion cases to #155007. This narrows our bot-owned repair without modifying those owners' PRs. No production changes, deadline increases, retries, or guard weakening. Final three-file proof: 231 tests pass in109.01s; full changed checks pass. Fresh canonical Codex autoreview through P3 is scoped-clean. The original suspended-case failure was reproduced with controlled worker lookup delay; prior admission proof includes20 repeated suite runs. Temporary delay instrumentation is not retained. Earlier broader-head CI is historical only. Co-authored-by: VACInc <[email protected]>
|
Closing this supporting repair as superseded by #154995 (5406706) and #155028 (5fbcdaa), both verified on main. The existing recovery fixture now waits for committed failure state in every physical target, handles cancellation/read failures, and joins stop before teardown. Both exhaustion cases retain their final-state, charge/reservation and fresh-row assertions; the suspended-admission case now lives with its broker-backed owner. Keeping this separate admission observer/harness would duplicate that ownership. This PR’s corrected source, passing CI and review remain preserved, but it was not merged: native admission rejected a conflict before dispatch. No merge request was sent, and its operation lock was recovered only after checking process custody. Related Doctor PR #154829 remains open; this closure does not supersede that production fix. No branch was rewritten or deleted. |
Related: #154829
What Problem This Solves
Fixes two startup-recovery tests reading final state before exhaustion reconciliation finishes, while removing the resulting growth from their oversized test file.
User Impact
No production behavior changes. The tests wait for real admitted recovery and join it before teardown. Runtime, schema, authority, retry budgets, timeouts, test routing and ratchet thresholds are unchanged.
Why This Change Was Made
A coherent sibling test harness owns the two exhaustion cases and their transparent admission observer. It joins every final-target promise—not merely startup admission or the first target—and preserves all original assertions, distinct physical stores and the fresh-row sentinel.
The original file registers both cases at their previous position, with unchanged names and ordering, and passes its existing fixtures and mocked runtime. The harness returns its cleanup callback to the parent’s existing try/finally teardown, preserving database cleanup even if stopping rejects. Cancellation still unwinds a pending environment scope. The sibling is not independently discovered as another test file.
Evidence
Signed forward head 0ae7901 preserves the tested tree ef53c1cb27d934e60d50f13786c3d4591990df49 and extends the existing published head 1a9576c. The original PR base remains 2559f8f.
Forward local head:
e1d537d00086fd0d683e9093909b4cec6c7b24afTree:
ef53c1cb27d934e60d50f13786c3d4591990df49Exact published parent:
1a9576cb5962a9bd6f4599417f35df8ef44d1ea6Original PR base for both ratchets:
2559f8f7cc9f1b2f74910915265ccd15d9d6606dComposite delta from that original base: two test-only files, +225/-109. The original file shrinks (+18/-109); the new coherent harness has 207 physical lines. No assertion/coverage trimming, formatting compression, suppressions or budget exceptions.
A static extraction audit also confirms identical registration sequence/names and all four original matcher assertions in each case. The full file is expensive because its existing 218-case recovery coverage is preserved; extraction adds no tests, process boots or worker routing.
Retained failures and limits: the previous inline repair failed line-cap (6045 → 6097 counted lines); that omission is now addressed against the original base, not only the new parent. An initial review correctly flagged the still-old index while the working tree contained the extraction. Both validated files were staged, both staged ratchets passed, and the actual proposed index received a fresh clean P2 review.
The earlier original-red comparison (two expected failures, 35.36s) is reused as historical evidence. Controlled delay and cleanup proof were rerun after extraction; all instrumentation was removed and both source hashes restored before final proof/review/commit. This proves the polling vulnerability, not the historical hosted slowdown’s exact cause.
Local Node26.8.2 differs from hosted24.19.0. No full original54-file green or hosted CI claim: the parent’s prior full-plan replay stopped on independently identified loopback npm E502/secret-egress refusals and was not repeated or bypassed. An over-broad type selection was cancelled; its task-owned stale lock was recovered only after documented owner/descendant settlement checks, then the sole consumer’s transitive graph passed. All original receipts remain retained.
Exact-published-head hosted CI, current review and native landing remain required; no hosted-green or release qualification claim is made.
Worked on by
Work sessions
View the OpenClaw team session