fix(releasecheck): default a 30s HTTP client instead of DefaultClient - #92
Conversation
Default a 30s http.Client instead of http.DefaultClient so a black-holed api.github.com cannot hang public check-update CLIs. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 10:42 PM ET / August 16, 2026, 02:42 UTC. ClawSweeper reviewWhat this changesThe PR replaces the release-check fallback HTTP client with a 30-second client and adds coverage for the default and caller-supplied client paths. Merge readinessThis PR remains necessary because current main still uses the unbounded default HTTP client. The narrow replacement has sufficient exact-head runtime proof and no actionable review findings. Priority: P2 Review scores
Verification
How this fits togetherDownstream crawl CLIs use the shared release-check package to read cached release data or query GitHub Releases and report update status. The fallback client determines how long a request can block when callers provide no client. flowchart LR
A[Downstream crawl CLI] --> B[Release check]
B --> C{Fresh cache?}
C -->|Yes| D[Cached update result]
C -->|No| E[Fallback HTTP client]
E --> F[GitHub Releases API]
F --> G[Update status or suppressed error]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Adopt the bounded default while retaining caller-supplied client behavior, so optional update notices cannot indefinitely stall a CLI. Do we have a high-confidence way to reproduce the issue? Yes. Current main routes a nil client to http.DefaultClient and then Client.Do; the maintainer’s exact-head stalled-server run demonstrates the after-fix 30-second boundary. Is this the best way to solve the issue? Yes. Replacing only the nil fallback preserves explicit caller transports and avoids new configuration or public API changes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 00a94648f6f2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Maintainer verification on exact head
This proves the default client bounds the real request path at 30 seconds; the supplied-client preservation case remains covered by the focused regression test. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What Problem This Solves
releasecheck.normalizeOptionsusedhttp.DefaultClientwhen the caller did not pass a client. Publiccheck-updateCLIs (discrawl, gitcrawl, slacrawl, graincrawl, notcrawl) call it withcontext.Background(), so a black-holedapi.github.comhangs forever.Evidence
Default client is now
&http.Client{Timeout: 30s}, matchingremote.NewClient. Caller-supplied clients are unchanged.Real behavior proof
Behavior addressed: Release-check HTTP now has a 30s default timeout instead of DefaultClient.
Real environment tested: macOS, Go from the worktree, crawlkit
/tmp/oc-impl-crawlkitheadfbaa0dc.Exact steps or command run after this patch:
GOWORK=off go test -count=1 ./...Evidence after fix: red/green recorded above.
Observed result after fix: default client Timeout is 30s and is not DefaultClient.
What was not tested: A live GitHub API outage.