fix(proxy): default a nil HTTPClient instead of dereferencing it #1115
No reviewers
Labels
No labels
move-to-repo
coilyco-bridge-deploy
move-to-repo
coilyco-flight-deck-agent-compose
move-to-repo
coilyco-gaming-eco-app
move-to-repo
coilysiren-inbox
move-to-repo
unknown
🔒⚠️📦⚠️🔒 SANDBOXED 🔒⚠️📦⚠️🔒
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!1115
Loading…
Reference in a new issue
No description provided.
Delete branch "aos/claude/proxy-nil-client-959"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Milestone 17 phase 5.
ProxyClientis exported with exported fields, so a caller can build one directly. Every other field treats zero as take the packaged default, andHTTPClienttreated it as a nil dereference on the first turn.httpClient()is the same shape as the existingnow(), which is what the issue asked for.The runtime never reaches this,
NewAgentalways supplying an instrumented client, so it is only reachable by a second caller. That is how it was found, wiringcmd/sirens-echo-bridge.TestASuppliedHTTPClientIsStillUsedholds the other half, so the default cannot quietly displace the otelhttp transportNewAgentdepends on.With the accessor removed the test reproduces the reported panic exactly:
closes #959
Reviewed, correct, and the zero-value reasoning in the comment is the right justification: every other field on this struct means the packaged default when unset, so a nil client meaning a panic was the odd one out.
One thing I checked rather than assumed, because it would have made this worse than the panic.
http.DefaultClienthas no timeout, so defaulting to it on a path that calls a model could have turned a loud crash into a silent hang, which is the trade nobody wants. It does not, becauseproxy.go:1120builds the request withhttp.NewRequestWithContext(modelCtx, ...)andmodelCtxcarries the turn budget. The deadline lives on the request rather than the client, so the default is bounded by the same budget an explicit client would be.Worth a half-sentence in the
httpClientcomment saying the deadline comes from the request context, since the next reader's first instinct will be the same as mine was.No file overlap with #1114 or #1116, and this one touches nothing in the image, so it is unaffected by #1117.