Repository navigation
test(cli): reuse canonical directory mock call helper - #137640
Conversation
Remove duplicated call-presence retrieval while preserving the directory tests' stronger record guard and all payload assertions.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 7:30 PM ET / 23:30 UTC. ClawSweeper reviewWhat this changesThe PR replaces a local directory-CLI test helper with the shared mock-call assertion helper. Merge readiness✅ Ready for maintainer review No blocking findings. This small maintainer-owned test refactor preserves the first-call and record-validation behavior while removing duplicated test support; the protected maintainer label means it remains for normal maintainer handling rather than automated closure. Priority: P3 Review scores
Verification
How this fits togetherDirectory CLI tests invoke registered CLI commands against mocked runtime services and inspect their recorded calls. The shared helper retrieves the requested mock invocation, after which the directory test retains its own record-shape assertions. flowchart LR
A[Directory CLI test] --> B[Mocked runtime service]
B --> C[Recorded mock calls]
C --> D[Shared call assertion helper]
D --> E[Test-specific record guard]
E --> F[Payload assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -7. Total -7 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one canonical mock-call retrieval helper and retain the directory test’s narrower record guard for payload-shape assertions. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors test support and does not report a user-facing defect. Is this the best way to solve the issue? Yes. The shared helper preserves first-call retrieval and missing-call failure, while the local record guard continues to enforce the directory tests’ value-shape contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f1eb466dad64. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…date-command * origin/main: fix(ci): retry transient npm advisory timeouts (#137716) fix: keep restored Usage navigation from being replaced by Chat (#137402) fix: keep Usage day totals within the selected session scope (#137396) refactor: reduce live digest scheduling allocations (#137655) fix(ui): submit selected slash arguments in new sessions (#137571) fix(ui): expand collapsed task progress on final (#137569) fix(test): prevent auth discovery from stalling MCP replacement proof (#137639) test(cli): reuse canonical directory mock call helper (#137640)
Remove duplicated call-presence retrieval while preserving the directory tests' stronger record guard and all payload assertions.
The directory CLI tests had a local wrapper duplicating the shared mock-call helper. Reuse
mockCallwhile retaining the existing falsy, object and non-array guards, all ten payload reads, and the existing config, secret-scope and output assertions.Production code is unchanged; tests shrink by seven lines. The same 35 cases passed before and after, with no skips; all 20 normal local changed checks and Codex P2 review passed. Per-file and observed case order matched, without changing the canonical scheduler.