Repository navigation
fix(aggregator): record-claude-launch rejects unknown/misspelled/joined/duplicate args - #7342
Merged
Merged
Conversation
…ed/duplicate args (fixes #7332)
|
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 21 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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Fixes #7332
record-claude-launchprobed argv withindexOfonly (arg()at :47,taskRefsflatMap at :65), so unknown tokens were silently ignored — the unknown-token half left after #3415/#6895 hardened the values:--tas developing-today/code#123(typo) → record appended with no taskRefs — the session↔task linkage the script exists to create is gone, exit 0--task=developing-today/code#123(joined) → same dropped linkage, exit 0--fil <intended.jsonl>(typo) → record written to the default registry file, not the intended one, exit 0--stats done/--modle sonnet/--parnt sess-123(typos) and--model=sonnet(joined) → defaults/null/missing fields recorded, exit 0--label/--id→ first value silently wins, exit 0Verified pre-fix on the laptop at main
36e5b3eb46with the real script run verbatim (md541403504aadfa51193d0de228c9c829d, probe~/git/fleet/probe-claude-launch-unknown-args, fakeHOMEfor the default-file case); the documented control invocation recorded exactly what it named.Change
scripts/record-claude-launch.ts:rejectUnknownArgs()runs before any file is resolved or written — mirrors the settled sibling fixes (aggregator(append-usage-snapshots): unknown or misspelled flags are silently ignored — a typo'd --from-provider-usage silently runs the wrong derivation mode and exits 0 #6961, aggregator(generate-digest): unknown/misspelled flags silently ignored — typo --knd archives a daily digest, typo --no-delivre delivers anyway #7097, aggregator(collect-github-billing): unknown/misspelled flags are silently ignored — a typo'd --yer collects the current month, and a typo'd --prnit turns a dry run into a real outbox append #7254, aggregator(post-alert): unknown/misspelled flags are silently ignored — a typo'd --severty posts a warning incident as critical, a typo'd --bodi drops the body, exit 0 #7289, aggregator(produce-charge-candidates): unknown/misspelled/joined/duplicate args silently ignored — typo'd --skip-gmial runs Gmail, typo'd/joined --start silently defaults the period #7302). Every documented flag takes a value;--taskis the only repeatable one. Unknown, misspelled, joined, duplicate, and stray tokens are usage errors (exit 2, token named), and a flag-as-value/missing/empty value keeps the aggregator(record-claude-launch): a flag token is accepted as the previous flag's value — '--task --model x' records taskRefs ['--model'], '--label --id x' records a session named '--id', exit 0 #3415/aggregator(record-claude-launch): empty flag values are recorded verbatim — '--id ""' appends a session with no id, '--parent ""' a parent that is not null, exit 0 #6895requires a valuewording, raised at the same scan.test/record-claude-launch-unknown-args-7332.test.ts: new pinning suite — control (documented invocation with repeated--taskrecords exactly what it names) plus 10 bad arg sets asserting exit 2, the offending token named, and no record appended to the intended file or the default file.Verification
--tas …→ exit 2unknown argument "--tas"with no file written;--fil …→ exit 2 with no default file created; control → exit 0 with taskRefs recorded.bunx tsc --noEmit: 1 error, identical on clean main (pre-existing, intest/roadmap-annotations.test.ts); none in the touched files.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.