Skip to content

[Bug]: Route-first commands ignore unknown options #112206

Description

@steipete

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Route-first fast paths for health, status, sessions, and agents list silently discard unknown options and execute successfully instead of deferring to Commander validation.

Steps to reproduce

  1. Build OpenClaw from cc8e593c9d4.
  2. Run each command against isolated state: openclaw health --wat, openclaw status --wat, openclaw sessions --wat, and openclaw agents list --wat.
  3. Record output and exit codes.

Expected behavior

Each command rejects --wat, prints the normal unknown-option error, and exits nonzero.

Actual behavior

Each route-first command ignores the unsupported option, performs the read operation, and exits 0.

OpenClaw version

Source SHA cc8e593c9d4

Operating system

AWS Linux, Node 24.18.0

Install method

Trusted source checkout, pnpm build, node openclaw.mjs

Model

Not model-dependent

Provider / routing chain

Not provider-dependent

Additional provider/model setup details

Isolated config and two isolated loopback Gateways; no external channels.

Logs

openclaw health --wat    # exits 0
openclaw status --wat    # exits 0
openclaw sessions --wat  # exits 0
openclaw agents list --wat # exits 0

Screenshots, recordings, and evidence

AWS Crabbox stress run run_3e83ca8ddd20 reproduced all four cases. Disabling route-first parsing makes the full Commander path reject the same options.

Impact and severity

Affected: CLI users and automation with misspelled or stale flags.
Severity: Medium; invalid invocations appear successful.
Frequency: deterministic on the affected route-first commands.
Consequence: scripts may consume output produced under unintended defaults instead of detecting configuration mistakes.

Additional information

Recognized route-first options and the shipped bare openclaw agents --json shortcut should remain supported; only unsupported token shapes need to fall back to full parsing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions