Skip to content

fix: adapter resolution in wheels, eager-help crash, installer hardening (#367 follow-up) - #368

Merged
plind-junior merged 3 commits into
testfrom
fix/fresh-install-followups
Jul 6, 2026
Merged

fix: adapter resolution in wheels, eager-help crash, installer hardening (#367 follow-up)#368
plind-junior merged 3 commits into
testfrom
fix/fresh-install-followups

Conversation

@plind-junior

Copy link
Copy Markdown
Member

an adversarial review pass over #367 (four independent lenses, findings re-verified empirically) caught one blocker and a handful of hardening gaps in that PR. this lands the fixes before 1.2.0 ships them.

the blocker: #367 force-included adapters/ into the wheel but the resolver hunk never made the branch — ADAPTERS_DIR still walked three parents up from the module, so installed wheels contained the templates and still failed vouch install-mcp with "(available: (none))". the resolver now falls back to the packaged vouch/adapters/ copy; checkouts and editable installs keep preferring the repo directory. the wheel-contents test could not catch this (a wheel can carry files the resolver misses), so a second regression test unpacks the built wheel, imports that copy with no repo checkout in sight, and asserts available_adapters() finds claude-code — it fails on current test/main.

second: vouch --help still crashed under latin-1 stdio. click renders eager --help/--version during argument parsing, before the group callback from #367 could reconfigure anything, and the group docstring's em dash is unrepresentable in latin-1. _force_utf8_stdio() now runs at module import (idempotent, no-op on utf-8 streams), and the stdio regression test is parametrized over status and --help. relatedly, capture.load_config's except tuple now includes UnicodeDecodeError, which the pinned-utf-8 read can raise on a hand-edited latin-1 config — it previously escaped the documented fall-back-to-defaults contract.

third, installer hardening: ~/.local/bin is probed before deciding pipx is missing (fresh non-login shells often lack it on PATH, which made an installed pipx look absent and a needless private venv shadow it — the symlink also refuses to overwrite an existing entry now); the private venv is recreated from scratch on re-runs (brew pythons ship read-only activate scripts, so venv-over-existing dies with EACCES); and pip failures are no longer all announced as "refused (PEP 668)" with the output discarded — attempts log to $TMPDIR and the final error prints the last lines.

verified: full suite green; both new tests proven to fail against current test; install.sh exercised in a throwaway $HOME under LANG=en_US.ISO-8859-1 — fresh run and two re-runs all succeed, vouch --help and vouch status included.

one known-inert leftover for a future pass: hatchling applies the force-include to editable wheels too, so pip install -e drops a stale physical vouch/adapters snapshot into site-packages. imports still resolve to the repo and ADAPTERS_DIR prefers the checkout, so nothing misbehaves today.

pr #367 force-included adapters/ into the wheel but the resolver hunk
never made the branch: ADAPTERS_DIR still walked three parents up from
the module — the repo root in a checkout, but <prefix>/lib/pythonX.Y/
in an installed wheel. installed copies therefore *contained* the
templates yet still failed install-mcp with "(available: (none))".

prefer the repo-root directory when it exists (checkouts, editable
installs) and fall back to the packaged vouch/adapters/ otherwise.

the wheel-contents regression test could not catch this — a wheel can
carry the files while the resolver misses them — so a second test now
unpacks the built wheel, imports that copy with no repo checkout in
sight, and asserts available_adapters() finds claude-code.
click renders --help and --version during argument parsing, before any
group callback runs — and the group docstring's em dash already
crashes a latin-1 stdout. so the callback-scoped _force_utf8_stdio()
from #367 left the very first command a fresh user is likely to type
(`vouch --help`) raising UnicodeEncodeError. run it at module import
instead; it is idempotent and a no-op on utf-8 streams.

also widen capture.load_config's except: reading config.yaml with
pinned utf-8 can now raise UnicodeDecodeError on latin-1 bytes (e.g. a
hand-edited config on exactly the hosts this fix targets), which
escaped the (OSError, YAMLError) tuple and broke the documented
fall-back-to-defaults contract.

the stdio regression test is parametrized over `status` and `--help`;
the help case fails against the callback-scoped variant.
three hardening fixes for the pep 668 fallback from #367:

- probe ~/.local/bin *before* deciding pipx is missing: fresh
  non-login shells often lack it on PATH, so an installed pipx looked
  absent and a needless private venv shadowed it. the symlink into
  ~/.local/bin now also refuses to overwrite an existing entry.
- recreate the private venv from scratch on re-runs: brew pythons
  ship read-only activate scripts, so `python -m venv` over a previous
  run's env dies with EACCES.
- stop announcing every pip failure as "refused (PEP 668)" and stop
  discarding installer output: attempts log to $TMPDIR and the final
  error prints the last lines, so a missing python3-venv or a network
  outage is diagnosable from the terminal.
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4ba11396-9b46-43fe-9349-e15dd6db71a5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/fresh-install-followups

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added cli command line interface adapters agent host adapters and install manifests tests tests and fixtures size: S 50-199 changed non-doc lines labels Jul 6, 2026
@plind-junior
plind-junior merged commit 67dbcd8 into test Jul 6, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adapters agent host adapters and install manifests cli command line interface size: S 50-199 changed non-doc lines tests tests and fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant