fix: resolve argparse conflict for --credentials-secret in nested configs#437
Open
heathriel wants to merge 1 commit intoeval-protocol:mainfrom
Open
fix: resolve argparse conflict for --credentials-secret in nested configs#437heathriel wants to merge 1 commit intoeval-protocol:mainfrom
heathriel wants to merge 1 commit intoeval-protocol:mainfrom
Conversation
…figs When multiple config TypedDicts (e.g. azure_blob_storage_config, gcs_config) share the same nested field name (e.g. credentials_secret), add_args_from_callable_signature was adding the short alias --credentials-secret for each, causing argparse to fail: ArgumentError: argument --azure-blob-storage-config-credentials-secret/--credentials-secret: conflicting option string: --credentials-secret Fix: Omit the short alias for nested fields. Callers can still use the full prefixed flag (e.g. --azure-blob-storage-config-credentials-secret). Made-with: Cursor
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.
Fix: Resolve argparse conflict for
--credentials-secretin nested configsProblem
When running any
epcommand (e.g.ep logs,ep local-test,ep create rft), the CLI crashes with:Root cause
In
eval_protocol/cli_commands/utils.py,add_args_from_callable_signaturegenerates CLI flags for nested TypedDict config fields. For each nested field (e.g.azure_blob_storage_config.credentials_secret), it adds:--azure-blob-storage-config-credentials-secret--credentials-secretMultiple config types (e.g.
azure_blob_storage_config,gcs_config) share the same nested field namecredentials_secret. Each one registers--credentials-secret, causing argparse to fail because the same option string cannot be registered twice.Solution
Remove the short alias for nested fields. Callers can still use the full prefixed flag (e.g.
--azure-blob-storage-config-credentials-secret). This eliminates the conflict while preserving functionality for users who need these options.Testing
ep logsstarts successfully (no argparse error)ep create rft --helpworksNote
Medium Risk
Changes the CLI surface by removing the unprefixed
--<field>alias for nested TypedDict options, which may break scripts relying on those short flags, but it resolves a crash from duplicate option registration.Overview
Fixes an
argparseoption-name conflict when multiple nested config objects expose the same field name (e.g.credentials_secret).add_args_from_callable_signaturenow stops generating the extra unprefixed nested alias (e.g.--credentials-secret) and only registers the fully-prefixed flag (e.g.--azure-blob-storage-config-credentials-secret), plus any explicitly provided aliases.Written by Cursor Bugbot for commit f53a578. This will update automatically on new commits. Configure here.