Repository navigation
fix: avoid false Doctor budget failures on large upgrade fixtures - #167482
Conversation
Measure persisted sessions, transcript events, cron jobs, and enabled plugin roots before the sqlite-volume Doctor pass. Record the computed limit and preserve explicit overrides and frozen extended-stable defaults. Doctor behavior and fs-safe remain unchanged.
|
🦞👀 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 changesThe upgrade test calculates Doctor’s time limit from persisted state size and enabled plugin roots, records the limit, and preserves explicit overrides and frozen-release defaults. Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review This PR provides a useful, bounded correction to release validation that current main still needs. No actionable patch defect was found; the broader Doctor performance work remains separately tracked. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe published-upgrade test installs an official baseline, upgrades it to a candidate package, and verifies that stored conversations, jobs, and plugin state survive. Its second Doctor run checks that repeating repairs preserves state and finishes within a calibrated time limit. flowchart TD
A[Published baseline and candidate package] --> B[Upgrade and preservation checks]
B --> C[Count stored records and enabled plugin roots]
C --> D[Calculate limit or use explicit override]
D --> E[Run Doctor with independent watchdog]
E --> F[Check elapsed time and preserved state]
F --> G[Publish budget and upgrade results]
Technical reviewBest possible solution: Keep the state-derived validation limit while pursuing Doctor’s repeated capture cost through the separate performance issue. Do we have a high-confidence way to reproduce the issue? Yes: current main compares the documented 473-second large-state Doctor run against a fixed 60-second limit, and the supplied base-failing shell regression exercises that exact assertion. This review did not execute the reproduction. Is this the best way to solve the issue? Yes for the validation defect: measuring persisted inputs before execution corrects the limit without changing Doctor or learning from its elapsed time. It intentionally does not solve the separately documented performance problem. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c78e6d46b639. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +148, Docs +11, Other +66. Total +225 across 8 files. Added test files: 1. 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: No label changes. Label justifications:
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 HistoryReview history (1 earlier review cycle)
Reviewed October 8, 2026, 6:28 PM ET / 22:28 UTC (Revision 2). |
|
Merged via squash.
|
…claw#167482) Measure persisted sessions, transcript events, cron jobs, and enabled plugin roots before the sqlite-volume Doctor pass. Record the computed limit and preserve explicit overrides and frozen extended-stable defaults. Doctor behavior and fs-safe remain unchanged.
Related: #166526
This fixes the validation-budget failure only. Repeated guarded plugin captures and the broader Doctor performance optimization remain tracked in the issue.
What Problem This Solves
Fixes false idempotent-Doctor budget failures in the
sqlite-volumepublished-upgrade survivor scenario when persisted state grows.User Impact
This changes release-validation tooling; it does not change Doctor behavior or reduce its runtime. The independent command watchdog still defaults to 900 seconds and must be increased explicitly for fixtures whose computed budget exceeds that duration. Repeated plugin-capture cost remains outside this patch.
Why This Change Was Made
The harness applied the same 60-second limit to small states and the 4,800-session / 23,890-event / 2,200-job fixture, despite a measured 473-second AWS run. It now measures persisted session/event/job counts and distinct enabled plugin roots before timing Doctor, then assigns 60 seconds of fixed overhead plus 80 ms/session, 2 ms/event, 20 ms/job, and 20 seconds/plugin root, rounded up. Seven roots with the reported volume receive 676 seconds, still below a twofold slowdown.
The computed and effective limits are recorded in scenario output and an artifact, with the effective limit in the sanitized summary. Explicit overrides remain supported. The Docker launcher omits unset/empty overrides so frozen extended-stable runners retain their shipped defaults. No Doctor, fs-safe, schema, dependency, or public option changes.
Evidence
8879e5ef4b98e7ff17b0ac04e7695f66f3e143b2: the real shell budget assertion, with the recorded 473-second duration injected, rejects473s > 60s. Restoring all changed implementation files to that base makes the new regression fail for exactly that reason.pnpm test test/scripts/upgrade-survivor-doctor-budget.test.ts --maxWorkers=1: 5 passed; 4.04 seconds wall time, 1.23 seconds test execution. Hosted CI ran the same five tests in 0.311 seconds; the adapted config-parking file passed its 28 existing tests in 8.128 seconds (CI job).cbx_b1aae9de19cb: 934 Linux-applicable tests, 75.11 seconds wrapper wall time.pnpm tsgo:coreandpnpm tsgo:core:test --root-stripe 2/4passed there and locally.v2026.8.35budget reader, driven with the launcher's new forwarding block, selects 60 seconds for unset/empty overrides and 700 seconds for an explicit override.Fresh AWS live proof passed on lease
cbx_b1aae9de19cb, runrun_4a8f3ec91d43b4c1f4c583acbfcd151c(scenario 2,086 seconds, full command 44m59s):The real isolated Gateway passed readiness/status and history checks before and after restart, preserving all 4,800 volume sessions, 23,890 volume events, and 2,200 volume jobs.
/healthzand/readyzeach took 1 second; RPC status took 4 seconds. Additional baseline records explain the larger measured totals. There was no manual budget override. Replaying the negative-control test with these exact measured counts also rejected a simulated 946-second Doctor against the 717-second limit; production code was unchanged and the transient test-data substitution was restored.Native Crabbox source verification bound source commit
3f434f6d5405e673d016d09ca4da144115dbb0fdto tree9bf15dc5ed7cca70c69e09fba56ba0699c2be679and carrier commit46e30166423c35c5a4595ea7dec8cebb430f29b0. The live command verified that carrier/tree/base and clean Git state. Earlier raw-sync preparation was rejected by the package provenance guard; the successful run used the native verified source capsule.Validation limitations: the local 51-file run passed 937 tests but failed the unchanged service-lifetime test at
upgrade-survivor-systemd.test.ts:621(unknownversusrunning). Its isolated replay and the AWS suite passed; no flake fix is claimed.check:changedpassed its preceding guards, formatting, and typechecks, then stopped on the existing unusedClientVoiceToolEffectexport in unchangedsrc/talk/client-voice-session-store.ts. Neither result was hidden with a baseline exception or weaker assertion. The published-head CI run passed on3f434f6d5405e673d016d09ca4da144115dbb0fd, including the new regression, types, lint, docs, and CI gate. The earlier local limitations remain recorded above rather than being presented as fixed.LOC exception: harness/tooling +73/-7 (net +66), tests +148/-0, docs +14/-3. Measured state collection and budget evidence require the added harness code; no coherent behavior-preserving deletion offsets it without expanding scope or removing checks.