Skip to content

fix: resolve argparse conflict for --credentials-secret in nested configs#437

Open
heathriel wants to merge 1 commit intoeval-protocol:mainfrom
heathriel:heather-sa
Open

fix: resolve argparse conflict for --credentials-secret in nested configs#437
heathriel wants to merge 1 commit intoeval-protocol:mainfrom
heathriel:heather-sa

Conversation

@heathriel
Copy link

@heathriel heathriel commented Mar 16, 2026

Fix: Resolve argparse conflict for --credentials-secret in nested configs

Problem

When running any ep command (e.g. ep logs, ep local-test, ep create rft), the CLI crashes with:

argparse.ArgumentError: argument --azure-blob-storage-config-credentials-secret/--credentials-secret: conflicting option string: --credentials-secret

Root cause

In eval_protocol/cli_commands/utils.py, add_args_from_callable_signature generates CLI flags for nested TypedDict config fields. For each nested field (e.g. azure_blob_storage_config.credentials_secret), it adds:

  1. A full flag: --azure-blob-storage-config-credentials-secret
  2. A short alias: --credentials-secret

Multiple config types (e.g. azure_blob_storage_config, gcs_config) share the same nested field name credentials_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 logs starts successfully (no argparse error)
  • ep create rft --help works
  • Full prefixed flags remain available for all config options

Note

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 argparse option-name conflict when multiple nested config objects expose the same field name (e.g. credentials_secret).

add_args_from_callable_signature now 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.

…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
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