Repository navigation
fix(mcpx): docs-twins trailing value flag is a usage error, not a panic - #16406
Conversation
parseFlags indexed args[i] after i++ with no bounds check for --docs, --agents, --out and --history-bin, so a trailing value-taking flag panicked with a Go stack trace. Bounds-check and return '<flag> requires a value', which main already prints to stderr with exit 2. Regression test covers each value-taking flag in trailing position and valid parsing unchanged. Closes #16401
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Verification (lane 2037-A-F, metadata only, no CI logs read): fleet-command run 46099376833 (developing-today/fleet) dispatched on ref xaltha/16401-docs-twins-trailing-flag, command |
Closes #16401
docs-twinsparseFlagsdidi++; cfg.X = args[i]for--docs,--agents,--outand--history-binwith no bounds check, so a trailing value-taking flag panicked with a Go runtime stack trace — the #3312 class in the tool the #3353 inventory missed.Fix: bounds-check in
parseFlagsand return"<flag> requires a value";mainalready prints parse errors to stderr and exits 2, matching the tool's ownunknown argument %qconvention and the #3352 operator-script argument contract. All valid invocations parse exactly as before.Regression test
TestParseFlagsTrailingValueFlagIsUsageErrorcovers each value-taking flag in trailing position (alone and after valid flags) and asserts valid parsing is unchanged.Verification: remote dispatch only (fleet-command), conclusion recorded on this PR; no CI logs read.
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-28T02:42:03Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "bbfc8aa3a3b4f3e3d399b7e76beb6962c0daa5b9" }, "auth_subject": "xaltha", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.