Skip to content

Fix env install on older uv when exclude-newer-package=false is unsupported#681

Open
peter941221 wants to merge 3 commits into
PrimeIntellect-ai:mainfrom
peter941221:fix/env-install-uv-exclude-newer-compat
Open

Fix env install on older uv when exclude-newer-package=false is unsupported#681
peter941221 wants to merge 3 commits into
PrimeIntellect-ai:mainfrom
peter941221:fix/env-install-uv-exclude-newer-compat

Conversation

@peter941221
Copy link
Copy Markdown

@peter941221 peter941221 commented May 24, 2026

Problem

prime env install unconditionally appends:

--exclude-newer-package <normalized_name>=false

for uv installs against the Hub simple index.

That works on newer uv releases, but issue #667 shows that uv 0.9.4
rejects <package>=false and fails before installation starts.

Failure mechanism

The current install command builder always emits the per-package
exclude-newer escape hatch in
packages/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 install remains usable on
older 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:

  • omit the flag when uv lacks support
  • keep the flag when uv supports <package>=false

Notes

I also ignored .codegraph/ in .gitignore to avoid committing local index
artifacts.

Refs #667


Note

Low Risk
Narrow CLI install-path change with unit tests; no auth, secrets, or API contract changes.

Overview
prime env install no longer always passes --exclude-newer-package <pkg>=false for Hub simple-index uv installs. Older uv (e.g. 0.9.4) reject that value and abort before install.

A cached runtime probe (uv --version0.11.3 plus uv pip install --help showing the flag) decides whether to append the per-package opt-out. Supported uv keeps the existing Hub workaround; unsupported uv omits 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.

@peter941221 peter941221 marked this pull request as ready for review May 24, 2026 23:59
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +134 to +138
"--dry-run",
"--system",
"--exclude-newer-package",
"typing-extensions=false",
"typing-extensions",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread packages/prime/src/prime_cli/commands/env.py Outdated
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