Skip to content

fix(uv): remove uv run from transparent prefixes to fix rewrite conflicts - #2768

Merged
aeppling merged 3 commits into
rtk-ai:developfrom
guyoron1:fix/uv-transparent-prefix-conflict
Jul 1, 2026
Merged

aeppling merged 3 commits into
rtk-ai:developfrom
guyoron1:fix/uv-transparent-prefix-conflict

Conversation

@guyoron1

@guyoron1 guyoron1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

uv run was listed in both BUILTIN_TRANSPARENT_PREFIXES and RULES, causing a routing conflict:

  • The transparent prefix check would strip uv run and try to match the inner command
  • When the inner command (e.g. python script.py) wasn't RTK-supported, it returned None — no rewrite at all
  • Commands like uv run --unknown pytest or uv run -m pytest were silently dropped

Fix: Remove uv run from BUILTIN_TRANSPARENT_PREFIXES so all uv run commands route through the RULES-based rtk uv path, which delegates to uv_cmd.rs for proper filtering.

Also fixes a compilation issue where print_with_hint signature changed (added guard_raw arg) but uv_cmd.rs wasn't updated.

Changes

  • Remove uv run from BUILTIN_TRANSPARENT_PREFIXES in registry.rs
  • Pass guard_raw arg to print_with_hint in uv_cmd.rs (signature fix)
  • Update tests to reflect new routing: uv run pytest → rtk uv run pytest (not uv run rtk pytest)
  • Apply rustfmt to BUILTIN_TRANSPARENT_PREFIXES array

Test plan

  • Updated existing uv run rewrite tests to match new routing behavior
  • uv run --unknown pytest and uv run -m pytest now rewrite correctly instead of returning None
  • cargo check passes

guyoron1 added 3 commits July 1, 2026 11:12
…icts

uv run was listed in both BUILTIN_TRANSPARENT_PREFIXES and RULES,
causing the transparent prefix check to win and return None when the
inner command (e.g. python script.py) wasn't RTK-supported. Now all
uv run commands route through the RULES-based rtk uv path, which
delegates to uv_cmd.rs for filtering.
@aeppling

aeppling commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Hey @guyoron1 , thanks for this quick correction, LGTM

@aeppling
aeppling merged commit 8cdc861 into rtk-ai:develop Jul 1, 2026
11 checks passed
aeppling added a commit that referenced this pull request Jul 22, 2026
Routing `uv run pytest` to `uv run rtk pytest` recovered the pytest filter,
but it made rtk responsible for reporting a tool uv failed to spawn, and rtk
reports that badly. With mypy absent, `uv run mypy .` returned exit 1 and
"mypy: No issues found" where uv alone returns exit 2 and "Failed to spawn:
mypy". Turning a missing type checker into a clean report is worse than the
tokens the routing saved. It also resolved rtk through the project venv, where
a dependency shipping an `rtk` console script shadows the real binary,
confirmed by placing a stub in .venv/bin.

Reverting to the pre-existing `rtk uv run pytest` form leaves uv to spawn the
tool, so uv keeps reporting its own failures, and keeps #2768's repair intact:
classify_command already treats `uv` as an ordinary supported command, so no
transparent-prefix special case is needed.

Applying the inner tool's filter from outside uv was tried as an alternative
and rejected: it rewrote `ruff clean` into `ruff check clean` so the cache was
never removed, dropped the tool's stderr on successful runs with no tee
written, and reported broken runs as clean. Those root causes are pre-existing
defects in the tool filters and are worth fixing on their own merit, after
which delegation can be reconsidered.

This also removes the conflicts with the open PRs editing rewrite_segment_inner.
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.

2 participants