[codex] Add env config discovery and doctor commands#650
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1947c7e5ae
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c050106. Configure here.
| positional_args.append(positional_env_id) | ||
| break | ||
|
|
||
| return func(*positional_args, **accepted) |
There was a problem hiding this comment.
Positional arg conflicts with keyword arg causing TypeError
Low Severity
_call_with_supported_kwargs can raise a TypeError ("got multiple values for argument") when the unmatched required positional parameter is not the first parameter. The positional_env_id is prepended via *positional_args, so Python maps it to the function's first parameter. If that first parameter is already present in accepted as a keyword arg, Python raises a conflict. The positional value fills the wrong slot — it needs to target the unmatched parameter specifically (e.g., by inserting into accepted as a keyword instead of prepending as a positional).
Reviewed by Cursor Bugbot for commit c050106. Configure here.


Summary
prime env configwith text, JSON, TOML, and--resolvedoutput modes backed by Verifiers-owned typed config introspection.prime env doctorchecks for eval-style environment resolution, package import, typedload_environment(config)loading, config-surface rendering, Verifiers structured diagnostics, pyproject config diagnostics, and optional--smoke.Validation
uv run ruff check packages/prime/src/prime_cli packages/prime/tests/test_env_config_doctor.pyuv run ty check packages/prime/src/prime_cli/env_config.py packages/prime/src/prime_cli/commands/env.py packages/prime/tests/test_env_config_doctor.pyuv run pytest packages/prime/tests/test_env_config_doctor.py -quv run pytest packages/prime/tests -q(709 passed, 4 skipped, 1 warning)Notes
Note
Medium Risk
Adds new CLI commands that dynamically import and execute verifiers introspection/diagnostics (and optionally trigger a smoke eval), so failures or API mismatches could impact CLI behavior despite being mostly additive.
Overview
Adds
prime env configto display an environment’s config surface intext,toml, or machine-readablejson, with--resolvedsupport and JSON-safe stdout behavior.Adds
prime env doctorto validate that an environment resolves/imports,load_environment(config)works with a typedEnvConfig, the config surface can render, and to report structured diagnostics (including optional--smokeeval execution).Introduces new
prime_cli/env_config.pyhelper module to discover verifiers’ config-introspection APIs across versions, adapt to differing function signatures/renderers, and format doctor results; includes comprehensive CLI tests covering output modes and common failure/diagnostic scenarios.Reviewed by Cursor Bugbot for commit c050106. Bugbot is set up for automated code reviews on this repo. Configure here.