Fix env install on older uv when exclude-newer-package=false is unsupported#681
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70ae0752ae
ℹ️ 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".
| "--dry-run", | ||
| "--system", | ||
| "--exclude-newer-package", | ||
| "typing-extensions=false", | ||
| "typing-extensions", |
There was a problem hiding this comment.
Avoid network-dependent capability probe for uv flag support
This probe treats uv pip install --dry-run ... typing-extensions success as a proxy for syntax support, but --dry-run still resolves dependencies (per uv pip install --help), so transient resolver failures (offline mode, blocked/default index, auth/TLS issues) can make a new uv look unsupported. In those cases _uv_supports_exclude_newer_package_false() returns False and we skip --exclude-newer-package <pkg>=false, which reintroduces the Hub simple-index filtering failure whenever an exclude-newer cutoff is active.
Useful? React with 👍 / 👎.
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 88f9808. Configure here.

Problem
prime env installunconditionally appends:--exclude-newer-package <normalized_name>=falsefor uv installs against the Hub simple index.
That works on newer uv releases, but issue #667 shows that
uv 0.9.4rejects
<package>=falseand fails before installation starts.Failure mechanism
The current install command builder always emits the per-package
exclude-newerescape hatch inpackages/prime/src/prime_cli/commands/env.py.On older uv versions, the flag only accepts date-like values, so the command
fails with:
invalid value '<pkg>=false' for '--exclude-newer-package ...'Semantic change
This change gates the flag behind a small runtime capability probe.
If the installed uv accepts
<package>=false, we keep the existing behavior.If it does not, we omit the flag so
prime env installremains usable onolder uv versions.
Preserved invariant
We still preserve the existing Hub simple-index workaround on uv versions that
support it.
Testing
Added unit coverage for both branches:
<package>=falseNotes
I also ignored
.codegraph/in.gitignoreto avoid committing local indexartifacts.
Refs #667
Note
Low Risk
Narrow CLI install-path change with unit tests; no auth, secrets, or API contract changes.
Overview
prime env installno longer always passes--exclude-newer-package <pkg>=falsefor Hub simple-indexuvinstalls. Olderuv(e.g. 0.9.4) reject that value and abort before install.A cached runtime probe (
uv --version≥ 0.11.3 plusuv pip install --helpshowing the flag) decides whether to append the per-package opt-out. Supporteduvkeeps the existing Hub workaround; unsupporteduvomits the flag so installs proceed.Unit tests cover the probe and both install-command branches.
.codegraph/is added to.gitignore.Reviewed by Cursor Bugbot for commit d43b789. Bugbot is set up for automated code reviews on this repo. Configure here.