Skip to content

fix(cli): report startup, argument, and signal failures#112210

Merged
steipete merged 1 commit into
mainfrom
steipete/cli-stress-testing-round-2
Jul 21, 2026
Merged

fix(cli): report startup, argument, and signal failures#112210
steipete merged 1 commit into
mainfrom
steipete/cli-stress-testing-round-2

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #112205
Closes #112206
Closes #112207

What Problem This Solves

Fixes three CLI failure paths that previously reported misleading success or generic failure statuses:

  • a foreground Gateway collision printed startup errors but exited 0 when the occupied port answered OpenClaw health checks;
  • route-first fast paths for health, status, sessions, and agents list silently ignored unsupported flags;
  • respawn wrappers converted children terminated by a forwarded SIGINT/SIGTERM into exit 1 instead of 130/143.

Why This Change Was Made

Gateway duplicate-instance success is now confined to the explicit supervisor-recovery boundary; ordinary foreground lock and port conflicts exit 1. Route-first parsers validate their complete supported argv shape and defer unsupported input to the normal Commander parser. Both launcher implementations preserve the first gracefully forwarded SIGINT/SIGTERM while retaining exit 1 for spawn errors and hard-kill backstops.

The Gateway TLS supervisor probe is non-mutating and retries fingerprint discovery while the lock-owning Gateway finishes certificate generation. Existing bare openclaw agents --json behavior remains supported.

User Impact

Shell scripts and supervisors can now trust the CLI exit status:

  • failed foreground Gateway starts are nonzero;
  • misspelled or stale flags fail instead of silently using defaults;
  • SIGINT/SIGTERM remain distinguishable from ordinary command failure.

Evidence

  • AI-assisted change; final uncommitted AutoReview was clean with no accepted/actionable findings.
  • Round-two discovery campaign: AWS Crabbox run run_3e83ca8ddd20 executed 1,063 cases across broad CLI grammar, JSON output, config atomicity, completion generation, file inputs, real OpenAI concurrency, two isolated Gateways, 30 in-process restarts, a 600-call read soak, diagnostics, collisions, and resource cleanup. The run directly reproduced all three fixed defects.
  • Black-box fixed behavior: AWS Crabbox run run_cb6a78e6864d passed Gateway collision exit 1, all four routed unknown-option failures, retained bare agents --json, and early SIGINT/SIGTERM exits 130/143.
  • Focused regression suite after rebase: 205 tests passed, with one platform-gated test skipped.
  • Complete changed-scope gate: Blacksmith Testbox tbx_01ky1ssr8fwr4n5racdxa616jp / Actions run 29811216524 passed formatting, script declarations, plugin boundaries, dependency guards, tsgo:all, full core/extensions/scripts lint, storage guards, and import-cycle checks.
  • Patched source build: AWS Crabbox run run_516faadc2bd1 passed.
  • git diff --check: passed.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: L maintainer Maintainer-authored PR labels Jul 21, 2026
@steipete
steipete marked this pull request as ready for review July 21, 2026 07:58
@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(cli): report startup, argument, and signal failures This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for head 6cc4d92302978a02d05ba2704717d8a4a2513c46:

The latest ClawSweeper comment restarted as a review-start placeholder and contained no final findings or Rank-up moves to apply. No proof gaps remain.

@steipete
steipete merged commit 6f43c50 into main Jul 21, 2026
203 of 206 checks passed
@steipete
steipete deleted the steipete/cli-stress-testing-round-2 branch July 21, 2026 08:48
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR size: L

Projects

None yet

1 participant