Skip to content

fix(client)!: apply no response-header timeout by default - #614

Merged
Benehiko merged 1 commit into
mainfrom
fix/client-indefinite-timeout-defaults
Aug 17, 2026
Merged

fix(client)!: apply no response-header timeout by default#614
Benehiko merged 1 commit into
mainfrom
fix/client-indefinite-timeout-defaults

Conversation

@Benehiko

@Benehiko Benehiko commented Aug 13, 2026

Copy link
Copy Markdown
Member

Problem

The Go client defaults ResponseHeaderTimeout to 1 second (DefaultClientResponseHeaderTimeout). Any request where the daemon takes more than a second to start responding fails at the transport layer — and a request can legitimately block far longer than that on user interaction daemon-side: a store unlock, an authorization prompt, or a plugin waiting on input.

The request timeout already defaults to 0 (no limit) for exactly this reason, and the docker pass CLI already overrides both timeouts to 0 when it builds its client. Every other consumer of the SDK silently inherits the 1s cliff unless they know to call WithResponseTimeout(0) — an internal SDK consumer just hit this.

Change

DefaultClientResponseHeaderTimeout is now 0 (no limit), matching the request-timeout default. Doc comments on WithResponseTimeout and the transport construction updated to match.

Consumers that pass explicit timeouts are unaffected; WithTimeout / WithResponseTimeout still apply a hard bound, as does a per-call context deadline.

Testing

  • go build ./... and go test ./... in the x, client, and plugin modules — all pass.

🤖 Generated with Claude Code

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

The change is correct and well-reasoned. DefaultClientResponseHeaderTimeout was causing real failures for legitimate slow-start interactions (store unlock, auth prompts, plugin input — referenced in wield#109). Setting it to 0 aligns with the existing DefaultClientRequestTimeout = 0 design, matches what the docker pass CLI already explicitly does, and correctly reflects the secrets-engine domain where blocking on user interaction is expected.

What was checked:

  • The behavioral change from time.Secondtime.Duration(0) is intentional and correctly implemented via http.Transport.ResponseHeaderTimeout
  • Both RequestTimeout and ResponseHeaderTimeout now default to 0, consistent with each other and the PR rationale
  • Updated doc comments in WithResponseTimeout and the New() inline comment accurately describe the new default and correctly point callers to WithResponseTimeout or per-call context deadlines as opt-in bounds
  • No compilation issues; API contract for WithResponseTimeout (rejects negatives, 0 = no limit) is unchanged
  • The concern about non-interactive callers losing an implicit 1s safety net was evaluated and found to be a pre-existing design tradeoff the PR explicitly and correctly addresses — not a regression

No actionable issues found.

The client defaulted ResponseHeaderTimeout to 1 second, so any request
where the daemon took more than a second to start responding failed at
the transport layer. A request can legitimately block far longer than
that on user interaction daemon-side: a store unlock, an authorization
prompt, or a plugin waiting on input.

The request timeout already defaults to 0 (no limit) for exactly this
reason, and the docker pass CLI already overrides both timeouts to 0.
Make that the default for every consumer: DefaultClientResponseHeaderTimeout
is now 0 as well. Callers that need a hard bound can still set one with
WithResponseTimeout or a per-call context deadline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Benehiko
Benehiko force-pushed the fix/client-indefinite-timeout-defaults branch from 89243a5 to 418f69e Compare August 17, 2026 12:20

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

The PR makes three coherent, self-consistent changes:

  1. x/api/defaults.goDefaultClientResponseHeaderTimeout changed from time.Second to time.Duration(0) (no limit).
  2. client/client.go — Doc comments updated to reflect the new default; no logic changes.
  3. plugins/pass/commands/run.go — Explicit WithResponseTimeout(0) override removed (now redundant given the new default); corresponding test updated.

No logic errors, security issues, resource leaks, or concurrency problems were found in the introduced changes. The change correctly propagates through the call chain, and the removal of the now-redundant override in the pass plugin is safe.

@Benehiko Benehiko changed the title fix(client): apply no response-header timeout by default fix(client)!: apply no response-header timeout by default Aug 17, 2026
@Benehiko
Benehiko merged commit aca80a4 into main Aug 17, 2026
19 of 20 checks passed
@Benehiko
Benehiko deleted the fix/client-indefinite-timeout-defaults branch August 17, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants