Skip to content

test(cli): make recovery output deadline deterministic - #160235

Closed
steipete wants to merge 1 commit into
mainfrom
deslop/l136-update-clock
Closed

steipete wants to merge 1 commit into
mainfrom
deslop/l136-update-clock

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The update repair process-output test intermittently records a port-inspection timeout instead of the intended managed-service timeout, failing otherwise unrelated PRs.

User Impact

No production behavior changes. The fixture keeps real service/port observations and their full budgets, then advances time at the polling boundary that this output case intends to exercise. Existing exact output, exit-status, recovery-ledger, and failure-report assertions remain unchanged.

Why This Change Was Made

The fixture added simulated 500ms polling ticks to a real clock. Native inspection also consumed real time, so a final inspection could start with only a fractional deadline remaining and produce a different diagnostic under load. The fixture now records each real restart deadline by its signal and exhausts that deadline when the first completed observation reaches polling. Only the doctor-error scenario registers these deadlines; production deadline, cancellation, cleanup, and classification logic remains real.

Found while validating #160038. This is a separate fixture repair so the provider refactor can be reviewed independently.

Evidence

  • Original failure: CI 36378588067, job 108791294729, update repair process output > doctor-error preserves the output and exit contract. Expected the managed-service timeout detail; received Gateway restart observation timed out during health-wait:port-inspection.
  • Managed Codex review: no actionable P0–P2 findings.
  • Linux Blacksmith Testbox tbx_01m3kcbncar29q72a7qqen8wa6: all 20 complete process-output repetitions passed (360 cases), followed by three original 15-file shard repetitions (400 passed, 7 existing skips each). Deadline/output siblings also passed. The frozen-baseline changed check reached an unrelated duplicate dataImageClipboardFile export in the UI; main fixed it in bb05e779e2a, already included in the rebased stack. Final combined checks passed on fresh Testbox tbx_01m3khbkk3wff7b31bs9c7xwc2 (tree 38bd681eb276934b98741820e8c78e870f75c299); the lease was stopped. The original unmodified shard passed this replay; the earlier CI failure remains the observed intermittent reproduction.
  • Test cost: pnpm test src/cli/update-finalization-output.process.test.ts --maxWorkers=1 took a median 82.35s wall across 20 runs (range 76.08–99.18s; initial run 97.39s). This existing process suite verifies complete CLI stdout/stderr, exit, subprocess cleanup, and durable failure records; no test cases or process boots were added.
  • Prior head 345e04d8e22ec3614d980f195dbda850b80ec514 passed CI 36390412255. Current head 9aec913af5245579b06f9d61b47a3e39f7e785ee rebases the identical fixture patch onto current main, including the existing UI, reliability-export, and Node-selection repairs; current-head CI 36396359192 passed. The combined current-tree Testbox run passed all 18 process-output cases again, the full changed check, build, and SDK checks.

The temporary test-import PR was closed unmerged after main restored the export in da2efd83b8a. Its edits are absent here. The separate convergence fixture failure is fixed on this base by 8b549de1e0c; no additional repair was needed.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS labels Sep 28, 2026
@steipete
steipete marked this pull request as ready for review September 28, 2026 07:12
@clawsweeper

clawsweeper Bot commented Sep 28, 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 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 6:13 AM ET / 10:13 UTC (Revision 5).

ClawSweeper review

What this changes

The branch changes the update-repair process-test fixture to advance its polling clock to the recorded restart deadline, stabilizing the expected recovery-timeout output.

Merge readiness

⛔ Blocked before merge - 3 items remain

Current main has a separately merged fix for the same flaky process test. This branch conflicts with that fix, and the review state identifies its author as a MEMBER, so explicit maintainer disposition is required before closure.

Priority: P3
Reviewed head: 9aec913af5245579b06f9d61b47a3e39f7e785ee
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The narrow fixture repair has strong repeated process-test evidence, but a merged repair now owns the same failure and conflicts with this branch.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed owner is the CLI process-test fixture. Its Doctor-error scenario was exercised through the update-repair child process on Linux Testbox, with 20 passing complete-suite repetitions and three passing original-shard repetitions reported; exact-head CI also succeeded. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed owner is the CLI process-test fixture. Its Doctor-error scenario was exercised through the update-repair child process on Linux Testbox, with 20 passing complete-suite repetitions and three passing original-shard repetitions reported; exact-head CI also succeeded. No stored-data contract changes.
Evidence reviewed 9 items Introduced fixture change: The pinned PR delta records restart deadlines by signal and advances the fixture clock to a deadline during the Doctor-error recovery poll.
Observable test contract: The Doctor-error process case checks the exact managed-service timeout detail, alongside the failure record and report.
Current-main replacement: Current main exhausts the recovery clock in the first interval and models a slow later port read in the same Doctor-error fixture.
Findings None None.
Security None None.

How this fits together

The CLI process test runs an isolated openclaw update repair command through Doctor failure and Gateway recovery observation. Its fixture controls polling time, then the test checks the resulting CLI output and recorded recovery failure.

flowchart LR
A[Process test scenario] --> B[Update repair CLI]
B --> C[Doctor failure]
C --> D[Gateway recovery observation]
D --> E[Fixture polling clock]
E --> F[CLI output and recovery record]
Loading

Decision needed

Question Recommendation
Should this member-authored, conflicting fixture PR be closed in favor of the merged repair at #160319? Close as superseded: Retain the merged fixture repair and close this branch after confirming it has no distinct behavior to preserve.

Why: The supplied review state marks the author as MEMBER, which prevents automatic closure, and the merged replacement does not formally close this PR.

Before merge

  • Resolve merge risk (P1) - The branch conflicts with the merged repair in the same fixture. A conflict resolution that replaces current main's controlled slow-port regression case would need fresh process-test and shard proof.
  • Complete next step (P2) - A maintainer should confirm the merged repair supersedes this PR and close it, or identify a distinct failure before reconciling the fixture conflict.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Tests +19. Total +19 across 1 file.

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

Review metrics

Metric Value Why it matters
Existing process-suite cost 82.35s median across 20 runs; 0 new cases The PR changes an existing expensive fixture without adding another per-PR process test.

Root-cause cluster

Relationship: superseded
Canonical: #160319
Summary: The merged PR fixes the same Doctor-error fixture timeout; the dependent provider refactor is separate work.

Members:

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

Merge-risk options

Maintainer options:

  1. Retain the merged repair (recommended)
    Close this conflicting branch once a maintainer confirms that current main covers the original CI flake.
  2. Reconcile a proven gap
    If a distinct failure is demonstrated, resolve the fixture conflict and rerun the process case and original shard.

Technical review

Best possible solution:

Keep the merged current-main fixture regression as the single test path and retarget the dependent provider refactor to main; pursue a new fixture change only if a distinct failure remains.

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

No on current main: the earlier CI failure is documented, while the merged replacement reports a controlled pre-fix failure and a passing after-fix process run.

Is this the best way to solve the issue?

No for merging this branch now. The merged fixture repair addresses the same timeout race and includes a deterministic loaded-runner regression case.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against db566b093981; fix evidence: commit ae3c05addca8, main fix timestamp 2026-09-28T09:26:06Z.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a test-fixture reliability repair with no production behavior change, and current main already carries a fix.
  • merge-risk: 🚨 automation: Resolving the conflict in favor of this branch could replace main's deterministic CI regression scenario.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed owner is the CLI process-test fixture. Its Doctor-error scenario was exercised through the update-repair child process on Linux Testbox, with 20 passing complete-suite repetitions and three passing original-shard repetitions reported; exact-head CI also succeeded. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed owner is the CLI process-test fixture. Its Doctor-error scenario was exercised through the update-repair child process on Linux Testbox, with 20 passing complete-suite repetitions and three passing original-shard repetitions reported; exact-head CI also succeeded. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

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

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-28T07:19:23.827Z sha 345e04d :: blocked before merge. :: none
  • reviewed 2026-09-28T08:00:10.613Z sha e52b9fefff2a04172f9d2474b52b6774ff5df6be :: blocked before merge. :: none
  • reviewed 2026-09-28T08:07:14.720Z sha e52b9fefff2a04172f9d2474b52b6774ff5df6be :: blocked before merge. :: none
  • reviewed 2026-09-28T08:23:15.695Z sha 9aec913 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the deslop/l136-update-clock branch from 345e04d to e52b9fe Compare September 28, 2026 07:52
@steipete
steipete changed the base branch from main to deslop/l136-update-cut-exit September 28, 2026 07:52
@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 Sep 28, 2026
@steipete
steipete changed the base branch from deslop/l136-update-cut-exit to main September 28, 2026 08:15
@steipete
steipete force-pushed the deslop/l136-update-clock branch from e52b9fe to 9aec913 Compare September 28, 2026 08:16
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Sep 28, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Closing as superseded by main commit ae3c05a (#160319), which fixes the same recovery polling/native-inspection race. Our fixture variant passed 20 full-file and three original-shard repetitions, but it is no longer needed. Native merge admission detected the conflicting main repair before sending a merge request; this PR was not merged. The provider refactor will retain main's fix and drop this duplicate commit.

@steipete steipete closed this Sep 28, 2026
@RomneyDa
RomneyDa deleted the deslop/l136-update-clock branch October 22, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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