Repository navigation
fix: isolate tend's uv from the adopter's - #807
Conversation
tend installed an unpinned uv at $AGENT_HOME/.local/bin, which sits ahead of everything derived from the runner on the sandbox PATH. setup-uv resolves a version from the repo's uv.toml/pyproject.toml and installs to /opt/hostedtoolcache, so tend's copy silently shadowed the version the adopter had chosen — to serve one skill. Split the two uvs by owner. The proxy gets a pinned one (new `uv_version` input) in $RUNNER_TEMP/tend-uv, off $GITHUB_PATH, addressed absolutely by setup-sandbox.sh: the process holding the PAT and model credential now starts from a known binary rather than whatever `setup:` left on PATH. The sandbox gets none — skills needing `uvx tend@...` go through tend-uvx.sh, which installs into a private dir on first use. codex drops its uv step entirely; with no proxy there, nothing consumed it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
tend-agent
left a comment
There was a problem hiding this comment.
Clean split. The proxy uv is pinned, installed off-PATH into a tend-owned dir, and addressed absolutely by the runner-owned process that launches mitmdump, so the credential-holding process no longer starts from whatever the adopter's setup: left on PATH; the agent's uv goes through the off-PATH wrapper; and codex correctly drops its now-unused step. I traced the proxy launch (same runner UID installs and invokes $TEND_UV_DIR/uvx), confirmed CLAUDE_PLUGIN_ROOT is exported under both harnesses so tend-uvx.sh resolves, and checked that every sandbox-context uvx tend@... call is converted.
One stale comment, outside the diff so I couldn't attach an inline suggestion: in claude/action.yaml, the step named Install agent toolchain (sandbox) still opens with # Install the agent toolchain (uv + the claude binary) into the sandbox user's home. — but install-agent-toolchain.sh is now claude-binary-only (its own header was updated to say so). Since the whole point here is making uv ownership legible, that line now contradicts the change. Happy to push a one-line fix dropping the uv + if you'd like.
The step comment still advertised "uv + the claude binary" after the uv install moved out. Rename the step and the script to match their contents. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Good catch — folded in as 376a7f6. Renamed both the step (
|
|
Confirmed — the rename is clean: no |
Bumps the generator to 0.1.13, syncs the lockfile, and adds the CHANGELOG section the release workflow publishes verbatim as the GitHub Release notes. 13 commits since 0.1.12. The release's substance is the security work: the operational secrets move into a gated `tend` deployment environment, with a secretless review-event relay in `tend-mention` and two new `tend check` checks ([#810](#810)), and `tend check` now verifies the bot cannot bypass the merge restriction ([#795](#795)). Alongside those: the `claude-interactive` harness is removed ([#804](#804)), `tend-review` runs the adopter's `setup:` on the base tree rather than the PR's ([#806](#806)), tend's uv is pinned and isolated from the adopter's ([#807](#807)), and the proxy readiness check waits for the port instead of trusting the CA file ([#811](#811)). Adopters have manual work after this ships: the environment gate is inert until each repo's regenerated workflows name the environment and its secrets are re-minted into it. `TODO.md` carries the per-repo recipe. Once this merges: tag `0.1.13`, which publishes to PyPI and creates the GitHub Release, then regenerate tend's own workflows against the published version. > _This was written by Claude Code on behalf of max-sixty_
tend installed an unpinned uv into
$AGENT_HOME/.local/bin, whichsetup-sandbox.shplaces ahead of every PATH entry derived from the runner.astral-sh/setup-uvresolves a version from the repo'suv.toml/pyproject.tomland installs to/opt/hostedtoolcache, which survives the runner-home rewrite as a distinct entry — ranked below.local/bin. So tend's copy silently shadowed the version the adopter had deliberately chosen, in order to serve one skill.There are really two uvs with different owners, and they'd been conflated. The runner's runs mitmproxy; the sandbox's exists only so the agent can run
uvx tend@latest. This splits them.Proxy.
shared/steps/install-proxy-uv.shinstalls a pinned uv (newuv_versioninput) into$RUNNER_TEMP/tend-uvand never touches$GITHUB_PATH;setup-sandbox.shaddresses it absolutely. It replacesensure-uv.sh, which installed unpinned-latest and only whenuvxwas absent — so the process holding the PAT and the model credential started from whatever the adopter'ssetup:happened to leave on PATH. Observed in practice: 0.12.0 on one adopter, 0.12.1 on another, unpinned latest where there was no setup at all.claude_versionandmitmproxy_versionwere already pinned; this brings the third in line.Sandbox.
install-agent-toolchain.shbecomesinstall-claude-binary.sh, installing only that — the step is renamed to match. Skills needinguvx tend@...go throughplugins/tend-ci-runner/scripts/tend-uvx.sh, which installs into$HOME/.tend-uvon first use andexecs through, so arguments pass unchanged. It's idempotent, since shell state doesn't survive between the agent's bash calls.Codex. Drops its uv step entirely — that harness has no proxy, and nothing else consumed it.
agents-tail.md's "uvxis on PATH" claim goes too; it would have become false.Why a shared wrapper rather than an inline install
The first pass had the
nightlyskill install uv inline, on the basis that it was the only consumer ofuvx tend@latestacross the nine bundled skills. Review found a second one:.claude/skills/running-tend/references/integration-test.mdcalls it three times, andrunning-tend/SKILL.mdruns that recipe from the weekly workflow, inside the sandbox. Two consumers means one home.CLAUDE_PLUGIN_ROOTwas already the established path for overlay skills (running-tend/SKILL.mduses it fortoken-report.sh), and the codex action exports it explicitly, so the wrapper resolves under both harnesses.Verified by running rather than by reading: both installers execute end to end and produce
uv/uvxat the expected paths, the wrapper skips the install on repeat calls, andUV_NO_MODIFY_PATH=1leaves no shell profile behind. The generator is untouched, so no generated workflow changes.One thing to know before this lands: the
codex-credential-proxybranch will conflict, since it needs a proxy uv andensure-uv.shis gone. It should adoptinstall-proxy-uv.sh— which is why that script stayed undershared/steps/rather than moving toclaude/.