fix(install): give the proxy uv install the same retry window - #907
fix(install): give the proxy uv install the same retry window#907tend-agent wants to merge 1 commit into
Conversation
tend-agent
left a comment
There was a problem hiding this comment.
The retry loop is now byte-identical in install-claude-binary.sh and install-proxy-uv.sh with no shared source of truth, so the next adjustment to the window — or a bug in the jitter expression — has to be found and applied twice, and the two rationale comments already differ in wording while describing the same policy. The repo has the mechanism for this: shared/steps/lib/run-issue.sh is sourced by both rate-limit-preflight.sh and report-failure.sh via . "${SCRIPT_DIR}/lib/run-issue.sh". Extraction isn't free here, though — the claude copy runs inside sudo -u "$SANDBOX" env … bash <<'EOF' as the sandbox user, so a sourced helper would need the lib path threaded through that env and the file readable by the sandbox UID, which I haven't verified. A follow-up rather than a change to this PR, but worth deciding deliberately: the duplication is what lets the two windows drift apart later.
Nothing else — the loop tracks #906 line for line, shellcheck -S warning is clean on the modified script, and the four new tests fail against the base branch's script in exactly the three places the PR body claims.
|
Extracted, in #908, stacked on this branch so the diff there is only the extraction. The sandbox boundary you flagged as unverified is real, and it rules out the obvious approach: Concatenating the lib onto the front of the stdin stream sidesteps it — the file is read on the runner side of the privilege drop, and cat "${SCRIPT_DIR}/lib/retry.sh" - <<'EOF' \
| sudo -u "$SANDBOX" env HOME="$AGENT_HOME" … bash
set -euo pipefail
retry_install "claude $CLAUDE_VERSION" \
"curl -fsSL https://claude.ai/install.sh | bash -s -- '$CLAUDE_VERSION'"
EOFOne correction to the review: the two loops aren't byte-identical — the fetched command and both echo strings differ, so what's shared is the five lines of window mechanics ( The eight tests from #906 and #907 pass unmodified against the lib, which is the useful signal: the window is now asserted from both sides of the Left this PR alone rather than folding the extraction in — but if three PRs for one window is worse than a slightly wider one, squashing #908 into this branch loses nothing. |
Stacked on #906 — based on its branch, so the diff here is only the
install-proxy-uv.shhalf. GitHub retargets this tomainwhen #906 merges.Problem
#906 widens the retry window on
install-claude-binary.shafter a CDN 403 burst costreview-reviewersa matrix leg. Reviewing it surfaced thatshared/steps/install-proxy-uv.shcarries the identical loop —for i in 1 2 3,sleep $((i * 5)),after 3 attempts— and shares every property the rationale rests on:claude/action.yaml), ~80 lines ahead of the claude install, so it is equally ahead of the agent step and equally invisible toReport failure, which is gated onsteps.claude.outcome == 'failure'. A run lost here files notend-outagerow.review-reviewerslegs at once, so a rate limit hits them together and an unjittered backoff has them retry together.A 403 from
astral.shinstead ofclaude.ailoses the leg identically. Fixing only the claude half leaves the exposure roughly halved rather than closed.Change
Same shape as #906: five attempts, exponential backoff, jitter — 5, 10, 20, 40 seconds plus 0–9s each. Happy path unchanged (one fetch, no sleep).
Worth stating the same ceiling caveat: when
curlfails fast the added cost to a doomed install is ~95s; when the CDN hangs, each attempt burns the fulltimeout 60and the worst case goes from ~195s to ~411s.Tests
install-proxy-uv.shhad no test coverage at all. Four tests added, reusing the fixture pattern #906 establishes (_fake_bin,FAKE_SLEEP_RECORDING, the attempt/sleep readers) with acurlfake that emits astral's installer shape — read on stdin bysh -s --, so it stays POSIX rather than bash. Reusing those helpers is why this is stacked rather than parallel; the alternative was a second copy of each fake and a conflict at the end of the file.Three of the four fail against the pre-fix script:
[5, 10]Full generator suite: 387 passed.
shellcheck -S warningclean on the modified script;ruff checkandruff format --checkclean.