Skip to content

Fix duplicate CLI shorthand flag registration#441

Open
benjibc wants to merge 2 commits intomainfrom
codex/fix-cli-duplicate-cli-flags
Open

Fix duplicate CLI shorthand flag registration#441
benjibc wants to merge 2 commits intomainfrom
codex/fix-cli-duplicate-cli-flags

Conversation

@benjibc
Copy link
Copy Markdown
Contributor

@benjibc benjibc commented Mar 31, 2026

Summary

  • stop duplicate shorthand aliases from breaking CLI parser construction while preserving canonical prefixed flags
  • reserve canonical option strings before registration so nested shorthand aliases cannot steal a later top-level flag
  • add regression coverage for duplicate nested shorthands and top-level canonical flag preservation

Verification

  • /var/folders/d4/gy675hy9779623fysvnk30zc0000gn/T/tmp.IE5N3GKtYD/venv/bin/pytest tests/test_cli_args.py -q
  • /var/folders/d4/gy675hy9779623fysvnk30zc0000gn/T/tmp.IE5N3GKtYD/venv/bin/pytest tests/test_cli_create_rft.py -q -k test_cli_full_command_style_evaluator_and_dataset_flags

Note

Medium Risk
Touches core CLI argument registration logic, so mistakes could break command parsing across multiple commands, but the change is small and covered by new regression tests.

Overview
Prevents add_args_from_callable_signature from registering conflicting option strings by reserving canonical flags up front and only adding alias/shorthand flags when they don’t collide with existing options or other canonical flags.

Adds regression tests ensuring duplicate nested shorthand flags are skipped and that a later top-level canonical flag cannot be “stolen” by an earlier nested shorthand alias. Separately, makes the Hugging Face adapter E2E test skip on common upstream network failures to reduce flakiness.

Written by Cursor Bugbot for commit 9268956. This will update automatically on new commits. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant