Repository navigation
fix(update): preserve repair budgets across clock changes - #190064
Conversation
Use the existing process-local monotonic deadline helpers for the repair turn. Keep the fixed outer abort timer and existing expiry policy. Regress forward and backward wall-clock jumps after 250 ms of preparation. The separate 25-line test allocation covers the bidirectional clock-jump regression through the repair runtime owner. Co-authored-by: SunnyShu <0668000539@local> 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. What this changesUse existing monotonic clock helpers to preserve the repair runtime’s remaining timeout across system clock changes. Example: A 10,000 ms repair budget encounters a 60,000 ms forward clock correction after 250 ms of preparation.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR makes a focused, correct repair to a timeout defect still present on main; no actionable code or security findings were found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherPost-failure triage passes a configured repair budget into the installation repair runtime, which prepares an embedded agent turn and supplies its remaining duration while retaining independent cancellation and resource cleanup. flowchart TD
A[Triage command] --> B[Repair loop]
B --> C[Repair runtime]
D[Monotonic clock helpers] --> C
C --> E[Embedded agent runner]
C --> F[Abort timer and cleanup]
Technical reviewBest possible solution: Keep the existing repair runtime owner and use shared monotonic helpers for both deadline creation and remaining-budget calculation. Do we have a high-confidence way to reproduce the issue? Current main’s two wall-clock reads directly establish the distorted timeout path, and the supplied regression records the expected base failures; this read-only review ran no target code. Is this the best way to solve the issue? This is the smallest complete fix for the stated per-turn runtime defect: reuse the existing clock owner, retain expiry policy, and cover forward and backward corrections without adding production machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 89bd264595be. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +1, Tests +25, Other +1. Total +27 across 3 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 1, 2026, 12:09 AM ET / 04:09 UTC. |
|
Merged via squash.
|
…#190298) Complete the repair clock-domain correction after #190064: use the existing shared monotonic clock for loop, inference-probe, and delegated-worker budgets and elapsed attempt durations. Preserve budget defaults, cancellation, live authority checks, IPC durations, and absolute timestamps. Adapted from SunnyShu0925's #186818 after reviewing its complete diff and reviews. Forward/backward clock-jump regressions fail on the original owners and pass with the fix. Allocate 106 regression lines because the three owners independently seed and consume their budgets and need distinct boundary proof. Focused repair and consumer tests pass, and local autoreview found no P0-P2 issues. Live Gateway and stable-upgrade execution were outside the task's production-host constraint. Also remove two redundant default void type arguments in an unchanged test to repair the inherited core-lint failure exposed by this PR's CI. Focused lint, all 19 tests in that file, and independent review pass. Co-authored-by: SunnyShu0925 <[email protected]> Co-authored-by: steipete <[email protected]>
…90064) Preserve the update-repair turn's elapsed budget across wall-clock corrections using the existing monotonic deadline helpers. Keep the fixed outer abort timer and expiry policy. Supersedes openclaw#185384 with thanks to SunnyShu0925. The regression proves both wall-clock directions fail on main and pass after the fix; 19 focused runtime/orchestrator tests pass. The separate 25-line test allocation covers the bidirectional clock-jump regression at the repair runtime boundary. Co-authored-by: SunnyShu <[email protected]> Co-authored-by: steipete <[email protected]>
…openclaw#190298) Complete the repair clock-domain correction after openclaw#190064: use the existing shared monotonic clock for loop, inference-probe, and delegated-worker budgets and elapsed attempt durations. Preserve budget defaults, cancellation, live authority checks, IPC durations, and absolute timestamps. Adapted from SunnyShu0925's openclaw#186818 after reviewing its complete diff and reviews. Forward/backward clock-jump regressions fail on the original owners and pass with the fix. Allocate 106 regression lines because the three owners independently seed and consume their budgets and need distinct boundary proof. Focused repair and consumer tests pass, and local autoreview found no P0-P2 issues. Live Gateway and stable-upgrade execution were outside the task's production-host constraint. Also remove two redundant default void type arguments in an unchanged test to repair the inherited core-lint failure exposed by this PR's CI. Focused lint, all 19 tests in that file, and independent review pass. Co-authored-by: SunnyShu0925 <[email protected]> Co-authored-by: steipete <[email protected]>
Supersedes #185384, with thanks to @SunnyShu0925.
What Problem This Solves
Installation-repair agent turns can receive a 1 ms timeout or an inflated timeout when the system clock changes during preparation.
User Impact
Repair turns keep their configured elapsed-time budget across forward and backward wall-clock corrections. The invoking repair runtime must contain the fix; an older updater does not gain it from a candidate it has not started.
Why This Change Was Made
Use the existing
monotonicDeadlineAfterandremainingMonotonicMshelpers for the process-local per-turn deadline. The existing fixed abort timer, expiry clamp, authority checks, and cleanup retain their current behavior.Smallest scope: +3/-2 production lines, 25 regression lines, and a separate 25-line test allocation for this regression. No new clock owner, configuration, storage, or migration.
Evidence
runUpdateRepairTurnwith isolated state and a mocked embedded transport: after 250 ms of preparation, a 10,000 ms budget must pass 9,750 ms even when wall time jumps ±60,000 ms. Red on mainb1615fd4432c5646684fd57d77e16702e35e4a0c: forward = 1 ms; backward = 69,750 ms. Green with the fix.timeout 180s node scripts/run-vitest.mjs src/infra/update-repair-agent.runtime.test.ts src/infra/update-repair-agent.test.ts --maxWorkers=1. Vitest wall time 35.13 s, wrapper 37.33 s, including 29.27 s cold worker preparation. Runtime tests take 1.33 s; the new two cases take 229 ms combined.git diff --checkpass. No broad suite ran on the production host.9f11c1c3f206f6307cd91e87f310e33e9e763408: all 37 selected CI jobs passed, including production/test typing, lint, affected tests, prompt/architecture guards, PostgreSQL conformance, and the aggregate gate. The run took 23m09s. Intentionally skipped lanes are not counted as passed. Security-sensitive/dependency review and the separate CI gate status also pass.scoped-clean, no actionable findings. Simplification retains the existing runtime owner.Credit is retained in the commit for the original PR commit author and steipete.