docs(roadmap): add #457 — --resume --help vs --resume --version parser asymmetry: --version short-circuits, --help is swallowed as session-id#3070
Open
Yeachan-Heo wants to merge 1 commit into
Conversation
…r asymmetry: --version short-circuits but --help is swallowed as session-id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ROADMAP pinpoint #457 —
--resume --helpand--resume --versiondisagree by parser-arm asymmetryDogfooded for the 2026-05-24 08:00 Clawhip pinpoint nudge (message 1508016732986408983).
Repro (clean isolated env, separated streams)
claw --resume --versionclaw --resume --helpfailed to restore session: session not found: --help…claw --resume versionsession not found: versionclaw --resume helpsession not found: helpclaw --resume listsession not found: listclaw --resume lssession not found: lsclaw --resume showsession not found: showSame parser, same
--resume <ARG>shape, only--versionshort-circuits.Root cause (traced)
parse_argsinrust/crates/rusty-claude-cli/src/main.rs:630-654has asymmetric arms:--resumeat line 762 pushes"--resume"intorestand advances by one:On the next iteration with
rest = ["--resume"]:--helpfails both guards (rest not empty,rest[0] == "--resume"not in allowlist) → catch-allother => rest.push(...)→rest = ["--resume", "--help"]→ resume dispatch treats--helpas session-id positional.--versionmatches its unguarded arm →wants_version = true→ finalif wants_version { return Ok(CliAction::Version { ... }); }(lines 803-805) short-circuits before resume dispatch ever runs.Why distinct from existing items
/session list/switch/fork/delete)-p "test" --help—-p's greedyargs[index+1..].join(" ")swallows everything--helpin their own dispatch (the allowlist comment)claw --helpResume-safe block lies about which commands work--helparm hasrest.is_empty()guard + 4-name allowlist;--versionarm has no guard — under--resume, version works but help does not#117 is the opposite asymmetry:
-pis greedy and absorbs subsequent args.--resumeis correctly non-greedy (advances by one and lets the parser continue) — the bug is purely on the--helparm's guards. Fix is one-line scope.Why it matters
claw --resume <tab><tab>→claw --resume --helpis the natural exploration path. Instead users getsession not found: --helpwith no hint that--helpis a flag.<verb> --version/<verb> --helpparity contract violated. Every otherclaw <verb> --versionandclaw <verb> --helppair returns the corresponding help/version page.--resumeuniquely breaks the--helphalf.session not found: --helpmessage is actively misleading. It implies a malformed session id, not a documentation request. Claw orchestrators parsingkind:"session_not_found"won't realize the human typed--help.help,list,ls,showare all absorbed as session-id literals. There is no CLI way to enumerate sessions — the hint text in those errors directs to/session listwhich is REPL-only.Required fix shape (full detail in ROADMAP entry)
(a) Make
--helpshort-circuit unconditionally, matching--version— droprest.is_empty()guard and 4-name allowlist on the top-level--helparms; letparse_local_help_action()paths do their own dispatch beforeparse_args. (b) CLI-side session enumeration:claw session list/claw sessionsemitting the same{kind:"session_list", sessions:[…], active:<id>}envelope as the REPL/session listso the hint text has a callable CLI parallel. (c) Better wording when the "session id" looks like a flag (starts with-): emitkind:"flag_swallowed_as_session_id"with explicithint. (d) Regression tests asserting all eight--help/-h/JSON-mode variants under--resumeproduceCliAction::Help { … }exit 0.Acceptance check (one-liner)
Should pass, and stdout should contain the help text.
—
[repo owner's gaebal-gajae (clawdbot) 🦞]