Repository navigation
A real release download finishes: the 3-second check clock no longer covers the asset - #1110
Merged
Merged
Conversation
The release client was built as http.Client{Timeout: 3s} because three seconds
is right for the launch check, and Go's Client.Timeout covers the WHOLE
exchange including every body byte. The same client then downloaded the
release asset, so a 57 MB download on a healthy link — about eight seconds
here — was cut off three seconds in and a person read `read the release
response: context deadline exceeded`.
Client.Timeout is gone. The transport bounds only what has made no progress: a
5 s dial, a 5 s TLS handshake, a 10 s wait for response headers. Every call now
takes its deadline from its context. The launch notice and `--check` share the
one CheckTimeout constant, install metadata gets 10 s per request, and the
asset gets a 30-second no-byte stall window plus a 15-minute ceiling — a dead
link fails with a sentence, a slow one finishes.
No Go deadline text reaches a person. A stall says `downloading
codeaf-linux-amd64 stalled — no bytes for 30 s`, the ceiling says `took longer
than 15 minutes`, and late headers say `did not start arriving within 10 s`.
The stall window, the ceiling and the metadata window are injectable, so the
tests prove the clocks with real slow, silent and trickling servers rather than
waiting out the shipped ones.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
`codeaf update` and the chat surface each spelled `3*time.Second` when they built the release client, which is how a figure meant for one small request came to govern an install. Both now pass update.CheckTimeout, and the three seconds live in exactly one place. The terminal's `--check` takes the client's Check, which is the whole-exchange check deadline; a plain `codeaf update` keeps Select, so the metadata requests an install makes get the ten seconds they need. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
What failed
On the published
staging-20260917-fa252d69d6dcline (PR #1060), neithercodeaf updatenor/updatecould finish over the real network. Both endedwith:
Deterministic, 3/3, by two independent drivers.
The cause is arithmetic. Both doors built the release client with
update.NewClient(rev, 3*time.Second)— the budget for the small launch check— and that became
http.Client{Timeout: 3s}, which in Go covers the WHOLEexchange including every body byte. The same client downloaded the release
asset:
codeaf-linux-amd64is 57,532,578 bytes and a plain curl of it takesabout 8.6 s here. Three seconds could never cover it.
--checkpassedeverywhere because its response is a few KB, and every earlier hand test used a
local mirror that serves 57 MB in milliseconds.
The new clocks
Client.Timeoutis gone. The transport bounds only what has made no progress —a 5 s dial, a 5 s TLS handshake, a 10 s wait for response headers — and every
call takes its deadline from its context:
codeaf update --checkCheckTimeoutconstant both doors readA dead connection still fails with a sentence; a slow one now succeeds. No Go
deadline text reaches a person any more: a stall says
downloading codeaf-linux-amd64 stalled — no bytes for 30 s, the ceiling saystook longer than 15 minutes, late headers saydid not start arriving within 10 s. Theterminal road still ends with the curl line and the chat road still offers it.
The stall window, the ceiling and the metadata window are injectable, so the
new tests prove each clock against real slow, silent and trickling servers
instead of waiting out the shipped durations.
Proved on the real network
A
v0.1.0-stamped build from this branch, against the realgithub.com/Agent-Field/CodeAFreleases:Terminal —
time codeaf updateprintedin 7.5 s real; the installed file is 57,532,578 bytes and reports v0.2.0.
Chat — the launch drew
and
/updatedrew its three notes,then restarted onto the same conversation — the transcript's marker exchange
came back under
· resumed ·,/statusmoved frombuild v0.1.0 built 2026-08-31 20:00tobuild v0.2.0 built 2026-09-15 13:26, and itsfilerownamed the same
transcript.jsonlbefore and after.Why it blocks
#1060's update road is unusable on the line that is published today, so this is
a blocker for promoting staging to main: whoever installs that build cannot
update out of it from inside codeaf.
Gates
gofmt -l cmd internal(empty) ·go vet ./...·go build ./...· windows/amd64and darwin/arm64 cross-builds ·
make build·make test-laws·go test -count=1 ./internal/update/ ./cmd/codeaf/ ./internal/manual/ ./internal/e2e/·make test-focus PKGS=./internal/tui3 RUN='Update|Notice|Command'·make test-quick—all green. The chat manual's update section states no timeout, so it needed no
correction.
🤖 Generated with Claude Code