Skip to content

test(agents): share fresh zero-usage input fixtures - #139745

Merged
steipete merged 1 commit into
mainfrom
codex/test-agent-zero-usage-inputs
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-agent-zero-usage-inputs

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Related: #139428

What Problem This Solves

Agent tests repeat complete zero-usage input objects, adding fixture code without adding distinct scenarios.

Why This Change Was Made

Use a fresh zero-argument fixture factory for 57 audited inputs. Preserve every allocation location, property order and omitted optional field. The existing singleton remains one shared initialization-time result for its unchanged consumers. Expected, sparse and nonzero usage remains explicit.

User Impact

No production behavior changes or scenarios removed. Net 359 test/support lines removed across 43 files.

Evidence

All 1,509 affected/sibling tests across 46 files pass. Whole-file reconstruction and runtime graph/JSON-order checks preserve the original inputs and test bodies. Fresh outer/cost objects remain independent of the singleton; two obsolete const assertions had no narrowing-dependent consumers.

The complete changed gate, formatting/diff checks, deslop and final independent P2 review pass. No overall runtime improvement is claimed.

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 04:37
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 12:58 AM ET / 04:58 UTC.

ClawSweeper review

What this changes

Agent tests replace repeated zero-token usage inputs with a shared factory that creates independent objects while retaining the existing singleton.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a useful, maintainer-sponsored cleanup that is absent from inspected main. The introduced changes preserve fixture values, allocation sites, and assertions; no actionable defect was found.

Priority: P3
Reviewed head: d095d8f10cca4f1715e9b876bde134e85384bc3c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture refactor with preserved input semantics, unchanged assertions, and useful reported validation.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test cleanup changes no production owner or user-visible behavior; reported test and equivalence checks are supplemental validation, and no live demonstration is required.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored test cleanup changes no production owner or user-visible behavior; reported test and equivalence checks are supplemental validation, and no live demonstration is required.
Evidence reviewed 8 items Fresh allocation and retained sharing: The factory returns new outer and nested cost objects with the original field order and zero values. The existing singleton remains one initialization-time result; its consumers in agent-message-fixtures.ts and assistant-message-fixtures.ts remain unchanged.
Introduced scope and preserved coverage: The pinned introduction evidence and local inspection show fixture extraction only: 57 input expressions become factory calls, without removing scenarios or changing assertions. The complete local SDK-test diff resolves the truncated supplied excerpt. Independent expected usage in cli-runner/prepare.test.ts remains explicit.
Main still has only the singleton: The fetched main revision retains the original singleton literal and does not contain the proposed factory, so this cleanup remains distinct work.
Findings None None.
Security None None.

How this fits together

Agent tests construct assistant messages with token and cost accounting data before exercising execution, transport, compaction, and session behavior. This helper supplies those test inputs without changing production accounting.

flowchart LR
  A[Test scenarios] --> B[Assistant message inputs]
  B --> C[Fresh usage factory]
  C --> D[Independent usage and cost objects]
  E[Existing shared fixture consumers] --> F[Retained singleton]
  D --> G[Existing behavior assertions]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -359. Total -359 across 43 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 43 114 473 -359
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 43 114 473 -359

Review metrics

None.

Root-cause cluster

Relationship: partial_overlap
Canonical: #139428
Summary: This PR implements one bounded batch of the broader test-audit campaign, without satisfying its full removal or runtime targets.

Members:

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

Technical review

Best possible solution:

Keep zero-usage input construction centralized while preserving independent expected outputs and each test's existing allocation semantics.

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

Not applicable: this PR removes repetitive fixture construction rather than repairing a reported runtime defect; tests were not executed during this read-only review.

Is this the best way to solve the issue?

Yes: extending the existing fixture module preserves fresh allocations without introducing production helpers, competing contracts, or shared mutable inputs at previously independent sites.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 883d4d65bad1.

Labels

Label changes:

  • add P3: This is test-maintenance cleanup with no production behavior change or demonstrated runtime improvement.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored test cleanup changes no production owner or user-visible behavior; reported test and equivalence checks are supplemental validation, and no live demonstration is required.

Label justifications:

  • P3: This is test-maintenance cleanup with no production behavior change or demonstrated runtime improvement.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored test cleanup changes no production owner or user-visible behavior; reported test and equivalence checks are supplemental validation, and no live demonstration is required.

Evidence

What I checked:

  • Fresh allocation and retained sharing: The factory returns new outer and nested cost objects with the original field order and zero values. The existing singleton remains one initialization-time result; its consumers in agent-message-fixtures.ts and assistant-message-fixtures.ts remain unchanged. (src/agents/test-helpers/usage-fixtures.ts:9, d095d8f10cca)
  • Introduced scope and preserved coverage: The pinned introduction evidence and local inspection show fixture extraction only: 57 input expressions become factory calls, without removing scenarios or changing assertions. The complete local SDK-test diff resolves the truncated supplied excerpt. Independent expected usage in cli-runner/prepare.test.ts remains explicit. (src/agents/sessions/sdk.test.ts:148, d095d8f10cca)
  • Main still has only the singleton: The fetched main revision retains the original singleton literal and does not contain the proposed factory, so this cleanup remains distinct work. (src/agents/test-helpers/usage-fixtures.ts:10, 883d4d65bad1)
  • Latest release comparison: The supplied latest release also contains the original singleton implementation; this factory cleanup is not present there. (src/agents/test-helpers/usage-fixtures.ts:10, 3928bad9badf)
  • Owned type contract: The Usage type is owned by this repository and includes optional accounting metadata. The factory preserves omission of that metadata and introduces no runtime dependency import or Codex contract change. (packages/llm-core/src/types.ts:302, d095d8f10cca)
  • Campaign sponsorship and reported validation: The supplied discussion for Test audit: reduce redundant test code and full-suite runtime #139428 explicitly identifies this as a pending fixture-cleanup batch and reports 1,509 affected/sibling tests passing. Neither item claims a measured full-suite speedup. These are contributor-reported results; this read-only review did not execute tests.

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 (1 earlier review cycle)
  • reviewed 2026-09-06T04:42:29.595Z sha 8f3c099e6f254ac90864d33e832c1732099073bb :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/test-agent-zero-usage-inputs branch from 8f3c099 to d095d8f Compare September 6, 2026 04: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 6, 2026
@steipete
steipete merged commit 33dda9a into main Sep 6, 2026
149 checks passed
@steipete
steipete deleted the codex/test-agent-zero-usage-inputs branch September 6, 2026 05:09
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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