Repository navigation
test(agents): share fresh zero-usage input fixtures - #139745
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 6, 2026, 12:58 AM ET / 04:58 UTC. ClawSweeper reviewWhat this changesAgent 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 Review scores
Verification
How this fits togetherAgent 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
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -359. Total -359 across 43 files. View PR surface stats
Review metricsNone. 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: 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
8f3c099 to
d095d8f
Compare
|
Merged via squash.
|
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.