Repository navigation
refactor(test): share CLI diagnostics fixture setup - #157201
Conversation
|
🦞👀 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 24, 2026, 9:04 AM ET / 13:04 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR shares Claude CLI diagnostic listener and capture setup across eight tests while retaining their individual scenarios and assertions. Merge readiness✅ Ready for maintainer review Keep open for normal review. Current main still repeats the setup, the linked test-audit campaign supplies maintainer-requested context, and the reviewed patch has no apparent correctness defect. Priority: P3 Review scores
Verification
How this fits togetherThe Claude CLI agent runner emits model-call diagnostics when a listener is present. These tests inspect completed diagnostic events to check output limits and fallback text. flowchart LR
A[Claude CLI test case] --> B[Register diagnostic listener]
B --> C[Create model-call diagnostics]
C --> D[Emit completed event]
D --> E[Capture output messages]
E --> F[Check limits and fallback text]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -63. Total -63 across 1 file. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Retain the file-local fixture and all diagnostic budget assertions, with listener registration preceding diagnostics creation. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR addresses repeated test setup, not a reported user bug. The repetition is directly visible in current main. Is this the best way to solve the issue? Yes: the file-local helper removes repeated setup without changing the production owner or case-specific checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f60ad5926e2d. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
* commit '9ccfc7d1bea21e34da48edbd54afd2e1be57db40': (89 commits) fix(exec): avoid gateway stalls during background task writes (#157177) test(cli): isolate preaction title setter state fix(test): synchronize Git backoff cancellation readiness (#157315) fix: validate Codex model references in Docker (#157175) fix(state): tolerate brief WAL coordinator contention (#157121) fix: unblock conversations after recovery preparation fails (#157214) test(telegram): avoid wall-clock pacing in HTTP conformance (#157281) fix: keep independent database work responsive under load (#157230) refactor(sqlite): centralize WAL checkpoint execution (#157263) improve(android): show tool outcomes in collapsed work (#156950) fix: remove tracked release scratch blocking source capture (#157308) test(update): remove legacy probe stream ordering race fix: preserve steering across reconnects and show queued input (#157135) fix(ui): keep typing focus when the GitHub reader opens (#157202) fix(ios): keep screenshot logs outside capture evidence test(codex): await startup teardown in lifecycle fixtures chore(ui): refresh control ui locales (#157311) refactor(memory): deslop memory plugins (#156867) refactor(test): share CLI diagnostics fixture setup (#157201) fix(release): retry notarization submit/wait on transport failures and name the resume command (#157116) ...
Co-authored-by: Peter Steinberger <[email protected]>
Related: #139428
What Problem This Solves
Eight CLI diagnostics scenarios repeat the same listener and diagnostics setup, making the tests harder to maintain.
User Impact
No user-visible change. All 11 scenarios retain their inputs, actions and assertions.
Why This Change Was Made
A file-local fixture removes 63 test lines while preserving fresh per-case listeners, context and diagnostics budgets. Listener registration still precedes the listener-gated factory; event draining and unsubscription remain explicit in each case.
Evidence
Original and candidate diagnostics files each pass all 11 cases with identical ordered names and outcomes. An exact inverse restores the original scenario bodies. The mapped changed gate passed, and independent review found no actionable issues.
Separate current-source confirmation passed six schema-format cases and 30 schema cases. The initial combined JSON-report invocation refused the third configuration before its cases ran; a standalone default-reporter invocation completed that file. The passing diagnostics and format results were retained without rerunning them.
Explicit single-worker cost check:
pnpm test src/agents/cli-runner/model-call-diagnostics.test.ts --maxWorkers=1(with native default/JSON reporting) passed all 11 cases on Node 24.19.0: 13.676 seconds complete command wall time, 10.37 seconds Vitest duration and 42 milliseconds test time. The prepared-worker cache was a hit; preparation reported 4.272 seconds. This is one cost observation, not a speedup comparison. Native cleanup completed and the owned temporary directory was empty.CI run 35985424572 was deferred by Full Release Validation hosted-runner priority before the runtime lanes ran. After release priority cleared, the authorized full rerun admitted attempt 2. The changed-tests job passed in 123 seconds including setup; its Node test step took 52 seconds. These are whole-job and step durations, not this file’s runtime. The changed-boundary job also passed. Attempt 2 is green, including the final CI gate. The retained target log confirms all 11 diagnostics cases passed with identical ordered names; the focused file reported 44.90 seconds Vitest duration and 48.32 seconds native shard duration.