Repository navigation
fix(test): execute CLI fixture preloads on Node and Bun - #152076
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 18, 2026, 5:47 PM ET / 21:47 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR passes CLI test fixtures directly to Node or Bun and checks malformed-JSON diagnostics against the selected runtime’s error message. Merge readiness✅ Ready for maintainer review This remains a useful, focused test-harness repair absent from current main and the latest release. No introduced correctness or security defects were found; the prior review contains no outstanding findings. Priority: P2 Review scores
Verification
How this fits togetherThe CLI test harness launches the built OpenClaw command with isolated test inputs and captures its output. Preloaded fixtures simulate offline failures and terminal behavior before the command runs. flowchart LR
A[Test scenarios] --> B[Shared CLI test helper]
B --> C[Runtime arguments and isolated environment]
C --> D[Node or Bun loads fixtures]
D --> E[Built CLI and launcher respawns]
E --> F[Output and exit assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +86. Total +86 across 10 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep fixture loading in the shared test helper while preserving runtime selection, isolation, permission flags, and observable output assertions. Do we have a high-confidence way to reproduce the issue? Yes: comparing preload markers in the same built CLI invocation under Node and Bun isolates the reported failure. The PR reports that comparison; this read-only review verified the source path but did not execute it. Is this the best way to solve the issue? Yes. Passing runtime arguments through the existing helper fixes fixture delivery at its owner, and deriving the parser diagnostic preserves the debug-visibility contract across runtimes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8ef68bbfb0d1. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
8ee7a1d to
5021174
Compare
5021174 to
47911ae
Compare
|
Merged via squash.
|
…pr-149099-main-20260918 * commit '795e460278d4f8f41545dc8b4a66da1d12defd90': (1902 commits) refactor(slack): share Markdown preparation (#149129) fix(tooling): release completed PR operations with exited loaders (#152209) fix(release): allow stable npm bootstrap under an operator soak waiver (#152206) fix(daemon): avoid false restart timeouts during slow startup (#151387) feat: read agent documents from a host-owned workspace (#150584) improve(startup): skip redundant single-agent directory checks (#152192) test(ui): await board widget readiness before size reports (#152198) perf(browser): move dashboard event discovery to SQLite worker (#151952) improve(auth): reduce pauses during concurrent credential reads (#152140) improve(ui): load older chat history in smaller pages (#152093) fix(release): reject incomplete legacy npm install trees (#152186) refactor: share current-conversation binding row serialization (#152134) test(tooling): preserve Node and terminal fixture ownership under Bun (#152187) fix(sqlite): service worker admission through retained path aliases (#152190) improve: reduce CPU work for long CLI reasoning streams (#152191) chore(ui): refresh control ui locales (#152196) test(subagents): align lifecycle retries with durable completion owners (#152184) perf(gateway): defer participant maps for owned sessions (#152097) refactor(stream): share auxiliary queue overflow handling (#149282) fix(test): execute CLI fixture preloads on Node and Bun (#152076) ...
What Problem This Solves
CLI JSON tests silently omit their offline and terminal fixtures under Bun because Bun does not load
NODE_OPTIONS --importpreloads.User Impact
No production behavior changes. The tests now exercise their intended offline, TTY, and failure conditions with Node or Bun while preserving the selected runtime, permission flags, and output assertions.
Why This Change Was Made
Pass all 18 preload sites as explicit runtime arguments through the existing
runBuiltClihelper. This activates the same fixture source on both runtimes and across launcher respawns. The malformed-JSON test checks the selected runtime's exact SyntaxError message while retaining the debug-on/off visibility check. Equivalent ESC/BEL assertions and redundant string escapes satisfy the current linter without changing the tested behavior.Evidence
1.4.3-canary.1+043813609, using a fresh owned private-QA build of the candidate on fixed maind2a5196a2f951b1b100e1f7dec13d548f83aa5f4(candidate47911aeff7620632698c51d12f860fa7f9707960).promisifybindings in three SQLite tests inherited unchanged from main. This identical patch is rebased over main’s correction in fix: preserve model failure causes and worker fallback runtime #152028; this PR does not touch those files. Their complete 81-case source slice passes on Node and v14, and the full core-test type lane passes.This PR adds no production fallback or dependency and does not claim that Bun enforces Node's permission model.