Repository navigation
fix(test): CLI process tests fail after concise Gateway error copy - #163649
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 October 2, 2026, 4:12 PM ET / 20:12 UTC (Revision 3). ClawSweeper reviewWhat this changesThis PR updates existing CLI process tests to expect concise Gateway connection guidance on stderr and timeout-error details in JSON stdout. Merge readiness✅ Ready for maintainer review The repair remains necessary: current main still has the stale assertions, and the merged sibling repairs do not cover this file. No actionable correctness finding remains. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's CLI formats command failures for people on stderr and preserves machine-readable diagnostics on stdout. These process tests check that commands produce the appropriate output and exit cleanly. flowchart TD
A[CLI command arguments] --> B[Command validation]
B --> C[Gateway connection]
B --> D[Shared failure renderer]
C --> D
D --> E[Human stderr guidance]
D --> F[JSON stdout diagnostics]
E --> G[Process assertions]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +4. Total +4 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the concise production error contract and preserve process coverage for human guidance, JSON diagnostics, clean exits, and validation before network access. Do we have a high-confidence way to reproduce the issue? Yes: current-main assertions conflict directly with the inspected output renderer and JSON entry handler, and the captured body reports the corresponding five failures. This review established the mismatch from source without running tests. Is this the best way to solve the issue? Yes: updating the existing boundary assertions follows the intentional production contract while preserving failure and network-access checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against da1e2a60641e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
a7d1662 to
539239a
Compare
#163381 made human CLI output for Gateway transport failures lead with "Couldn't connect to OpenClaw." plus a status-check command, and made non-expected human failure lines terse (the reason stays in the --json stdout envelope). gateway-backed-exit.process.test.ts still asserted the old stderr text, so devices list/approve/rotate against an unreachable Gateway and the whitespace --timeout cases for nodes list and channels capabilities failed on main. #163637 and eb978fd already fixed the channels status and gateway health siblings. Assert the new user-facing contract instead: the connection-failure lead and the `openclaw gateway status` next step on stderr, and the "Invalid --timeout" reason in the --json failure envelope.
539239a to
d639f3e
Compare
|
Merged via squash.
|
* commit '79be075e5aa46be9e42dbd53ed6e30e81469210a': (33 commits) fix(ui): keep selected-text comment input readable while scrolling (#163772) test(memory): open corpus database explicitly fix: bound Doctor migration capture to plugin data (#163780) fix(ui): gate system information at the shared reader (#160982) chore(db): reclassify worker inventory sites with caller evidence (#163754) refactor(channels): deslop Slack and Matrix (#163740) fix(agents): reject empty sessions_search queries in the tool schema (#129120) perf(nodes): load only what a worker turn needs (#160442) test(cli): assert concise Gateway failure copy in CLI process tests (#163649) refactor(discord): deslop discord (#163728) fix(workboard): make Sessions boards work on multi-agent Gateways (#163761) test(gateway): add sustained heap retention diagnostics (#163764) test(ui): disambiguate session filter controls refactor(plugins): deslop imessage, mattermost, and voice-call (#163767) fix(qa): run Telegram plugin source in --source-gateway userbot runs (#163718) feat(macos): add a --no-activate launch flag for background automation (#163758) fix(agents): preserve host authority across module reloads (#163725) perf(gateway): serve the listener before multi-gigabyte store validation and honor clean-close receipts at startup (#163690) fix: keep video widgets scrollable and preload initial frames (#163762) feat(memory): add a provider-neutral memory provider runtime (#162175) ...
…penclaw#163649) openclaw#163381 made human CLI output for Gateway transport failures lead with "Couldn't connect to OpenClaw." plus a status-check command, and made non-expected human failure lines terse (the reason stays in the --json stdout envelope). gateway-backed-exit.process.test.ts still asserted the old stderr text, so devices list/approve/rotate against an unreachable Gateway and the whitespace --timeout cases for nodes list and channels capabilities failed on main. openclaw#163637 and e4d6b11 already fixed the channels status and gateway health siblings. Assert the new user-facing contract instead: the connection-failure lead and the `openclaw gateway status` next step on stderr, and the "Invalid --timeout" reason in the --json failure envelope.
* commit '1fda703fb4d3630e4633461967b2a2186e8f15fd': (33 commits) fix(ui): keep selected-text comment input readable while scrolling (openclaw#163772) test(memory): open corpus database explicitly fix: bound Doctor migration capture to plugin data (openclaw#163780) fix(ui): gate system information at the shared reader (openclaw#160982) chore(db): reclassify worker inventory sites with caller evidence (openclaw#163754) refactor(channels): deslop Slack and Matrix (openclaw#163740) fix(agents): reject empty sessions_search queries in the tool schema (openclaw#129120) perf(nodes): load only what a worker turn needs (openclaw#160442) test(cli): assert concise Gateway failure copy in CLI process tests (openclaw#163649) refactor(discord): deslop discord (openclaw#163728) fix(workboard): make Sessions boards work on multi-agent Gateways (openclaw#163761) test(gateway): add sustained heap retention diagnostics (openclaw#163764) test(ui): disambiguate session filter controls refactor(plugins): deslop imessage, mattermost, and voice-call (openclaw#163767) fix(qa): run Telegram plugin source in --source-gateway userbot runs (openclaw#163718) feat(macos): add a --no-activate launch flag for background automation (openclaw#163758) fix(agents): preserve host authority across module reloads (openclaw#163725) perf(gateway): serve the listener before multi-gigabyte store validation and honor clean-close receipts at startup (openclaw#163690) fix: keep video widgets scrollable and preload initial frames (openclaw#163762) feat(memory): add a provider-neutral memory provider runtime (openclaw#162175) ...
Related: #163381, #163637
What Problem This Solves
Fixes:
gateway-backed-exit.process.test.tsfails onmainfordevicescommands against an unreachable Gateway and for whitespace--timeoutvalues. It still expects stderr text that #163381 deliberately replaced with shorter copy.User Impact
No user-visible change. The CLI process lane passes again. The sibling failures with the same cause are already fixed on
main:channels.status.command-flow.test.tsby #163637 andgateway-backed-exit-health.process.test.tsby eb978fd. This PR covers the last file.Why This Change Was Made
#163381 changed the human CLI output for Gateway transport failures. It now opens with "Couldn't connect to OpenClaw." and points to
openclaw gateway status. The raw diagnostic only appears withOPENCLAW_DEBUG. It also cut stderr for unexpected failures down to a short title plus a hint. The full reason still goes to the--jsonstdout envelope. Five cases in this file still expected the old stderr text:devices list/approve/rotateagainst an unreachable Gateway.--timeoutfornodes list --jsonandchannels capabilities --json.The tests now assert the new user-facing contract instead of reverting the product copy. On stderr they check for the connection-failure lead and the status-check next step. For
--jsonruns they check that theInvalid --timeoutreason is in the stdout failure envelope.The timeout cases are not a product regression. These
--jsonruns carry the reason on stdout. In text mode,runCommandWithRuntimestill prints theInvalid --timeoutmessage. Other checks are unchanged: the Gateway diagnostic in the JSON envelope, no crash framing, no doctor hint, and Gateway call counts.Evidence
Reproduced on
mainbefore the change:pnpm test src/cli/gateway-backed-exit.process.test.ts --maxWorkers=1: the devices list/approve/rotate and two whitespace-timeout cases failed. Failures includedexpected 'Couldn't connect to OpenClaw.\nCheck…' to contain 'Gateway not reachable at ws://127.0.0…'andexpected '[openclaw] The CLI command failed.\n[…' to contain 'Invalid --timeout'.After the change, all passing:
main).-t timeoutrerun after the final assertion form: 6/6 passed.gateway-diagnostics-opens.process.test.ts: 2/2 passed.failure-output.test.ts: 23/23 passed.Gateway not reachable: 321/321 passed.The test file is byte-identical to the tested version. Since then,
mainhas changed only one producer on its path: eb978fd added aReason:line forInvalidConfigError. These cases never reach it, because transport failures return earlier andInvalid --timeoutis a plainError. These are assertion-only changes. No new tests, timers, or fixtures were added.