Repository navigation
fix(proxy): put the mitmproxy cache warm on the shared retry window - #912
Closed
tend-agent wants to merge 1 commit into
Closed
tend-agent wants to merge 1 commit into
tend-agent wants to merge 1 commit into
Conversation
This was referenced Aug 9, 2026
proxy: the mitmproxy cache warm is the fourth pre-agent reach, and it's not on the retry window
#911
Closed
max-sixty
pushed a commit
that referenced
this pull request
Aug 11, 2026
…will convert (#914) ## Problem Filing an issue in this repo is not a note to a maintainer — `tend-triage` fires on `issues`. Twice in 66 minutes this morning a run filed an issue describing a fix it had already fully scoped, and triage then re-derived that fix from the issue body and opened the PR: | Issue filed | Triage boots | Turns / cost | PR opened | |---|---|---|---| | [#909](#909) 07:18:53Z | [31300864191](https://github.com/max-sixty/tend/actions/runs/31300864191) 07:18:56Z | 64 / $4.08 | [#910](#910) `fix/issue-909` 07:25:17Z | | [#911](#911) 07:39:37Z | [31301666194](https://github.com/max-sixty/tend/actions/runs/31301666194) 07:39:40Z | 58 / $4.20 | [#912](#912) `fix/issue-911` 07:49:37Z | Three seconds from issue to triage boot in both cases. Neither issue was under-specified: #909 named `codex/action.yaml:120-124` and proposed extracting to `shared/steps/install-codex-cli.sh` sourcing `lib/retry.sh`; #911 named `proxy/setup-sandbox.sh:319` and proposed the same treatment. Both PRs implemented exactly the proposal. Triage's own session log confirms the conversion — run 31300864191's artifact is `claude-session-logs-n909`, and it ran `gh pr create --head fix/issue-909`, classifying the reporter as "the bot's own review of #908". So the issue bought nothing and cost $8.28 of agent time plus two threads. The filing run could have opened both PRs itself. <details><summary>Wider context — the cascade this sat inside</summary> A single transient CDN 403 lost one matrix leg of `review-reviewers` run [31297986524](https://github.com/max-sixty/tend/actions/runs/31297986524) at 06:03Z (`curl: (22) ... 403`, three attempts inside 15.7 s, the other four legs installing the same version from the same runner at the same moment succeeded). Between 06:29Z and 07:56Z that produced #906, #907, #908, #909, #910, #911 and #912 — five stacked PRs and two issues, none merged, across ~14 agent runs and roughly $30 at list prices. The engineering is sound and correctly atomic; this PR does not argue with any of it. Only the two issue hops are pure overhead, and they are the part with a mechanical fix. </details> ## Solution A short section in `running-in-ci` — the skill every workflow loads — stating that an issue in this repo is picked up by triage, so a fix you can already scope should be opened as a PR in the same run. The escape hatches stay: too large or ambiguous to fix, needs a maintainer decision, or verification is out of reach from CI. This generalizes a rule that already exists but only in two skills: `review-runs` ("Issue (fallback): Only for problems too large or ambiguous to fix directly") and `review-reviewers` carry it, so the runs that have it don't do this. The runs that did — a `tend-review` session and a `tend-mention` session — load neither. ## Gate assessment - **Evidence level**: High — 2 occurrences this window, and the self-amplifying-output family has been recorded in prior windows (2026-08-04: review→fix ping-pong over five rounds; two bot PRs seven minutes apart on one root cause). - **Structural**: yes for the costly half. The bot's choice to file rather than fix is stochastic, but once an issue exists the triage conversion has no decision point — it fires on the `issues` event every time. - **Change type**: targeted fix (one short section), normal evidence bar. - **Both gates**: pass. Found by `/tend-ci-runner:review-runs` on run [31302531474](https://github.com/max-sixty/tend/actions/runs/31302531474). --------- Co-authored-by: tend-agent <[email protected]>
Owner
|
Closing with #906 — the reason is there.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
lib/retry.shcovers three pre-agent third-party reaches. There is a fourth:proxy/setup-sandbox.shwarms the uvx cache before backgrounding the proxy, and on a cache miss that resolves and downloads mitmproxy from PyPI. The script runs underset -euo pipefail, and its step —Set up credential-isolation sandbox— sits three steps ahead ofRun Claude, so a PyPI blip there loses the whole run having done none of the work the trigger asked for.The miss is scheduled rather than rare: the
actions/cachekey is version-scoped (tend-mitmproxy-${{ runner.os }}-${{ inputs.mitmproxy_version }}), so everymitmproxy_versionbump misses on each workflow's first run — which is exactly when a lost run is most expensive, since it reddens the weekly bump PR that carries the security-relevant pin.Solution
Source the shared lib from
setup-sandbox.shand wrap the warm inretry_install. The source sits up top, next to the env checks, so a wrong path fails before the user creation and the workspace chown rather than mid-setup.Stacked on #910 — the lib it sources lands there.
The two questions #911 left open
Is 60s enough for a cold mitmproxy resolve? Yes, with room to spare. The
~20s resolvefigure inclaude/action.yamlwas undated and is now wrong. Measured on a GitHub-hosted runner (this triage job), 2026-08-09, withuv 0.12.3and the pinnedmitmproxy==12.2.3:UV_CACHE_DIR(43 packages, ~100MB downloaded)So no third
TIMEOUTparameter is needed — the case #909 raised and #910 declined stays declined. This PR also corrects the stale figure in the action comment, keeping the cache's real justification (not re-pulling ~100MB from PyPI on every run) rather than the seconds.Does the backgrounded
mitmdumpneed its own retry? No — retrying the warm already covers it. The launch sharesUV_CACHE_DIR, and a cache warmed by this line serves the same--frominvocation with no network at all:Once the warm succeeds, PyPI is off the launch path, so the
nohup-plus-readiness-wait shape never has to be retried. That's recorded in the comment at the warm.Testing
Two tests in
generator/tests/test_shared_steps.py, both failing before the change:test_setup_sandbox_resolves_the_shared_retry_windowruns the script's own. "${ACTION_PATH}/…"line (matched by content, not position) withACTION_PATHset the way the action sets it, and assertsretry_installbecomes a defined function. A path that doesn't resolve wouldn't degrade to an unretried warm — underset -euo pipefailit loses every run, not just the ones that hit a blip.test_setup_sandbox_warms_the_mitmproxy_cache_through_the_windowasserts the warm is an argument toretry_installrather than a bare command.The second is a call-site assertion rather than the behavioural suite the three installers get.
setup-sandbox.shcreates the sandbox user, chowns the workspace and installs a CA before reaching the warm, so faking a path to that line would assert more about the fakes than about the script; what the window itself does is already covered by the installer suites. Flagging the asymmetry rather than hiding it.pre-commit run(shellcheck, ruff, actionlint) and the full 393-test generator suite pass.Closes #911 — automated triage