Repository navigation
test(infra): reuse the shared npm call presence guard - #137254
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 7:08 AM ET / 11:08 UTC. ClawSweeper reviewWhat this changesThe PR replaces a local helper that unwraps the first mocked npm command call with the shared Merge readiness✅ Ready for maintainer review No blocking finding: the introduced test-only cleanup replaces a duplicate presence guard with the established shared helper while preserving the command-option check. This PR remains open because it is maintainer-labeled, not because a repair is needed. Priority: P3 Review scores
Verification
How this fits togetherManaged npm-root tests validate the infrastructure flow that plans peer dependencies and repairs stale OpenClaw npm installs. They inspect recorded command invocations before asserting the command arguments and execution options. flowchart LR
A[Managed npm-root test] --> B[Mock command runner]
B --> C[Recorded command calls]
C --> D[Shared presence assertion]
D --> E[Tuple and options checks]
E --> F[Npm root repair coverage]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -4. Total -4 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the narrow replacement: use the shared nullish-presence assertion and retain the local command-options validator for its distinct numeric-option contract. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR changes test assertion plumbing rather than a reported runtime defect. Is this the best way to solve the issue? Yes. The shared helper has the required nullish-presence behavior and a package-supported narrow import, while the specialized options validator remains in place. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c4fd629a6da9. 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.
|
* commit '13b1f71c7010baaf2394555198e2fc04bef03586': (283 commits) fix(ui): retire stale MCP feedback across context changes (#128490) fix(agents): clarify set-identity workspace output (#126320) fix(auth): preserve OAuth metadata during session SDK refresh (#127988) fix(agents): recover catalog worker after generation mismatch (#127712) fix(memory-wiki): reject out-of-range claim confidence (#125656) ci: remove redundant contract runs and costly test work (#137220) fix(release): assert the Codex CLI pin the candidate declares (#137136) test(voice-call): reuse shared guards and deferred gates (#137262) fix(cron): isolate scheduler-disabled shared-store writes (#131733) fix(telegram): surface allowed custom reactions in react guidance (#129817) test(infra): reuse the shared npm call presence guard (#137254) fix: generated images disappear after failed tool calls (#131226) fix(docs): match source anchor checks to published sections (#137157) fix(backup): preserve audit capture across slow snapshots (#130962) fix(release): preserve legacy gh log reads (#137016) fix(memory-core): make forget rewrites atomic (#131383) fix(agents): write settings atomically (#131431) fix(plugins): keep the memory indexing runtime with the selected slot owner (#131779) fix(ci): pin iOS screenshot evidence to workflow revision (#136334) test(logging): remove redundant stderr spy casts (#137238) ... # Conflicts: # scripts/e2e/lib/codex-release-package-assertions.mjs
What Problem This Solves
The managed npm-root tests use a local generic helper solely to unwrap the first recorded command call, duplicating existing assertion support.
Why This Change Was Made
Use the shared
expectDefinedhelper through its narrow entrypoint at both assertion sites. Preserve first-call tuple checks, the existing repair call count, and all command arguments and options. KeeprequireCommandOptions, which distinguishes the runner's numeric options variant.User Impact
No runtime behavior changes. All existing fallback, manifest and lockfile, plugin preservation, host and symlink, executable-shim, path-safety, and fixture-cleanup assertions remain. Production: 0 lines changed; tests: +9/-13 (net -4). No test cases were added or removed.
Evidence
env -u OPENCLAW_TESTBOX node scripts/check-changed.mjs -- src/infra/npm-managed-root.test.ts: all 20 selected canonical local stages passed, including infra test types, unused-export scans, and type-aware lint.