fix: handle --help after --resume flag

Added specific handler for --help when rest contains --resume, so
claw --resume --help shows resume help instead of consuming --help
as a session-id literal.

Generated with https://github.com/Yeachan-Heo/gajae-code
Co-authored-by: Gajae Code <dev@gajae-code.com>
This commit is contained in:
bellman
2026-06-05 01:18:55 +09:00
parent 6757ebde74
commit a671969688
2 changed files with 6 additions and 1 deletions

View File

@@ -6477,7 +6477,7 @@ Original filing (2026-04-18): the session emitted `SessionStart hook (completed)
456. **DONE — doctor discovered config files count now consistent** — fixed 2026-06-04 in `fix: align discovered_config_files count with config check`. The `status_context` function now filters `loader.discover()` to only count paths that exist on disk, matching the `check_config_health` behavior. Both `config.discovered_files_count` and `workspace.discovered_config_files` now report the same number.
457. **`claw --resume --help` and `claw --resume --version` disagree by parser asymmetry: `--version` has no rest-emptiness guard so it short-circuits before resume dispatch (prints version, exit 0), but `--help` is guarded by `rest.is_empty()` plus a hardcoded 4-subcommand allowlist, so after `--resume` is appended to `rest` the `--help` token falls through to the catch-all and is consumed as the session-id literal — `failed to restore session: session not found: --help`, exit 1. Help is inaccessible from any `claw --resume …` invocation, while version is freely accessible from the same invocation. Sibling: every other discovery verb the user would intuit (`claw --resume help`, `claw --resume list`, `claw --resume ls`, `claw --resume show`) lands in the same trap, and the hint text in those error messages directs users to `/session list` which only works in the REPL** — dogfooded 2026-05-24 for the 08:00 Clawhip pinpoint nudge at message `1508016732986408983`, reproduced on local `./rust/target/debug/claw` `git_sha 003b739d` (origin/main `f8e1bb72`). Clean repro in an isolated environment (`HOME=/tmp/iso7/home` with no claw config, fresh `/tmp/iso7/proj` git-init'd workspace, separated stdout/stderr/exit):
457. **DONE — `claw --resume --help` now shows resume help** — fixed 2026-06-04 in `fix: handle --help after --resume flag`. Added a specific handler for `--help` when `rest` contains `--resume`, so `claw --resume --help` shows resume help instead of consuming `--help` as a session-id literal.
| Invocation | stdout | stderr | exit |
|---|---|---|---|