Skip to content

fix(update): preserve repair budgets across clock changes - #190064

Merged
roboclaw-bot merged 1 commit into
mainfrom
fix/update-repair-monotonic-185384
Nov 1, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
fix/update-repair-monotonic-185384

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

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 monotonicDeadlineAfter and remainingMonotonicMs helpers 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

  • Regression through runUpdateRepairTurn with 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 main b1615fd4432c5646684fd57d77e16702e35e4a0c: forward = 1 ms; backward = 69,750 ms. Green with the fix.
  • 19 focused runtime/orchestrator tests pass: 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.
  • Targeted type-aware lint, formatting, and git diff --check pass. No broad suite ran on the production host.
  • Exact-head CI passes on 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.
  • The automatic hosted ClawSweeper review of this same head reports no code or security findings; it records the fresh full-product proof gap below as optional.
  • User-selected independent Codex autoreview, P0–P2, covered the final local delta against the base above with existing monotonic helper/test-support context: scoped-clean, no actionable findings. Simplification retains the existing runtime owner.
  • Full installed-CLI/model and published-stable upgrade proofs were not rerun for this clock-only fix. The regression proves the duration passed at the repair runtime boundary, not provider or service behavior.

Credit is retained in the commit for the original PR commit author and steipete.

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]>
@clawsweeper

clawsweeper Bot commented Nov 1, 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.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 1, 2026 03:53
@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. 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. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

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

  • Before: The embedded runner receives a 1 ms timeout.
  • After: The embedded runner receives a 9,750 ms timeout.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-verified; fresh execution evidence covers the runtime boundary rather than the installed product.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored bot PR is outside the ordinary contributor proof gate; its fresh regression exercises the real repair runtime with mocked embedded execution, while the credited original PR supplies historical CLI/provider output for the same clock correction.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A healthy installation-repair turn can receive an almost immediate timeout after a system clock correction.
Reason: The maintainer-authored change restores the existing elapsed-budget contract with minimal production changes and no new product surface.

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
Reviewed head: 9f11c1c3f206f6307cd91e87f310e33e9e763408

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: This head has no fresh installed-CLI clock-jump or published-stable upgrade run; the linked original PR’s CLI trace is historical supporting evidence.
Agent review details

How this fits together

Post-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]
Loading

Technical review

Best 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

  • Repair runtime deadline and embedded timeout keeps the original intent (545089c: The authentication cutover retained bounded post-failure repair, cancellation, authority checks, and supervised cleanup; the changed expressions were carried in that merged repair path.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +1, Tests +25, Other +1. Total +27 across 3 files. Added test files: 0.

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

Root-cause cluster

Relationship: canonical
Canonical: #190064
Summary: This PR explicitly replaces the original runtime-only contribution; a broader open repair includes the same production change and additional deadline owners.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: A system clock correction during repair preparation can prematurely abort a healthy embedded turn; the affected surface is optional installation recovery.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A system clock correction during repair preparation can prematurely abort a healthy embedded turn; the affected surface is optional installation recovery.
  • 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.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Capture a redacted installed-CLI repair trace with a clock jump during runtime preparation to strengthen current-head behavior evidence.

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 November 1, 2026, 12:09 AM ET / 04:09 UTC.

@roboclaw-bot
roboclaw-bot merged commit 381abce into main Nov 1, 2026
212 checks passed
@roboclaw-bot
roboclaw-bot deleted the fix/update-repair-monotonic-185384 branch November 1, 2026 04:18
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

roboclaw-bot added a commit that referenced this pull request Nov 1, 2026
…#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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…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]>
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