Repository navigation
fix(cli): preserve the first PowerShell completion test failure - #157267
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 24, 2026, 8:22 AM ET / 12:22 UTC. ClawSweeper reviewWhat this changesThe branch changes the PowerShell completion test helper to preserve its first failure during shutdown and adds real-child regression cases for early exit, unexpected output, and forced termination. Merge readiness✅ Ready for maintainer review Current main still masks the first completion-test failure during cleanup. This focused PR addresses that defect, and the introduced diff shows no blocking correctness or security issue. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s CLI completion tests send requests to a PowerShell child process through a shared test helper. The helper queues requests and reports completion results, failures, and shutdown outcomes to the tests. flowchart LR
A[Completion tests] --> B[Request queue]
B --> C[PowerShell child]
C --> D{Response or failure}
D --> E[Test result]
D --> F[First failure record]
F --> E
F --> G[Shutdown result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +76. Total +76 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep first-error selection in the shared test helper for both request rejection and cleanup, guarded by the real-child regression cases. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows the recorded failure being displaced by exit or shutdown errors; the PR supplies a direct real-child test path, though this review did not run it. Is this the best way to solve the issue? Yes. Correcting first-error selection in the existing helper is narrower than changing completion generation or child termination behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b5346d6dafe6. 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 '9a1a6f7db9783d0b8abaf918bfe12978ea745b57': (26 commits) fix(maintainer): restore cold PR worktree provisioning (#157394) feat(ios): establish native Cloudflare Access sign-in sessions (#146996) fix: restore the Gateway after interrupted Doctor maintenance (#156854) refactor(line): retire the Express webhook adapter (#157369) refactor(cron): consolidate unavailable delivery targets (#157393) ci: apply Go memory defaults to architecture checks fix(cli): preserve the first PowerShell completion test failure (#157267) refactor(agents): consolidate transcript-tail model selection (#157382) fix(release): honor frozen validation contracts (#157034) fix(perf): use settled Kova terminal CPU accounting (#157029) chore(windows): verify packaged repair worker lifecycle (#157047) refactor(logging): share memory pressure threshold selection (#157164) fix(release): verify bundled fs-safe native bindings (#157027) perf(skills): skip warm prompt search when minimum cannot fit (#157343) fix(ui): avoid retaining detached tooltip anchors (#157226) perf(ci): reuse compiler state and shorten guard and UI tests (#157265) perf(ui): preserve model caches on unrelated metadata updates (#157254) chore: remove the tracked PR-body artifact and ignore .artifacts (#157296) refactor: consolidate duplicate MCP lifecycle tests (#157360) test(qa): consolidate CLI runtime fixtures (#118496) ...
…claw#157267) Co-authored-by: Vincent Koc <[email protected]>
Related: PowerShell CI failure in #157164.
What Problem This Solves
Fixes: PowerShell completion tests report a shutdown error instead of the original failure when the child fails and the caller closes the runner in
finally.User Impact
Developers retain the first useful error while diagnosing completion tests. There is no change to shipped completion generation, test deadlines, or process termination policy.
Why This Change Was Made
The test runner already records the first failure. Its close path now preserves that same Error before validating the child exit and when shutdown itself rejects. Three real-child cases cover an early exit, unexpected output followed by termination, and a child that ignores termination until the existing escalation.
Production: 0 lines changed. Test support: +1 net line; regression tests: +75 net lines.
Evidence
finallyError identity. Each fixture separately waits for actual child closure and both output streams to end.commandsandconfig-clitest type graphs.5ad0819f87f9c0c95d7e7200b2af3aaa2be767a7.Provenance and diagnostic limits
The two close-path error-masking branches were introduced by 6f6d501ccf9a in #118381, authored by @steipete. The later readiness fix in #134099 retained that close logic.
The original negative run retains its wrapper exit 1: its title oracle expected an untruncated Vitest case name. Independent inspection authenticated exactly the three intended assertion failures with no extra hook or unhandled errors. The candidate-only recovery used the actual generated names; it did not replay the baseline. Source remained unchanged, and both remote runs stopped normally.
A separate observation-only run of the original seven-file CI cohort at its tested merge passed 157 tests, with one unrelated fish case skipped. The PowerShell case executed all 20 requests and closed cleanly. Its native workload exited 0; the capture wrapper retained exit 70 because it did not recognize the shard-prefixed journal. Independent inspection authenticated the intact journal and closure without rerunning the cohort.
That diagnostic did not reproduce or explain the original hosted failure. The original cache state and PowerShell executable identity were not established as equivalent; no Windows-runtime or whole-CI qualification is claimed. The narrow warning-only temporary-file report compared an empty base-to-base range; the added test source was inspected separately. Post-stop portal synchronization warnings are retained and do not represent successful portal publication.