Skip to content

feat(core): bound HTTP retries and make request replay explicit #3159

Open

Description

@ananthsub

Priority

Wave 1 — core transport safety. Develop in parallel with #2845; provider retries do not wait for this issue.

Problem

The shared HTTP path can retry disconnect and internal generic failures indefinitely. It also replays mutating POST requests after failures that may have occurred after delivery, creating duplicate model, tool, verifier, sandbox, or session work.

Essential scope

  • Finite default attempt and elapsed bounds for every shared transport retry branch.
  • A finite sock_connect timeout without imposing one universal generation or response-read deadline.
  • Correct cancellation propagation.
  • A minimal safety classification: definitely before delivery versus delivery ambiguous.
  • Retry known pre-delivery connector failures within a small finite bound.
  • Do not automatically replay POST or another mutating request after ambiguous delivery.
  • One explicit call-site opt-in for ambiguous replay only when the operation is proven idempotent or receiver-deduplicated.
  • A bounded serializable exhaustion error or record sufficient for feat(core): define typed rollout outcomes and recovery #2135.
  • Basic retry and exhaustion logs.

Later framework work

  • A shared logical request context across transport and provider layers if measured behavior shows independent finite bounds are insufficient.
  • Finer pool, DNS, route, connect, peer-drop, header, and body-stage taxonomy where it changes policy.
  • Separate idempotent and deduplicated declarations if call sites need that distinction.
  • Full metrics and span conventions under feat(observability): standardize error-recovery telemetry #3182.

Dependencies and integration

Acceptance criteria

  • Every shared transport retry branch terminates under configured attempt and elapsed bounds.
  • Socket connection setup is bounded without timing out pool wait or healthy long generation.
  • Cancellation escapes retry handling unchanged.
  • Mutating requests are not replayed after ambiguous delivery by default.
  • Proven-safe call sites can opt in explicitly and side-effect tests prevent duplicate execution.
  • Exhaustion preserves bounded cause, attempt, endpoint, and delivery-ambiguity information for feat(core): define typed rollout outcomes and recovery #2135.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions