beads/internal/httpclient/wire
Julian Knutsen 18b5c3cc39
fix(httpclient): name the connect failure when bd serve cannot be reached (#7702)
* fix(httpclient): name the connect failure when bd serve cannot be reached

A workspace whose server does not answer reported the transport's text:
`cannot reach bd serve at https://host:30699: Get "https://host:30699/v0/beads/context":
dial tcp 100.85.56.42:30699: i/o timeout`. It names the request rather than
the address that failed, and says nothing about what a dial timeout usually
means. An operator chasing an unreachable store had to know that "i/o
timeout" on a dial means the SYN went unanswered.

A request whose connection could not be opened now fails with a
*wire.DialError inside the *ConnectError: a refused connect names the
address and says nothing is listening there; a connect that times out names
the address that never answered, how long the attempt waited, and that a
firewall dropping the connection or a down host is the usual cause; a host
name that does not resolve is named as such. The transport's error stays
reachable through Unwrap, so errors.Is checks (ECONNREFUSED, timeouts) and
*ConnectError classification are unchanged, and a dial the caller canceled
keeps its own error. The events:watch connect gets the same classification.

Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of gascity-agent
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(httpclient): keep the transport's dial text in connect errors

Review follow-up. The refused and DNS messages dropped "connection refused"
and "dial tcp", the vocabulary gc's text classifier matches to tell an
unavailable store from other failures; without it the dispatcher's serve
loop exits and control beads are quarantined. Every DialError message now
ends with the transport's own *net.OpError text in brackets, after the
explanation.

TestACanceledDialIsTheCallersOwn now actually reaches the ctx.Err() guard:
its round tripper cancels and hands back a genuine refused dial, which the
guard alone keeps from becoming a DialError (removing the guard fails it).

Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of gascity-agent
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 16:54:25 +00:00
..
BUILD.bazel fix(httpclient): name the connect failure when bd serve cannot be reached (#7702) 2026-10-19 16:54:25 +00:00
client.go fix(httpclient): name the connect failure when bd serve cannot be reached (#7702) 2026-10-19 16:54:25 +00:00
client_test.go feat(httpclient): OSS HTTP client wire/encode layers (contributed from bd-enterprise under MIT) (#7210) 2026-10-05 02:58:34 -07:00
credential.go fix(httpclient): bound response-header waits and retry stalled reads on another connection (#7553) 2026-10-14 05:04:19 +00:00
credential_source_test.go feat(httpclient): OSS HTTP client wire/encode layers (contributed from bd-enterprise under MIT) (#7210) 2026-10-05 02:58:34 -07:00
credential_test.go feat(httpclient): OSS HTTP client wire/encode layers (contributed from bd-enterprise under MIT) (#7210) 2026-10-05 02:58:34 -07:00
dial_error.go fix(httpclient): name the connect failure when bd serve cannot be reached (#7702) 2026-10-19 16:54:25 +00:00
dial_error_test.go fix(httpclient): name the connect failure when bd serve cannot be reached (#7702) 2026-10-19 16:54:25 +00:00
doc.go feat(httpclient): OSS HTTP client wire/encode layers (contributed from bd-enterprise under MIT) (#7210) 2026-10-05 02:58:34 -07:00
handshake.go feat(http): bd blocked over bd serve (blocked.list), plus bd blocked --flags [--raw] (#7649) 2026-10-17 12:29:13 +00:00
handshake_test.go feat(httpclient): OSS HTTP client store and roles + a served http conformance leg (contributed from bd-enterprise under MIT) (#7247) 2026-10-08 12:01:09 +00:00
handshake_wire_revision_test.go feat(httpclient): OSS HTTP client wire/encode layers (contributed from bd-enterprise under MIT) (#7210) 2026-10-05 02:58:34 -07:00
helpers_test.go feat(httpclient): OSS HTTP client wire/encode layers (contributed from bd-enterprise under MIT) (#7210) 2026-10-05 02:58:34 -07:00
large_apply_timeout_test.go fix(httpclient): dial a large batchApply under the server's extended budget (#7582) 2026-10-15 23:43:54 +00:00
paths.go feat(http): bd blocked over bd serve (blocked.list), plus bd blocked --flags [--raw] (#7649) 2026-10-17 12:29:13 +00:00
paths_test.go feat(http): bd heartbeat over bd serve (issues.heartbeat), and close the re-arm orphan-lease race (#7600) 2026-10-16 22:38:23 +00:00
problem.go feat(http): bd heartbeat over bd serve (issues.heartbeat), and close the re-arm orphan-lease race (#7600) 2026-10-16 22:38:23 +00:00
problem_test.go feat(httpclient): OSS HTTP client wire/encode layers (contributed from bd-enterprise under MIT) (#7210) 2026-10-05 02:58:34 -07:00
problem_wire_revision_test.go feat(httpclient): OSS HTTP client wire/encode layers (contributed from bd-enterprise under MIT) (#7210) 2026-10-05 02:58:34 -07:00
project_stamp_test.go feat(httpclient): OSS HTTP client wire/encode layers (contributed from bd-enterprise under MIT) (#7210) 2026-10-05 02:58:34 -07:00
read_memo.go perf(http): answer a command's repeated reads from one response; bd show --json makes 1 request (port of bd-enterprise e626072b8) (#7588) 2026-10-16 04:26:37 +00:00
read_memo_test.go perf(http): answer a command's repeated reads from one response; bd show --json makes 1 request (port of bd-enterprise e626072b8) (#7588) 2026-10-16 04:26:37 +00:00
revision_tolerance.go feat(roles): BatchGetter role and POST issues:batchGet (#7248) 2026-10-05 12:09:18 -07:00
revision_tolerance_test.go feat(roles): LeaseReclaimer role, POST issues:reclaim, and bd reclaim on both routes (S9) (#7412) 2026-10-09 14:56:32 +00:00
skew_test.go feat(http): bd blocked over bd serve (blocked.list), plus bd blocked --flags [--raw] (#7649) 2026-10-17 12:29:13 +00:00
stall_retry.go feat(http): bd heartbeat over bd serve (issues.heartbeat), and close the re-arm orphan-lease race (#7600) 2026-10-16 22:38:23 +00:00
stall_retry_test.go fix(httpclient): dial a large batchApply under the server's extended budget (#7582) 2026-10-15 23:43:54 +00:00
stream.go fix(httpclient): name the connect failure when bd serve cannot be reached (#7702) 2026-10-19 16:54:25 +00:00
stream_test.go feat(httpclient): OSS HTTP client wire/encode layers (contributed from bd-enterprise under MIT) (#7210) 2026-10-05 02:58:34 -07:00
vocabulary_test.go feat(http): bd blocked over bd serve (blocked.list), plus bd blocked --flags [--raw] (#7649) 2026-10-17 12:29:13 +00:00
writes.go fix(httpclient): dial a large batchApply under the server's extended budget (#7582) 2026-10-15 23:43:54 +00:00
writes_batch_cap_test.go feat(httpclient): BatchApplier over HTTP — handshake cap, dep_add lineage on the wire, gc mappings (S5) (#7265) 2026-10-09 01:05:39 +00:00
writes_twospeed_test.go feat(httpclient): OSS HTTP client store and roles + a served http conformance leg (contributed from bd-enterprise under MIT) (#7247) 2026-10-08 12:01:09 +00:00