Commit e0efe9d
fix(agent): retry upstream clones so a GitHub 429 stops failing the image build
`docker compose build` failed on 2 of the last 15 CI runs, always in the
deepsql-agent image, always the same way:
Cloning into 'runtime'...
remote: This request was rate-limited due to too many requests.
fatal: unable to access 'https://github.com/NousResearch/hermes-agent.git/':
The requested URL returned error: 429
exit code: 128
Both clones in agent/Dockerfile are unauthenticated requests to github.com,
issued once with no retry. GitHub rate-limits unauthenticated traffic per
source IP, and Actions runners share pooled egress addresses, so under load
the clone is refused and the whole image build dies with it. Nothing about the
pull request under test is involved, which is why the failure looked random
and landed on unrelated branches.
Both clones now retry up to five times with escalating backoff (15/30/45/60s).
The condition is genuinely transient, so retry is the correct layer rather
than a mask: on the final attempt the loop still prints FATAL and exits 1, so
an upstream that is actually gone fails the build loudly instead of producing
an image with no runtime in it.
This is not CI-only defensiveness. `scripts/self-host/install.sh` runs the
same build, so a self-host user behind a shared NAT hits the identical refusal.
Note the webui clone's existing `||` fallback only ever handled a *moved ref*;
against a rate-limit it re-issued the same refused request, so it needed the
outer retry to be of any use.
Verified: both RUN blocks pass `sh -n` as the shell receives them; the wrapper
clones hermes-agent for real (exit 0), and against an unreachable repo it
retries 5x and exits 1.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 1fbaaf1 commit e0efe9d
1 file changed
Lines changed: 30 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
49 | 65 | | |
50 | 66 | | |
51 | 67 | | |
| |||
56 | 72 | | |
57 | 73 | | |
58 | 74 | | |
59 | | - | |
60 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
61 | 87 | | |
62 | 88 | | |
63 | 89 | | |
| |||
0 commit comments