You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unwrap uv run <tool> and uvx <tool> before registry lookup #1205
RTK should unwrap uv run <tool> and uvx <tool> prefixes before registry lookup, enabling existing filters to match the underlying tool; high impact given 3500+ currently unfiltered invocations.
Triaged automatically by wshm · This is an automated analysis, not a human review.
Adding usage data: rtk discover reports 11 uvx commands in the last 30 days, all unhandled. Common pattern: uvx --with google-auth --with google-api-python-client script.py. Unwrapping before registry lookup would capture these.
v0.43.0 regressed this into silent test-loss (rewrites to uv run rtk pytest)
Heads-up for anyone landing here: the v0.43.0 fixes (hook: rewrite pytest under uv runc8722bd, hook: treat uv run as a transparent prefix34441dd) don't produce the expected rtk pytest — on a clean 0.43.0 install the hook now rewrites uv run pytest to uv run rtk pytest, which is worse than the pre-fix "no rewrite" behavior because it silently collects 0 tests instead of running them.
Environment: rtk 0.43.0, Windows 11, global hook installed via rtk init -g.
Repro:
$ rtk rewrite "uv run pytest tests/"uv run rtk pytest tests/ # expected per this issue: rtk pytest tests/
The consequence is a false green/false red, not an error:
$ uv run rtk pytest --collect-only -q # what the hook executesPytest: No tests collected
$ uv run pytest --collect-only -q # raw, correct...1398 tests collected
uv run rtk pytest invokes rtk inside the uv environment, and pytest then runs outside uv's managed interpreter, so collection silently returns nothing. Because it exits cleanly, an agent reading the output concludes "no tests" rather than surfacing a failure.
I also confirmed the documented knobs don't help on 0.43.0:
[hooks] transparent_prefixes = ["uv run"] — no effect (still uv run rtk pytest)
[hooks] exclude_commands = ["uv run"] / ["uv"] — no effect
[hooks] exclude_commands = ["pytest"] — stops the broken rewrite, but then output is unfiltered (no savings)
A trusted project-local .rtk/filters.toml with match_command = "^uv run pytest" does not override the built-in rewrite
Working workaround (correct results and RTK's real pytest filter):
rtk run "uv run pytest -q 2>&1"| rtk pipe -f pytest
rtk run "..." is left untouched by the hook, so pytest runs correctly in uv's environment; rtk pipe -f pytest then applies the built-in pytest filter. Verified: a passing run collapses to Pytest: N passed, and failures keep full detail (test name, file:line, and the assertion message). This keeps uv run pytest intact rather than reconstructing it as rtk pytest, which sidesteps the environment-reconstruction problem entirely.
Suggest reopening/relabeling since the intended uv run pytest → rtk pytest unwrap from this issue hasn't landed correctly.
Activity
pszymkowiak commentedon Apr 10, 2026
🔍 Automated Triage
featurehighSummary
RTK should unwrap
uv run <tool>anduvx <tool>prefixes before registry lookup, enabling existing filters to match the underlying tool; high impact given 3500+ currently unfiltered invocations.Triaged automatically by wshm · This is an automated analysis, not a human review.
etaseoul-jason commentedon Apr 13, 2026
Adding usage data:
rtk discoverreports 11uvxcommands in the last 30 days, all unhandled. Common pattern:uvx --with google-auth --with google-api-python-client script.py. Unwrapping before registry lookup would capture these.feat(uv): add `rtk uv run <tool>` support for Python filters (rtk-ai#…
ahringer commentedon Jul 16, 2026
v0.43.0 regressed this into silent test-loss (rewrites to
uv run rtk pytest)Heads-up for anyone landing here: the v0.43.0 fixes (
hook: rewrite pytest under uv runc8722bd,hook: treat uv run as a transparent prefix34441dd) don't produce the expectedrtk pytest— on a clean 0.43.0 install the hook now rewritesuv run pytesttouv run rtk pytest, which is worse than the pre-fix "no rewrite" behavior because it silently collects 0 tests instead of running them.Environment: rtk 0.43.0, Windows 11, global hook installed via
rtk init -g.Repro:
The consequence is a false green/false red, not an error:
uv run rtk pytestinvokes rtk inside the uv environment, and pytest then runs outside uv's managed interpreter, so collection silently returns nothing. Because it exits cleanly, an agent reading the output concludes "no tests" rather than surfacing a failure.I also confirmed the documented knobs don't help on 0.43.0:
[hooks] transparent_prefixes = ["uv run"]— no effect (stilluv run rtk pytest)[hooks] exclude_commands = ["uv run"]/["uv"]— no effect[hooks] exclude_commands = ["pytest"]— stops the broken rewrite, but then output is unfiltered (no savings).rtk/filters.tomlwithmatch_command = "^uv run pytest"does not override the built-in rewriteWorking workaround (correct results and RTK's real pytest filter):
rtk run "..."is left untouched by the hook, so pytest runs correctly in uv's environment;rtk pipe -f pytestthen applies the built-in pytest filter. Verified: a passing run collapses toPytest: N passed, and failures keep full detail (test name,file:line, and the assertion message). This keepsuv run pytestintact rather than reconstructing it asrtk pytest, which sidesteps the environment-reconstruction problem entirely.Suggest reopening/relabeling since the intended
uv run pytest → rtk pytestunwrap from this issue hasn't landed correctly.