Skip to content

refactor(test): share CLI diagnostics fixture setup - #157201

Merged
steipete merged 1 commit into
mainfrom
codex/test-cli-diagnostics-fixtures
Sep 24, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-cli-diagnostics-fixtures

Conversation

@steipete

@steipete steipete commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

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.

@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@steipete
steipete marked this pull request as ready for review September 24, 2026 10:07
@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 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 9:04 AM ET / 13:04 UTC (Revision 3).

ClawSweeper review

What this changes

The 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
Reviewed head: 8bd8f89ed453ba5ea4bd386856feab5330637b80

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused cleanup preserves the cases and has useful before-and-after validation, with no identified merge blocker.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The changed owner is a Claude CLI diagnostics test fixture, with no production behavior changed. The provided repository state identifies the author as a member, so the external-contributor real-behavior gate does not apply; the PR body reports matching before-and-after test results and passing CI. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The changed owner is a Claude CLI diagnostics test fixture, with no production behavior changed. The provided repository state identifies the author as a member, so the external-contributor real-behavior gate does not apply; the PR body reports matching before-and-after test results and passing CI. No stored-data contract changes.
Evidence reviewed 6 items Introduced test change: The pinned PR delta adds one file-local setup helper and replaces repeated setup in eight cases; their event draining, unsubscription, inputs, and assertions remain in the cases.
Current-main necessity: Fetched main retains the repeated listener and diagnostics setup in the corresponding tests, so this cleanup is not yet present there.
Production boundary: The diagnostics factory is listener-gated, explaining why the test listener must be registered before the factory call.
Findings None None.
Security None None.

How this fits together

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

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -63. Total -63 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 33 96 -63
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 33 96 -63

Review metrics

Metric Value Why it matters
Scenario coverage 11 before, 11 after The cleanup preserves the existing diagnostic scenarios rather than removing coverage.

Root-cause cluster

Relationship: partial_overlap
Canonical: #139428
Summary: This PR is one bounded cleanup within the open test-audit campaign; it does not complete the campaign's broader goals.

Members:

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

Technical review

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a focused test-maintenance cleanup with no user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The changed owner is a Claude CLI diagnostics test fixture, with no production behavior changed. The provided repository state identifies the author as a member, so the external-contributor real-behavior gate does not apply; the PR body reports matching before-and-after test results and passing CI. 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)
  • Patrick Erichsen: 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 (2 earlier review cycles)
  • reviewed 2026-09-24T10:19:41.097Z sha 8bd8f89 :: blocked before merge. :: none
  • reviewed 2026-09-24T10:51:13.237Z sha 8bd8f89 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 7e8e1f8 into main Sep 24, 2026
220 of 221 checks passed
@steipete
steipete deleted the codex/test-cli-diagnostics-fixtures branch September 24, 2026 13:49
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 24, 2026
* 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)
  ...
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant