Add WebSocket transport to OpenAI Responses
This pull request was posted by Codex Desktop using gpt-6-luna on behalf of David.
Closes #4414
Why we make these changes
OpenAI Responses can reuse a WebSocket across requests in a run. This adds opt-in socket transport with per-run socket lifecycle while preserving the HTTP default; compatible-compaction continuation was merged in the companion PR.
New public surface
OpenAIResponsesModelSettings.openai_transport;OpenAIResponsesModel(..., websocket_connection_options=...);OpenAIModelProfile.openai_responses_supports_websocketandopenai_responses_supports_websocket_stream_id; thepydantic_ai.transportOpenTelemetry span attribute.
User-visible behavior
+from pydantic_ai import Agent
+from pydantic_ai.models.openai import OpenAIResponsesModelSettings
+
-agent = Agent('openai:gpt-5.6')
+agent = Agent(
+ 'openai:gpt-5.6',
+ model_settings=OpenAIResponsesModelSettings(openai_transport='websocket'),
+)
Each run opens a socket on its first request and closes it when the run ends. Before response.create is sent, a TLS, proxy, DNS or connect-timeout failure warns and falls back to HTTP; an HTTP-level handshake rejection and failures after sending still propagate. If an idle-closed socket and its one replacement both fail before sending, the request uses HTTP. After any connection failure, later requests in the same run or outer agent/model context use HTTP without another handshake attempt or warning; a fresh run or context tries a socket again. Early provider rejections retry within the configured budget, which carries across an unsent replacement and into HTTP fallback. In WebSocket mode, pydantic_ai.transport records websocket on socket spans and http on HTTP create/retrieve spans. The attribute is on the model activity span under Temporal and the model request span otherwise; HTTP-only mode leaves the attribute unset. Automatic continuation uses server-state IDs only within their endpoint; a caller-supplied concrete response ID remains explicit across transports.
Verification
Tool continuation, sequential turns, cross-socket history replay, endpoint-scoped automatic continuation, compaction continuation, waiting requests use HTTP after a failed handshake, shared-lifetime handshake fallback and fresh-scope retry, and retry-budget preservation after socket replacement cover transport behavior. Both runnable WebSocket examples are enabled in the docs example suite with canned replies. The HTTP fallback warning table and continuation cases document the behavior. Cassette-backed tests snapshot full outbound frames, outputs and history/provenance. WebSocket and HTTP client-lifecycle tests, real Worker and ActivityEnvironment checks, DBOS/Prefect streaming, first-event timeouts, fallback, batch, and manifest cases passed; missing-extra collection, targeted Pyright and commit hooks passed.
The HTTP fallback table now includes the credential-resolution detail. The Docs Navigation Check passed for current head 4972122e5d5dede34fa00130bbb5f30d9700f23b; the unified-docs preview run succeeded, and the pinned preview renders that source. The older pinned preview at c620215 is historical.
At current head 4972122e5d5dede34fa00130bbb5f30d9700f23b, full CI, including coverage, passed on attempt 2 of run 41144770947. Attempt 1 had one failure in tests/clai2/test_web_workers.py::test_a_task_takes_no_prompt_once_its_agent_delegates_no_more; the unchanged-head retry passed. The optional generic CodSpeed suite passed on current head 4972122e5d5dede34fa00130bbb5f30d9700f23b in run 41144771058; it does not measure Responses transport or latency. Historical generic CodSpeed evidence at fb718789c6b986a9b1b7a9750b44578095627ed5 (run 40938033327) also does not measure Responses transport or latency.
What changes for existing users
HTTP remains the default; WebSocket use is opt-in and falls back to HTTP where required.
PR decisions
Chronological record, including superseded designs. The summary above describes the current API.
2026-10-16 · Concrete Responses connection · iter -
- Decision: OpenAIResponsesModel.connect() yields a caller-owned connected model selected through ordinary Agent paths.
- Why: The provider/HTTP-client lifetime and socket lifetime are distinct; explicit selection keeps Agent precedence intact.
- Source: https://github.com/pydantic/pydantic-ai/issues/4414#issuecomment-4078003956
2026-10-16 · Cache-only response IDs stay on their socket · iter -
- Decision: Auto-chain a WebSocket response ID only on its owning live socket; replay retained history across transports
- Why: Store-false responses can exist only in connection-local cache, and a live two-socket continuation succeeded with full history
- Source: https://developers.openai.com/api/docs/guides/websocket-mode
2026-10-16 · Stored seed across a transport change · iter 1
- Decision: Keep a concrete stored seed as an ancestor and trim replay after its matching response, unless a later compaction replaced it.
- Why: This retains prior-turn context without duplicating the local prefix or crossing a compaction boundary.
- Source: https://github.com/pydantic/pydantic-ai/commit/233bb4ec52894d1a21ac2fb8441fc5e37fa39398
2026-10-16 · HTTP operations on connected Responses models · iter 1
- Decision: Count tokens and compact with HTTP history rules during the connection context and reject both methods after closure
- Why: Socket local IDs cannot anchor HTTP requests and the connected handle has a bounded lifetime
- Source: https://github.com/pydantic/pydantic-ai/commit/c797e58608104594ef7595bb383da1a63f3e7486
2026-10-16 · Temporal guard at request boundary · iter -
- Decision: Permit connected model registration; reject the selected model before a workflow request schedules an activity.
- Why: TemporalAgent remains usable outside a workflow, while a live socket cannot cross the replay boundary.
- Source: https://github.com/pydantic/pydantic-ai/commit/13a406c864465b84b63b1fa124311213903b0911
2026-10-16 · Cross-transport automatic continuation · iter 2
- Decision: Keep automatic full-history replay after switching from a WebSocket to HTTP or another socket; require a concrete ID to opt into stored-response chaining.
- Why: WebSocket response IDs are not guaranteed persisted, and replay preserves the retained history without assuming storage or changing HTTP defaults.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4299463533
2026-10-16 · Transport changes replay retained history · iter -
- Decision: Keep automatic full-history replay after HTTP and WebSocket transport changes in PR 10444
- Why: One recovery rule works for stored and connection-local response IDs; stored-ID reuse remains explicit
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6226102828
- Supersedes: Cross-transport automatic continuation
2026-10-16 · Session proposal and strict history dependency · iter -
- Decision: Keep the concrete model connection API and hold merge until same-socket history edits invalidate automatic continuation.
- Why: Recent analysis on issue 9945 proposes a resource scope before a general session, and a targeted red test showed stale cached context after history redaction.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6226133533
2026-10-19 · Integrate finalized Responses history guard · iter -
- Decision: Use the merged shared digest guard for socket continuation, preserving its HMAC key in connected model copies and the chosen cross-transport replay policy.
- Why: History edits and expired request-scoped prompts must reach the provider instead of continuing cached context.
- Source: https://github.com/pydantic/pydantic-ai/commit/aae25584d922a319a4842414be2010c2a69f014e
2026-10-19 · Stream provenance follows selected transport · iter -
- Decision: Pass socket provenance explicitly from the connected model when constructing the streamed response.
- Why: Custom HTTP streams are not SDK AsyncStream instances; their class cannot identify transport without changing HTTP metadata.
- Source: https://github.com/pydantic/pydantic-ai/actions/runs/39343252686/job/118369696051
2026-10-20 · Validate the stored seed before transport replay trimming · iter -
- Decision: Validate the matched concrete seed digest before trimming cross-transport replay history to it.
- Why: A later socket response can record edited history while an older stored seed still represents the original prefix.
- Source: https://github.com/pydantic/pydantic-ai/pull/10509
2026-10-21 · Connection API stays; multiplex lanes next · iter -
- Decision: Keep OpenAIResponsesModel.connect() yielding a connected copy; implement stream_id multiplexing instead of documenting around connection reuse.
- Why: OpenAI supports parallel lanes per socket, which removes the overlap error and the sequential-only nested-run limit.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6330471676
2026-10-21 · Multiplexing lands in this PR · iter -
- Decision: Implement stream_id lanes in PR 10444 rather than a follow-up.
- Why: The overlap error and sequential-only nested-run docs should not ship as the first contract.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6330471676
2026-10-21 · Own lane router, no SDK session · iter -
- Decision: Route events by stream_id in our transport reader with a pooled set of lane IDs; do not adopt AsyncResponsesWebSocketSession.
- Why: The SDK session requires app-chosen buffer caps and closes the socket on overflow.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6330471676
2026-10-21 · Request-scoped errors keep the socket open · iter -
- Decision: Treat error, failed and incomplete as terminal for the response; keep the socket and drop its cached latest ID; transport-closed sockets raise a ModelAPIError subclass.
- Why: Closing the socket on a request error poisoned FallbackModel runs and would kill sibling lanes.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6282245280
2026-10-22 · pre-push review 1 of 3 at 7a4849a5526dc823048147bef236089085eed748 · iter -
- Decision: dispatched (reserved)
- Why: tree 85e8f1eccd088c0076aa7bfbe95594f0f9cae40f; full branch 9f9768fbbb8a..7a4849a552; first substantive review after adding stream_id lanes
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 1 of 3 at 7a4849a5526dc823048147bef236089085eed748 · iter -
- Decision: remediated: send cancellation abandons the lane; connection-limit error fails the socket; docstring, docs limits and auto setting; recorded overlapping-lanes cassette; parallel nested-run test; Azure annotation reverted
- Why: tree 85e8f1eccd088c0076aa7bfbe95594f0f9cae40f; full branch 9f9768fbbb8a..7a4849a552; six findings, all done (harness stand-in replaced by a core parallel nested-run test)
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 2 of 3 at a8237103bf7dcde5a21d8e9d9a4273f2ca2a536c · iter -
- Decision: dispatched (reserved)
- Why: tree 32b4983a547a92da682622c9f781e6bde684b7d2; follow-up scope 7a4849a552..a8237103bf plus review 1 findings
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 2 of 3 at a8237103bf7dcde5a21d8e9d9a4273f2ca2a536c · iter -
- Decision: remediated: code-less connection error message; cancelled-send test now delivers the late response and reuses the freed lane
- Why: tree 32b4983a547a92da682622c9f781e6bde684b7d2; follow-up 7a4849a552..a8237103bf; review 1 findings verified fixed
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 3 of 3 at 5838ee4f04879a4787fe1c75e16b852cdbe78ae7 · iter -
- Decision: dispatched (reserved)
- Why: tree 9fe074c42550b90a04121de4820b245975491def; follow-up a8237103bf..5838ee4f04 plus review 2 findings
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 3 of 3 at 5838ee4f04879a4787fe1c75e16b852cdbe78ae7 · iter -
- Decision: remediated: WebSocket error frames raise the HTTP error categories (budget exhausted; pushing the locally checked remediation commit)
- Why: tree 9fe074c42550b90a04121de4820b245975491def; follow-up a8237103bf..5838ee4f04; review 2 findings verified fixed
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · Self-review remediation scope · iter -
- Decision: Fix all six reproduced defects in PR 10444; keep reconnect, previous_response_not_found handling, steering, DBOS/Prefect guards, to_web and #10237 out
- Why: Defects are reproduced regressions of the new feature; the rest is out of the brief's scope or deprecated surface
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6331828883
2026-10-22 · Abandoned-stream keepalive fix · iter -
- Decision: Default websockets max_size=None and max_queue=None unless the caller sets them; no background reader task
- Why: Fixes the 1 MiB cap and the paused-reader pong timeout with the least code; per-lane buffering was already unbounded
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6331828883
2026-10-22 · stream_id lanes only on OpenAI's API · iter -
- Decision: Multiplex only when the profile flag set by OpenAIProvider.model_profile allows it; other endpoints use the default lane only
- Why: Azure and xAI document one in-flight response per connection; xAI ignored stream_id live, and a serial server mixed two conversations
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6331828883
2026-10-22 · max_retries on a connected model · iter -
- Decision: Declare max_retries unsupported on a connected model so prepare_request warns; no socket retries
- Why: models/AGENTS.md requires unsupported generic settings to warn rather than drop silently
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6331828883
2026-10-22 · pre-push review budget for the remediation task · iter -
- Decision: Start a new three-review budget for the self-review remediation task
- Why: The skill caps reviews per PR during one task; the earlier 3 of 3 belonged to the multiplexing task
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6331828883
2026-10-22 · pre-push review 1 of 3 at 8b0b0571b136db4419635474b9191700fbaaaa60 (remediation task) · iter -
- Decision: dispatched (reserved)
- Why: tree 8218e64bc0f3d1d7a8dee16713b644536cc4aa42; follow-up 5838ee4f04..e43753778b plus self-review findings; upstream merge 8b0b0571 is content-neutral (branch diff equal modulo hunk offsets)
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 1 of 3 at 8b0b0571b136db4419635474b9191700fbaaaa60 (remediation task) · iter -
- Decision: findings: docs overclaim lane scope for OpenAIProvider with a foreign base_url; spurious max_retries warning on HTTP compaction and token counting — both do
- Why: tree 8218e64bc0f3d1d7a8dee16713b644536cc4aa42; follow-up 5838ee4f04..e43753778b; self-review defects 1-6 otherwise verified
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 2 of 3 at 7db29c2834122ac41bea6fcba2142363bd394f2c (remediation task) · iter -
- Decision: dispatched (reserved)
- Why: tree 2730c8e6a09848a819cd5a6f65880ac46e7069bf; follow-up 8b0b0571b1..7db29c2834 plus review 1 findings
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 2 of 3 at 7db29c2834122ac41bea6fcba2142363bd394f2c (remediation task) · iter -
- Decision: remediated: lane docs remedy names the profile override on OpenAIResponsesModel only; max_retries fix verified
- Why: tree 2730c8e6a09848a819cd5a6f65880ac46e7069bf; follow-up 8b0b0571b1..7db29c2834; review 1 finding 2 verified fixed, finding 1 partly
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 3 of 3 at 265288428876e4e11b2acda2849f021c9c069665 (remediation task) · iter -
- Decision: dispatched (reserved)
- Why: tree dd570dd5b0bcf93bd2601c067557d38fcccc7eaf; follow-up 7db29c2834..265288428876e4e11b2acda2849f021c9c069665 plus review 2 finding
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 3 of 3 at 265288428876e4e11b2acda2849f021c9c069665 (remediation task) · iter -
- Decision: no findings
- Why: tree dd570dd5b0bcf93bd2601c067557d38fcccc7eaf; follow-up 7db29c2834..2652884288; review 2 finding verified fixed
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · Hosted CI Review at 2652884288 is unusable · iter -
- Decision: Treat the CI Review gate as unmet at 2652884288; the next head needs a fresh trigger
- Why: Run 39812793610 posted an empty-body COMMENT review with two TEST COMMENT placeholder threads, and the commit_id dedup blocks a rerun on the same head
- Source: https://github.com/pydantic/pydantic-ai/actions/runs/39812793610
2026-10-22 · unmet review gate at 265288428876e4e11b2acda2849f021c9c069665 · iter -
- Decision: David hands the PR back for his own final pass without a usable hosted CI Review at this head
- Why: CI Review run 39812793610 posted placeholder output only; CI is green, threads resolved, pre-push review 3 of 3 clean
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · stream_id lanes default only on api.openai.com · iter -
- Decision: Use named lanes by default only when the endpoint host is api.openai.com; other hosts take turns unless their profile sets openai_responses_supports_websocket_stream_id=True
- Why: Lanes wrongly on hands one conversation another's answer (reproduced via OpenAIProvider(base_url=api.x.ai)); lanes wrongly off only serializes. Deliberate exception to the models/AGENTS.md base_url rule
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6348168245
- Supersedes: stream_id lanes only on OpenAI's API
2026-10-22 · pre-push review budget for the host-gating task · iter -
- Decision: Start a new three-review budget for the comment-6348168245 remediation
- Why: The previous remediation task ended at hand-back; this is a new maintainer request
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6348168245
2026-10-22 · Lane default reads the socket's own host · iter -
- Decision: connect() defaults the lane flag from the host of websocket_base_url when the SDK client sets one, else base_url; an explicit profile value wins
- Why: websocket_base_url decides where the socket connects, so a base_url-only check would enable lanes on a proxy socket
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6348168245
2026-10-22 · pre-push review 1 of 3 at 3a52568591f78962a02210f1a9015a007d41157f (host-gating task) · iter -
- Decision: dispatched (reserved)
- Why: tree d83e68b202c69559c1478cadf0b4950fb10833e0; follow-up 2652884288..3aacafcb2b plus merge 3a52568591 with a models/init.py conflict resolution
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 1 of 3 at 3a52568591f78962a02210f1a9015a007d41157f (host-gating task) · iter -
- Decision: remediating: move the api.openai.com default into OpenAIResponsesModel._instance_profile_defaults; merge resolution verified correct
- Why: tree d83e68b202c69559c1478cadf0b4950fb10833e0; follow-up 2652884288..3aacafcb2b plus merge 3a52568591
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · Lane default resolved in the model profile · iter -
- Decision: OpenAIResponsesModel._instance_profile_defaults sets openai_responses_supports_websocket_stream_id from the provider client's WebSocket host, under the provider layer; connect() reads it with a False default
- Why: Unset no longer differs from False and model.profile shows whether lanes run; the provider client is read because BedrockMantleResponsesModel.client depends on the resolved profile
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6348168245
- Supersedes: Lane default reads the socket's own host
2026-10-22 · Host default stays in connect(), not the profile hook · iter -
- Decision: Decline review 1's move to _instance_profile_defaults; decide the lane default in connect() and keep the flag tri-state (unset follows the socket host)
- Why: The hook made every OpenAIResponsesModel read client URLs during profile resolution: 8 HTTP-only tests with mocked clients broke and Bedrock Mantle crashed on init order, moving behavior for users who never call connect()
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · Lane default stays in connect() · iter -
- Decision: Reverted the _instance_profile_defaults hook (9c92b2e215); connect() decides lanes by WebSocket host only when the profile leaves the flag unset, and an explicit profile or provider value wins
- Why: The hook moved a WebSocket-only concern into every HTTP model's profile resolution, breaking HTTP-only users with mocked clients (8 tool_choice tests) and BedrockMantleResponsesModel construction; root AGENTS.md requires unchanged behavior for users not hitting the problem
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6348168245
- Supersedes: Lane default resolved in the model profile
2026-10-22 · pre-push review 2 of 3 at 1228c256fcba485a58e3f0cfdb1b5fadb1b14ea0 (host-gating task) · iter -
- Decision: dispatched (reserved)
- Why: tree b8efe99d95d2b155a15f3d98e90392492ea6c487; follow-up 3a52568591..1228c256fcba485a58e3f0cfdb1b5fadb1b14ea0 (net: flag docstring, connect() comment, one test) plus the declined review 1 finding
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 2 of 3 at 1228c256fcba485a58e3f0cfdb1b5fadb1b14ea0 (host-gating task) · iter -
- Decision: remediated: connect() docstring states the flag precedence; declining the profile-hook move upheld
- Why: tree b8efe99d95d2b155a15f3d98e90392492ea6c487; follow-up 3a52568591..1228c256fc; remediation 2d0e8161f7 is a docstring-only exempt delta from the reviewed SHA 1228c256fc
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · Assess Douwe's setting-based transport proposal before cleanups · iter -
- Decision: Verify DouweM's openai_transport/ref-counted-socket proposal with code and live-probe subagents, then refute or implement; run the nine audit cleanups after, dropping those the redesign deletes
- Why: The proposal removes connect(), the connected copy and the durable guards, which several cleanups touch
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6351271321
2026-10-22 · Setting-based transport replaces connect() · iter -
- Decision: Implement DouweM's openai_transport: Literal['http','websocket'] on OpenAIResponsesModelSettings with a model-owned socket pool; remove connect() and the connected copy
- Why: Code check and live probe found the direction sound; generic code that takes a model string can opt in without restructuring
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6351271321
- Supersedes: Concrete Responses connection
2026-10-22 · Run lease hook, not Model.aenter · iter -
- Decision: Add a private no-op Model hook that each non-durable run holds for its model and every selected model; WrapperModel and FallbackModel delegate; OpenAIResponsesModel.aenter also takes a lease
- Why: Runs never enter the default or an explicit run(model=) instance (capability_owns_current_model=False in _PreparedAgentRun.open), so the proposal's 'runs already enter the model' premise is false; entering would close the caller's HTTP client (test_run_leaves_client_of_passed_model_open)
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6351271321
2026-10-22 · Unsupported socket endpoints fall back to HTTP with a warning · iter -
- Decision: Azure, OAuth providers, OpenAICodexModel, a missing extra, a non-asyncio loop, a durable unit without a worker lease, background and resumed requests use HTTP and warn instead of raising
- Why: The setting can come from config and apply to any model string; the socket is a latency optimization and history rules keep either transport correct
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6351271321
2026-10-22 · Chain socket responses by echoed store flag · iter -
- Decision: Record store from response.model_extra in provider_details for socket responses; a stored response chains from any transport, an unstored or missing one only from its live socket lane; drop the stored-seed replay trimming; no automatic replay on previous_response_not_found
- Why: Live probe on gpt-6.1-sol: store true continued over HTTP and a new socket up to 54s later with the origin closed; store false failed with previous_response_not_found off its socket; matches HTTP auto's failure mode
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6351271321
- Supersedes: Transport changes replay retained history
2026-10-22 · Pool keyed by handshake headers, reconnect on close or age · iter -
- Decision: Pool sockets per (non-credential headers, WebSocket URL); open another socket when lanes or the 16 in-flight cap are busy; retire sockets near 60 minutes; retry reserve plus send once when an idle socket was closed before send; no socket cap
- Why: Implicit sharing routes a server's traffic through one model; OpenAI queues past 16 and states no connection limit; a pre-send failure is unambiguous
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6351271321
2026-10-22 · Default auto chaining only on socket requests · iter -
- Decision: Socket requests default openai_previous_response_id to 'auto' unless set or openai_conversation_id is set; HTTP fallback keeps today's default
- Why: Most of the latency gain is sending only new input; HTTP behavior stays unchanged
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6351271321
2026-10-22 · Overflow to HTTP instead of a socket pool · iter -
- Decision: One socket per model; a request with no free lane, 16 in flight, or headers differing from the handshake goes over HTTP immediately; reconnect and 60-minute rotation stay for the single socket
- Why: Stored conversations continue over HTTP without resending history; removes pool sizing, header keying and the headers-must-match UserError; a pool can follow if a workload needs more than 16 concurrent responses per model
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6352061642
- Supersedes: Pool keyed by handshake headers, reconnect on close or age
2026-10-22 · Durable no-op and silent runtime fallbacks · iter -
- Decision: openai_transport is a no-op inside durable units; warn only for setups that can never use the socket (Azure, OAuth providers, Codex, missing extra, non-asyncio loop); overflow, header mismatch, unleased request, durable, background and resume fall back silently; run hook named Model._run_scope()
- Why: Owned per-activity models would pay a handshake per request with nothing to continue; runtime fallbacks are normal operation, signalled by the pydantic_ai.transport span attribute and listed in docs
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6352061642
- Supersedes: Unsupported socket endpoints fall back to HTTP with a warning
2026-10-22 · Durable units marked through durable_unit_scope · iter -
- Decision: Set in_durable_unit() around every model unit (_durable_model_scope and the TemporalModel request activities); OpenAIResponsesModel reads it and uses HTTP silently
- Why: Registered backends (Temporal, DBOS) never set it, and a worker or concurrent run can hold a lease on the unit's loop, so leases alone can't make the setting a no-op; the flag is otherwise read only behind in_durable_context checks that are False inside units
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · Leases counted per event loop · iter -
- Decision: The holder counts leases per asyncio loop; a request uses the socket only with a lease on its own loop and only if the socket opened there; the socket closes when its loop's leases and in-flight requests reach 0
- Why: A lease taken on another loop (a Temporal workflow entering a selected model, run_sync in a thread) must never close or use a socket bound to the worker's loop
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · No _run_scope call in _select_model · iter -
- Decision: Only _PreparedAgentRun.open enters self.model._run_scope(); selected models get their lease from aenter via enter_model
- Why: _RunModelResources.enter_model already enters every selected model, and OpenAIResponsesModel.aenter takes a lease, so a second hook there would be redundant
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · SDK auth errors at the handshake warn and use HTTP · iter -
- Decision: An OpenAIError (non-API) from responses.connect(), as for Bedrock Mantle SigV4 and native API keys, warns UnsupportedSettingWarning and sends that request over HTTP instead of raising UserError
- Why: The setup can never use a socket, the same class as OAuth providers; the SDK only reports it when the handshake is prepared, before any network I/O
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6352061642
2026-10-22 · Stranded and aged sockets close once idle · iter -
- Decision: A socket closes when no live lane reads from it and no new request can use it: past the 50-minute retirement age, or with every lane held by abandoned responses (always the case after an abandoned response on a lane-less endpoint)
- Why: With overflow to HTTP nothing would ever read an abandoned no-lane socket, so it would block the socket forever; closing lets the next request reconnect
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · Retire sockets 50 minutes after opening · iter -
- Decision: New requests move to a fresh socket 50 minutes after the current one opened; the old one closes when its responses finish
- Why: OpenAI closes connections at 60 minutes, including in-flight responses; ten minutes leaves room for long reasoning responses
- Source: https://developers.openai.com/api/docs/guides/websocket-mode
2026-10-22 · Lease recheck only before opening · iter -
- Decision: A request that waited for the open lock opens a socket only if its loop still holds a lease, else uses HTTP; it uses a socket another request opened meanwhile regardless
- Why: An in-flight count keeps an existing socket alive, but a socket opened with no lease would close right after the one request
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · Idle-closed detection by ConnectionClosed without cause · iter -
- Decision: A send that raises websockets ConnectionClosed with no cause counts as closed before anything was written and triggers the one rebuild-and-retry on a new socket; other send failures raise ModelConnectionError at write
- Why: websockets' send_context raises ConnectionClosed from None when the connection isn't open on entry and chains the OSError when the write itself fails
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · Socket keeps its first failure · iter -
- Decision: ResponsesWebSocket.fail records only the first failure message
- Why: Closing a failed socket interrupts other lanes' reads with a ConnectionClosed that would otherwise overwrite the cause they report
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review budget for the openai_transport redesign task · iter -
- Decision: Start a new three-review budget for the setting-based transport redesign
- Why: New maintainer request; the host-gating task's budget belonged to the connect() design
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6351271321
2026-10-22 · pre-push review 1 of 3 at 93f0b91464209eff9b85f4baa6bbb0f60766cb75 (redesign task) · iter -
- Decision: dispatched (reserved)
- Why: tree 46677c02db00fc89a47fef60e69353bfa822297c; full branch 553d728a88..93f0b91464 (substantive redesign plus upstream merge with a models/init.py import resolution)
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 1 of 3 at 93f0b91464209eff9b85f4baa6bbb0f60766cb75 (redesign task) · iter -
- Decision: remediating: store=False socket requests chain only from the live lane; record the history digest whenever openai_transport='websocket'; wrap DBOSAgent/PrefectAgent steps and tasks in durable_unit_scope()
- Why: tree 46677c02db00fc89a47fef60e69353bfa822297c; full branch 553d728a88..93f0b91464; three findings, all do
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · Unstored socket requests chain only from their lane · iter -
- Decision: A socket request whose resolved openai_store is False continues only from the response cached on its lane; any other response, HTTP or stored socket, is replayed; HTTP requests keep the old rules
- Why: Pre-push review 1 at 93f0b91464: the socket's auto default otherwise chains a store=False request from an HTTP response that may never have been stored, failing with previous_response_not_found
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · WebSocket mode records history digests on HTTP fallbacks · iter -
- Decision: _history_to_record also digests when the merged settings have openai_transport='websocket', so overflow, unleased and mismatched-header HTTP responses are validated before a later socket request chains from them
- Why: Pre-push review 1 at 93f0b91464: an undigested fallback response was trusted after a history edit
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · Deprecated DBOSAgent and PrefectAgent model units are durable units · iter -
- Decision: Wrap DBOSModel's request steps and PrefectModel's request tasks in durable_unit_scope(), as TemporalModel's activities are
- Why: Pre-push review 1 at 93f0b91464: the wrappers have no durability capability, so the run holds the socket lease and their model units would otherwise use it
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 2 of 3 at 608d65627d64e604119a8464fd4d483bcbf490d7 (redesign task) · iter -
- Decision: dispatched (reserved)
- Why: tree c4c6e55183e9018937c1972176d36fcd35169057; follow-up 93f0b91464..60366e1333 plus clean upstream merge 608d65627d; review 1 findings to verify
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 2 of 3 at 608d65627d64e604119a8464fd4d483bcbf490d7 (redesign task) · iter -
- Decision: remediated: digest paragraph names openai_transport='websocket'; storage note tells ZDR users to set openai_store=False; review 1 findings verified fixed
- Why: tree c4c6e55183e9018937c1972176d36fcd35169057; follow-up 93f0b91464..60366e1333 plus clean upstream merge 608d65627d; two docs findings, both do
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 3 of 3 at 1f5d620f8f4bd03c9721841f34efd213482a1e20 (redesign task) · iter -
- Decision: dispatched (reserved)
- Why: tree 6b04b70d5894dc2a9801d46870f1f05dff00afec; follow-up 608d65627d..38f60ccc14 (docs) plus clean upstream merge 1f5d620f8f; review 2 findings to verify
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-22 · pre-push review 3 of 3 at 1f5d620f8f4bd03c9721841f34efd213482a1e20 (redesign task) · iter -
- Decision: no findings
- Why: tree 6b04b70d5894dc2a9801d46870f1f05dff00afec; follow-up 608d65627d..38f60ccc14 plus clean upstream merge 1f5d620f8f; review 2 findings verified fixed
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-23 · Gateway is a never-socket setup · iter -
- Decision: Models whose provider namespace starts with gateway/ warn and use HTTP in WebSocket mode, gated on model_id_namespace, not base_url
- Why: Live 2026-10-22: gateway/openai over HTTP answered, while openai_transport='websocket' failed every run with a 503 from the handshake; config-driven opt-in must not break gateway users
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-23 · push past exhausted review budget at a776c4b289e65cb5586e58ba3395f70de4af3e7b · iter -
- Decision: Push the gateway fallback and skill typing fix without a fourth pre-push review
- Why: Budget 3 of 3 used for the redesign task (last reviewed 1f5d620f8f, tree 6b04b70d58); delta is one guard, one test case, one docs list item and one skill line; targeted test and pyright pass
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-23 · exempt delta at a052d171fb8e866040616e6e5c2fed0116708fbe · iter -
- Decision: Push the SigV4 test skip and a clean upstream merge without review
- Why: Chains from a776c4b289 (pushed past the exhausted budget); d2b259a72d is a test-harness repair (standard CI lacks botocore, which the SigV4 case needs); merge a052d171fb has no conflict resolution and no lockfile change
- Source: https://github.com/pydantic/pydantic-ai/actions/runs/39876469829
2026-10-23 · No explicit connection handle needed · iter -
- Decision: Keep connect() removed; async with agent/model is the only lifecycle control
- Why: The PR's heaviest user confirmed the settings-based API fits their config-driven setup and needs no separate handle, answering the maintainer's open question
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6353900445
2026-10-23 · Second opinion: pydanty:review-lite · iter -
- Decision: David chose pydanty:review-lite as the additional review surface at a052d171fb
- Why: Loop complete: CI green, threads settled; review-lite writes per-diff charters and reports without remediating
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-23 · pydanty review-lite finding: Temporal durable-unit test · iter -
- Decision: Do: add a Temporal counterpart of the DBOS/Prefect HTTP tests, driving TemporalModel.request_activity and request_stream_activity through ActivityEnvironment while async with model holds a worker-loop lease
- Why: net-positive: the scope is load-bearing when a worker-loop lease exists and only the DBOS/Prefect siblings pinned it; ActivityEnvironment needs no dev server
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6355056414
2026-10-23 · exempt delta at e9564266d3b389b54984d10a03063060dd13e308 · iter -
- Decision: Push the Temporal durable-unit test and a clean upstream merge without review
- Why: Chains from a052d171fb (itself exempt from a776c4b289, pushed past the exhausted budget); 8a7b29026c is test code only, passes, and fails with durable_unit_scope disabled; merge e9564266d3 has no conflict resolution, no lockfile change, and an identical branch diff against old base 3491aaa401 and new base
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6355056414
2026-10-24 · Connected-model entries retired · iter -
- Decision: connect(), the connected copy and the durable guards no longer exist; count_tokens and compact_messages always use HTTP; max_retries warns on socket-bound requests only
- Why: Audit 2026-10-24: these entries describe code the openai_transport redesign removed; grep finds no connect() on the model, reject_live_connection or _contains_live_connection
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6354012512
- Supersedes: Connection API stays; multiplex lanes next; Session proposal and strict history dependency; HTTP operations on connected Responses models; Temporal guard at request boundary; max_retries on a connected model; Host default stays in connect(), not the profile hook
2026-10-24 · Cross-transport chaining is store-based only · iter -
- Decision: A socket response chains across transports only when its echoed store flag is true; there is no stored-seed ancestor or replay trimming
- Why: Audit 2026-10-24: the 10-16 and 10-20 seed entries predate 'Chain socket responses by echoed store flag', which dropped trimming; no seed code remains in models/openai.py
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6351271321
- Supersedes: Cache-only response IDs stay on their socket; Stored seed across a transport change; Validate the stored seed before transport replay trimming; Integrate finalized Responses history guard (its connected-copy and replay-policy clauses)
2026-10-24 · Redesign widened the self-review out-list · iter -
- Decision: Reconnect, 50-minute rotation and DBOS/Prefect durable_unit_scope are in this PR; previous_response_not_found replay, steering, to_web and #10237 stay out
- Why: Audit 2026-10-24: 'Self-review remediation scope' listed reconnect and DBOS/Prefect as out; the redesign brought both in
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6352061642
- Supersedes: Self-review remediation scope (reconnect and DBOS/Prefect clauses)
2026-10-24 · Selected models lease through aenter · iter -
- Decision: Only _PreparedAgentRun.open enters the default model's _run_scope(); selected models lease via OpenAIResponsesModel.aenter from enter_model; the redesign uses one socket per model, no pool
- Why: Audit 2026-10-24: 'Run lease hook' says the hook is held for every selected model and 'Setting-based transport' says socket pool; later entries changed both
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
- Supersedes: Run lease hook, not Model.aenter (selected-model clause); Setting-based transport replaces connect() (socket-pool clause)
2026-10-24 · Never-socket setups become a profile flag; lane host default stays the named exception · iter -
- Decision: Move the Azure, gateway, OAuth-provider and Codex never-socket facts out of _websocket_unsupported_reason into an OpenAIModelProfile flag the socket path reads; the stream_id lane host default stays at its use site as the one host exception models/AGENTS.md names; missing extra, non-asyncio loop and the SDK handshake auth error stay runtime checks
- Why: Upstream #11106 says use sites read only a profile flag and no capability is decided by host; David chose the hybrid so profile= can override never-socket facts while lanes keep their correctness default
- Source: https://github.com/pydantic/pydantic-ai/pull/11106
- Supersedes: Gateway is a never-socket setup (its use-site gating clause); Lane default stays in connect() (its location)
2026-10-24 · Never-socket facts move into openai_responses_supports_websocket · iter -
- Decision: AzureProvider.model_profile sets it False (API fact); OpenAIResponsesModel._instance_profile_defaults sets it False for an AsyncAzureOpenAI client, a gateway provider (is_gateway_provider) or an OAuthCredentialsProvider; OpenAICodexModel._instance_profile_defaults sets it False; the use site reads only the flag plus the extra, loop and SDK-handshake runtime checks
- Why: PR 11106's gating rule: read only a profile flag at the use site; _instance_profile_defaults lets the user's profile= override and reads only types and provider identity, never client URLs
- Source: https://github.com/pydantic/pydantic-ai/pull/11106
2026-10-24 · final pass review (author-requested) at 4ea3e9455521b2d93df6c018a7637390937ed02c · iter -
- Decision: dispatched (reserved)
- Why: tree 05e3c517b84fb79f27429f1417f77910826edb27; full branch 3ea7e54e1203456c590db15deca04f771f14ab32..4ea3e9455521b2d93df6c018a7637390937ed02c (merge 1359a48439 with an AGENTS.md conflict resolution, never-socket profile flag 4d6c48b7c1, guide pointer 4ea3e94555); David asked for a final pass; does not count against the exhausted budget
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-24 · final pass review (author-requested) at 4ea3e9455521b2d93df6c018a7637390937ed02c · iter -
- Decision: finding: OAuth providers and OpenAICodexModel set the flag in _instance_profile_defaults, so profile= can force a socket that can't authenticate or carry session headers; move both to the profile property; merge resolution verified correct — do
- Why: tree 05e3c517b84fb79f27429f1417f77910826edb27; full branch 3ea7e54e12..4ea3e94555; counts as review 1 of 3 of the final-pass task, a new budget since David's hybrid choice changed the acceptance criteria
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-24 · Hard never-socket limits apply after profile= · iter -
- Decision: OAuth credential providers and OpenAICodexModel set openai_responses_supports_websocket=False in the model's profile property; Azure, the AsyncAzureOpenAI client and the gateway stay in _instance_profile_defaults, where profile= can override them
- Why: OAuth credentials reach HTTP requests only and Codex session headers vary per conversation, so an override can't work; agent_docs/provider-adapters.md puts such limits in the profile property
- Source: https://github.com/pydantic/pydantic-ai/pull/11106
2026-10-24 · OAuth providers and OpenAICodexModel keep the socket off past profile= · iter -
- Decision: OpenAIResponsesModel.profile sets openai_responses_supports_websocket=False for an OAuthCredentialsProvider and OpenAICodexModel.profile sets it False, both after the user's profile=; Azure, the AsyncAzureOpenAI client and the gateway stay overridable in _instance_profile_defaults
- Why: Review finding at 4d6c48b7c1: OAuth credentials reach HTTP only, so a forced handshake fails instead of warning; Codex session headers never reach the socket; provider-adapters.md puts a limit the setup can't get past in the profile property
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
- Supersedes: Never-socket facts move into openai_responses_supports_websocket (OAuth and Codex placement)
2026-10-24 · pre-push review 2 of 3 at f542a74828e0b33badce9f23f48ac78353c4c550 (final-pass task) · iter -
- Decision: dispatched (reserved)
- Why: tree 6fd299a1992fbed204a2ca7af227469e315ff2a8; follow-up 4ea3e94555..f542a74828 plus review 1 finding to verify
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-24 · pre-push review 2 of 3 at f542a74828e0b33badce9f23f48ac78353c4c550 (final-pass task) · iter -
- Decision: no findings; review 1 finding verified fixed
- Why: tree 6fd299a1992fbed204a2ca7af227469e315ff2a8; follow-up 4ea3e94555..f542a74828
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-25 · Second opinion at f542a74828: pydanty:review-lite · iter -
- Decision: David chose pydanty:review-lite after the final-pass loop completed
- Why: The merge and the profile-flag gating changed public API since review-lite last ran at a052d171fb
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-25 · pydanty review-lite triage at f542a74828 · iter -
- Decision: Do 1, 2, 3, 4, 6, 9, 10; skip 5 (shared frame module) as net-neutral and the two optional suggestions; refute 7 and 8 with OpenAI's guide: 32 named stream_id values, 16 in-flight responses, 60-minute connections, websocket_connection_limit_reached means the 60-minute limit
- Why: 10 is a real cross-loop race against the settled per-loop lease decision; 2 follows #9931's resolved placement review; the rest are cheap test or docs fixes
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6392560560
2026-10-25 · Skill WebSocket section lives in AGENTS-CORE · iter -
- Decision: Moved the section to AGENTS-CORE.md as 'Reuse an OpenAI Responses WebSocket' after 'Choose or Configure Models', reverted INPUT-AND-HISTORY.md to main, added the phrase to both Agents Core routing rows
- Why: #9931's resolved review moved it there; the transport is model and provider configuration
- Source: https://github.com/pydantic/pydantic-ai/pull/9931#discussion_r4250596648
2026-10-25 · Lane reservation checks the socket's event loop · iter -
- Decision: _ResponsesWebSocketHolder.reserve returns None when socket.loop is not the request's loop, next to the headers check
- Why: A request on another thread's loop can pass _websocket_transport's loop check while the socket is None and find it open at reserve; reproduced by a direct reserve test that failed before the fix
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6392560560
2026-10-25 · pre-push review 3 of 3 at e34f0c29a96600b46d38c9631e8643ca8cce55fa (final-pass task) · iter -
- Decision: dispatched (reserved)
- Why: tree ce0515cb82b3109f77bb472b6315f3496cd9e984; follow-up f542a74828..e34f0c29a96600b46d38c9631e8643ca8cce55fa (pydanty review-lite remediation) plus findings to verify
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6392560560
2026-10-25 · pre-push review 3 of 3 at e34f0c29a96600b46d38c9631e8643ca8cce55fa (final-pass task) · iter -
- Decision: finding: a request on a second event loop can await another thread's anyio open_lock and hang, or close that loop's socket; review-lite items 1-4, 6, 9 verified fixed — do
- Why: tree ce0515cb82b3109f77bb472b6315f3496cd9e984; follow-up f542a74828..e34f0c29a9; reachable because run_sync gives each worker thread its own event loop (_utils.get_event_loop); budget now exhausted
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-25 · One event loop owns the socket holder at a time · iter -
- Decision: _ResponsesWebSocketHolder.owner_loop, claimed under a threading.Lock before in_flight += 1, sends requests on any other loop over HTTP; cleared once no socket and no request remain
- Why: Concurrent run_sync threads share one model on separate loops; anyio's Lock and in_flight are single-loop state
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-25 · One event loop owns the WebSocket holder at a time · iter -
- Decision: _ResponsesWebSocketHolder.owner_loop is claimed under a module-level threading.Lock as the last gate in _websocket_transport, before in_flight += 1; requests on any other loop use HTTP; close_if_unused, run only on the owner loop, clears it once no request is in flight and either no socket is left or the owner's leases have ended; the gate's socket.loop check is gone, reserve keeps its loop check
- Why: A run_sync on another thread passed the gate while the owner's handshake was in flight, then waited on the owner's anyio lock, whose cross-thread release can't wake its loop; reproduced (waited=True) at e34f0c29a9. A module-level lock keeps the holder copyable and picklable
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
- Supersedes: Leases counted per event loop (the 'only if the socket opened there' clause now follows from ownership)
2026-10-25 · push past exhausted review budget at 97226c7a1bb21c4fb890532f74360e8621e7f1b8 (final-pass task) · iter -
- Decision: Push the review 3 remediation without a fourth review
- Why: Budget 3 of 3 used at e34f0c29a9 (tree ce0515cb82); 97226c7a1b remediates its one finding; the repro hung before and passes after; WS, Responses HTTP and client-lifecycle tests, pyright and ruff pass
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
2026-10-25 · exempt delta at 4a0663e774f39fe649cf8b1c01dfe40f9bb9cc3f · iter -
- Decision: Push the no-cover pragma without review
- Why: Chains from 97226c7a1b (pushed past the exhausted budget, remediating review 3 at e34f0c29a9); missing-coverage fix, test code only: one pragma on a stub the test asserts never runs; both affected tests pass
- Source: https://github.com/pydantic/pydantic-ai/actions/runs/40161962054
2026-10-27 · Per-loop socket and externally owned durable borrowing · iter -
- Decision: Give each model instance one socket state per event loop; durable units may borrow a state held by an explicit outer model context; acquisition returns its ownership receipt for release.
- Why: Douwe approved durable borrowing and the per-loop redesign; an activity-owned model still uses HTTP, and release must not recompute the durable flag.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6454270452
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-27 · Retry early rejected socket requests within the effective SDK budget · iter -
- Decision: Retry 408, 409, 429 and 5xx error frames before the first response event, honoring max_retries and retry-after; rebuild history after eviction; propagate disconnects and later stream failures.
- Why: Socket opt-in must preserve bounded rejection retries, while zero lets durable engines own their retry budget.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6426071268
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-27 · pre-push review 1 of 3 at a9b455a659b94359a4d21a6d92eb3f23ea4d0025 (October 27 advancement) · iter -
- Decision: dispatched (reserved)
- Why: tree cfe084146c2dd5fa3867fab3feda797613277ee4; full branch 45eb9d0d9d7b0c87a981d8af01ebb8d383a0f20c..a9b455a659b94359a4d21a6d92eb3f23ea4d0025; new task and acceptance criteria after maintainer approval of per-loop durable borrowing; policy base a95631856380c54f87aecb4d6d552496d436c304
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6454270452
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-27 · pre-push review 1 of 3 outcome at a9b455a659 (October 27 advancement) · iter -
- Decision: Do: isolate overlapping model context receipts by entering task; update generic retry docs and the bundled model-constructor keyword.
- Why: The unchanged reviewed tree cfe084146c2dd5fa3867fab3feda797613277ee4 has a loop-wide LIFO receipt stack, stale once-only retry docs and model_settings incorrectly recommended on a model constructor.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-27 · Bind socket ownership receipts to lifecycle scopes · iter -
- Decision: Agent model contexts bind a unique lifecycle key for captured socket receipts; direct model contexts use per-task stacks.
- Why: Overlapping contexts must release their own lease, while selected model entry and exit can run in different tasks; lifecycle overrides and exception suppression remain intact.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6454270452
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-27 · pre-push review 2 of 3 at 5b00aa9d2f8dcf54cebe1f1c12e50d6537a8bd55 (October 27 advancement) · iter -
- Decision: dispatched (reserved)
- Why: tree c5369da919130c687996081f95abe13ca40bad8d; scoped follow-up a9b455a659..5b00aa9d2f with affected lifecycle callers and full branch context; policy base a95631856380c54f87aecb4d6d552496d436c304
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-27 · pre-push review 2 of 3 outcome at 5b00aa9d2f (October 27 advancement) · iter -
- Decision: Do: bind retained FallbackModel child lifecycles to their own contexts; prior three findings verified fixed.
- Why: Reviewed tree c5369da919130c687996081f95abe13ca40bad8d unchanged; follow-up a9b455..5b00aa9 exposed fallback cleanup under a different owner key.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-27 · Model lifecycle identity is task-bound only during entry and exit · iter -
- Decision: Bind retained FallbackModel children through their own lifecycle contexts; ignore inherited context identities in tasks spawned by lifecycle hooks.
- Why: Event-ordered regressions reproduced fallback cleanup KeyError and stale external ownership in a child task; stable context keys must not become ambient ownership for descendants.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-27 · pre-push review 3 of 3 at c5a865e8000d639322ed53e2156f98beac424e1a (October 27 advancement) · iter -
- Decision: dispatched (reserved)
- Why: tree 4e21a7e1e435bf5524649374fd608f0030a407ad; follow-up 5b00aa9..c5a865e plus affected lifecycle callers and merged main interactions; policy and merge base ca2e78a9c192d55203f1e993ac280c877f0f611e
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-27 · pre-push review 3 of 3 outcome at c5a865e800 (October 27 advancement) · iter -
- Decision: Do: recognize accepted compatible-provider stateless compaction as a hard continuation boundary.
- Why: Reviewed tree 4e21a7e1e435bf5524649374fd608f0030a407ad unchanged; upstream now accepts Codex compaction, but continuation can select an older OpenAI response ID; prior fallback finding verified fixed. Review budget exhausted; remediate and verify before push.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Compatible stateless compaction resets continuation and cache comparison · iter -
- Decision: Treat accepted compatible-provider /compact responses as hard boundaries before provider-name filtering for previous_response_id and prompt-cache comparison selection.
- Why: Frame-level tests reproduced both older IDs after Codex compaction over WebSocket and explicit HTTP auto; same-provider and incompatible Azure baselines pass. This is the same confirmed defect in two selectors and transports.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Push final review remediation at 8d47c76c617c31528f3414cc61acbd8d6628ff64 · iter -
- Decision: Push after the third review remediation without a fourth review.
- Why: Budget3 of3 reviewed c5a865e800 tree4e21a7e1e435bf5524649374fd608f0030a407ad; final treef0baa429cf3975bec2dc07c9dcb82a50db98c300 fixes the reproduced compaction selector defect; focused transport/durable/HTTP/lifecycle and existing compaction checks, Pyright and pre-commit pass.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · CI fixture correction at 7532f0eaf3f2d118ad467ca5b600e12b0153ee1e · iter -
- Decision: Push the optional-dependency collection guard and exact mock endpoint assertion without a fourth pre-push review.
- Why: Review budget3 exhausted; tree2ece38c1fdb5169bfbfb656eb5a11b3396670c51 changes only the Temporal test fixture. Existing masked-import tests and real Worker regression, targeted Pyright and pre-commit pass.
- Source: https://github.com/pydantic/pydantic-ai/actions/runs/40606301153
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · SDK credential callbacks preserve per-request authentication over HTTP · iter -
- Decision: Force openai_responses_supports_websocket=False after profile overrides for SDK API key callbacks and Azure AD token providers; retain static-credential WebSocket reuse.
- Why: Public-Agent probes reproduced a denied second principal reusing the first handshake without invoking either callback. HTTP preserves the SDK credential selection; successful token refresh and denied credentials are covered.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4395608434
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Credential and coverage remediation at ac6bf6acf7865525a76495a1873f911a9f89bc1b · iter -
- Decision: Push the verified review and coverage remediation under the exhausted three-review budget.
- Why: treec99ebf0bdf916b67e50c99c2ec21d33aeb9cd7d3; callback identity/refresh, transport, Worker/DBOS and settings-wire tests pass; focused coverage executes retry-capacity and lease paths with zero Temporal missing lines; targeted Pyright/pre-commit pass. Run-scope receipts are nonoptional because Agent scopes require asyncio.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4395608434
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Preserve raw context cleanup across tasks and loops · iter -
- Decision: Retain captured lease kinds; defer ambiguous raw-context releases until the last exit and suspend durable borrowing, scheduling live socket closure on its owning loop.
- Why: Cross-task and cross-loop teardown of ordinary HTTP models reproduced KeyError; guessing a receipt can falsely retain external ownership.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4395905015
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Keep the Responses socket extra explicit · iter -
- Decision: Use the existing openai extra and direct websockets>=14,<16 dependency without the SDK realtime extra.
- Why: The direct bound preserves the installed SDK compatibility window and removes redundant SDK requirements and checker exceptions.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4395905811
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Direct model contexts have no scope identity · iter -
- Decision: Treat direct model entries as unidentified; only consume interchangeable receipts early, otherwise suspend durable borrowing and drain captured receipts at the last exit.
- Why: A task can close a different exit stack while holding its own model context, so matching task identity does not identify the context that ended. Agent-managed scopes retain exact identity.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4395905015
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · HTTP client authentication must run per request · iter -
- Decision: Use HTTP for SDK callbacks, workload identities and HTTP client authentication; share their classification with batch validation.
- Why: The SDK socket skips http_client.auth; both default and forced profiles let a denied second principal reuse the socket in a failing public regression. Workload identity already fails safely in the SDK.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4396359580
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Keep the SDK socket compatibility bound scoped · iter -
- Decision: Keep openai-responses-websocket as the transport-specific extra; correct the installation text about realtime dependencies.
- Why: Responses uses the SDK socket client and its websockets<16 bound; realtime uses a separate direct transport. Merging the bound would constrain unrelated realtime users.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4396358901
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Name the shared compaction fix in the release title · iter -
- Decision: Keep the confirmed cross-provider compaction boundary fix shared by HTTP and WebSocket selectors and name compaction explicitly in the PR title.
- Why: Both transports reproduced the same selector defect; an explicit title makes the HTTP fix discoverable without splitting the shared fix into another PR.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4396359238
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Defer the pre-existing cold batch-header blocking path · iter -
- Decision: Track the baseline blocking defect separately; keep guarded feature/auth checks and verify batch compatibility without claiming the cold-header guard passes.
- Why: The original main-base batch test reproduces the same uname pipe-read failure; choosing where SDK metadata is resolved affects credential grouping and other SDK paths.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4396494530
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Recheck authentication before each socket request · iter -
- Decision: Check current SDK and HTTP authentication at the transport boundary as well as when resolving the cached profile.
- Why: Adding HTTP auth after a socket opened bypassed the new profile guard in both default and forced-profile regressions; cached capability flags cannot establish current request credentials.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4396359580
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Keep mutable authentication as a runtime fallback · iter -
- Decision: Use the shared auth classifier only at request transport selection and batch validation; cached profile flags describe static provider and model capabilities.
- Why: HTTP authentication can change after a profile is cached. Removing the cached projection leaves one request-time source of truth, while actual SDK token-exchange and denied-user regressions preserve safety.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4396921139
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
- Supersedes: Recheck authentication before each socket request
2026-10-28 · Make the model run-resource hook backend-neutral · iter -
- Decision: A missing asyncio lease makes the model resource hook a no-op; direct model HTTP fallback works on Trio with and without WebSocket mode.
- Why: Both direct-model controls passed and both hook variants asserted before correction. Whole-Agent Trio controls also fail in existing asyncio lifecycle hooks, so this does not claim or add wider Agent backend support.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4396920835
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Per-loop state owns socket loop identity · iter -
- Decision: Remove the duplicate socket loop field and foreign-loop reservation guard; retain observable independent-loop and owner-loop cleanup coverage.
- Why: Reservation selects states by the running loop and opens sockets on that loop; the old direct reserve test injected an unreachable state.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4397388201
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Keep the instructed quote style in install markup · iter -
- Decision: Keep single quotes in the new install entry; remove its implementation-specific compatibility-bound tail.
- Why: The explicit worktree rule requires single quotes in docs; matching older markup would contradict that rule, while the tail does not help installation.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4397388561
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Preserve custom Azure-named provider socket support · iter -
- Decision: Keep distinct Batch API and WebSocket client predicates; consolidate only retry cleanup and clarify both profile constraints.
- Why: An offline before/after probe showed a custom provider named azure with an ordinary OpenAI client and advertised socket support changed from true to false under the combined predicate.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4397387583
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-28 · Temporal fixture imports · iter -
- Decision: Share socket and frame fixtures through the durable test helper.
- Why: Importing the model test loads root conftest and cassetter into Temporal.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4401669840
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-29 · Use existing WebSocket dependencies and preserve batch auth · iter -
- Decision: Use openai-realtime for Responses sockets; remove the Responses-only extra and restore the prior batch credential checks.
- Why: Maintainer requested one transport concern per PR; the new extra and Azure AD batch rejection added independent public surface and behavior.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6473376713
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-29 · Replace scope receipts with loop-local lease counts · iter -
- Decision: Remove ModelContext and context receipts; count leases per loop and keep one reusable-state flag to exclude newly activity-owned models.
- Why: Freshly resolved models enter inside durable units: both callback and registered backend regressions open sockets with counts alone. In-flight requests preserve active sockets; a per-holder lock protects cross-thread teardown.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6473376713
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-29 · Retry rejection overflow uses remaining HTTP budget · iter -
- Decision: Retryable socket rejection can overflow to HTTP when its lane is busy; pass the remaining transport retry budget through the SDK.
- Why: The targeted red test reproduced an avoidable 503 while a sibling held capacity; stopped-loop teardown also now drops its socket instead of awaiting it on another loop.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6473376713
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-29 · Split compatible compaction continuation into its own PR · iter -
- Decision: Move the plain-HTTP boundary fix to PR11861 using the shared CompactionPart wire predicate; base10444 on that companion.
- Why: Main already shares part compatibility for trimming but not previous-ID or prompt-cache scans. Independent HTTP behavior now has its own tests, review and CI.
- Source: https://github.com/pydantic/pydantic-ai/pull/11861
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-29 · Keep legacy durable workflow runs from implicitly owning sockets · iter -
- Decision: Suppress automatic run scopes inside legacy DBOS workflows and Prefect flows; preserve explicit outer contexts and ordinary scopes outside workflows.
- Why: Independent DBOS failures and a fresh Prefect reproduction showed implicit leases crossing durable units. Both engines now pass HTTP, external ownership and outside-container controls; SDK overflow tests also pin positive and exhausted remaining budgets.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6433861482
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-29 · Describe HTTP continuation when the socket is unsupported · iter -
- Decision: Keep WebSocket-mode continuation defaults and history metadata on HTTP requests, including unsupported socket setups, and state that behavior in the warning and setting documentation.
- Why: The mode already uses the same continuation policy for HTTP overflow. A two-turn regression reproduces the inaccurate ignored-setting warning while HTTP continues the stored response; correcting the contract preserves wire behavior.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4417011286
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-29 · Trace HTTP sends throughout WebSocket mode · iter -
- Decision: Record http on instrumented WebSocket-mode HTTP chat spans and websocket on socket spans; keep plain HTTP spans untagged.
- Why: A first-attempt header fallback reproduced missing transport telemetry. Tagging the common HTTP send covers initial and retry fallbacks without labeling failed socket handshakes as HTTP.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4418425090
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-29 · Jitter bounded WebSocket rejection backoff · iter -
- Decision: Use 0.5-second initial and 8-second maximum backoff with 0–25 percent downward jitter; preserve the 60-second server-directed wait limit.
- Why: A deterministic probe reproduced identical retry delays. Independent jitter avoids synchronized lanes; the SDK initial/max/jitter values were verified locally, while longer Retry-After waits remain caller-owned under the existing WebSocket bound.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4418425096
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-29 · Share repeated OpenAI credential and storage checks · iter -
- Decision: Share the unchanged API-key callback/workload-identity predicate with batch, and the WebSocket-only echoed-store predicate between streamed and non-streamed Responses.
- Why: Both predicates have two callers; one mapping prevents drift while retaining batch conditions, HTTP metadata, and socket provenance.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#pullrequestreview-5706164963
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Preserve endpoint-scoped history after main integration · iter -
- Decision: Use the merged server-state predicate for automatic socket continuation; preserve caller-supplied concrete seeds as over HTTP.
- Why: The owned-socket probe confirms automatic replay across endpoints; HTTP and WebSocket controls both retain explicit IDs while replaying unmatched history.
- Source: https://github.com/pydantic/pydantic-ai/pull/11774
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Resolve socket timeouts at each request phase · iter -
- Decision: Share timeout normalization between socket reservation and send without caching a resolved timeout on the stream.
- Why: The two identical expressions use a shared resolver while preserving settings preparation and current SDK-client defaults at each existing call site.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4420362223
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Integrate the merged compaction companion into main · iter -
- Decision: Keep the reviewed WebSocket reachability helper unchanged while merging main435e23a435, retaining the independently merged compaction fix.
- Why: The sole conflict is the WS-only helper versus an empty incoming arm; the complete feature patch equals reviewed70def modulo index and hunk offsets. Focused WS/client-lifecycle checks and targeted Pyright pass. Three local reviews remain exhausted; this conflict is not claimed as a no-conflict exemption; obtain fresh current-head hosted review.
- Source: https://github.com/pydantic/pydantic-ai/pull/11861
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Fall back before a WebSocket request can be sent · iter -
- Decision: Warn and use HTTP after connection-setup transport failures; an idle-closed socket gets one replacement attempt before HTTP. Preserve HTTP handshake rejections and post-send transport failures.
- Why: TLS, handshake and timeout regressions reproduced the failed runs without any response.create frame; the idle-replacement regression reproduced the same unwritten-request boundary. HTTP replays retained history when the old socket cache is unavailable.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6530750239
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Keep short credential checks local to each transport gate · iter -
- Decision: Inline the SDK callback and workload-identity checks in WebSocket selection and restore the batch inline check; remove the shared private helper and its cross-module ignore.
- Why: Both predicates keep their observed authentication behavior without adding a maintained public helper or coupling batch validation to a private model symbol.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6530750239
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Pre-push review budget for the October 30 handshake feedback task · iter -
- Decision: Start the bounded three-review budget for the new maintainer feedback task.
- Why: The previous advancement ended at verified15c1; the new request introduces a pre-send HTTP fallback acceptance criterion and executable docs, beyond its former acceptance criteria. This budget covers all remediation loops for comment6530750239.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6530750239
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Pre-push review 1 of 3 at ed82e6b91f for handshake feedback · iter -
- Decision: Dispatched (reserved).
- Why: Tree8560fcae52d715c08203371ccb050f85babbb949; scoped15c1bbb577..ed82e6b91f plus affected callers and full branch context; new feedback6530750239 task; policy97faeafec56a5deb7735d07278938b4cc2989146.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6530750239
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Pre-push review 1 outcome at ed82e6b91f for handshake feedback · iter -
- Decision: Remediated: carry spent rejection retries across unsent socket replacements and pass only the remaining HTTP retry budget.
- Why: Reviewedtree8560fcae52d715c08203371ccb050f85babbb949; finding reproduced extra written WS and HTTP attempts at max_retries1. Both regressions and the affected rejection/fallback matrix now pass.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6530750239
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Keep the retry budget across pre-send transport changes · iter -
- Decision: Carry rejection_retries onto idle-socket replacements; HTTP fallback receives the remaining effective SDK retry budget, clamped at zero.
- Why: A prior rejection already consumed part of max_retries even if the next socket closes before writing. The reproduced WS and HTTP excess-send cases now stay inside one logical request budget.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6530750239
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Pre-push review 2 of 3 at 04ccd19b1e for handshake feedback · iter -
- Decision: Dispatched (reserved).
- Why: Tree0b091d7d5cc7a3a6b4f5249c5a4e790b89b1d643; scopeded82e6b91f..04ccd19b1e plus affected retry callers and finding1; policy97faeafec56a5deb7735d07278938b4cc2989146.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6530750239
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Pre-push review 2 outcome at 04ccd19b1e for handshake feedback · iter -
- Decision: No findings; the prior retry-budget finding is verified fixed.
- Why: Reviewedtree0b091d7d5cc7a3a6b4f5249c5a4e790b89b1d643 unchanged; scopeded82e6b91f..04ccd19b1e plus affected retry callers. Budget2of3 used.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#issuecomment-6530750239
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Exempt main sync after reviewed 04ccd19b1e · iter -
- Decision: Push the clean merge d590c8f9a4538f4f4cfca73fdad5d8f9d92c595d without another local review.
- Why: Budget2of3 used; chains from reviewed04ccd19b1e/tree0b091d7d5cc7a3a6b4f5249c5a4e790b89b1d643. Main16f2040f25 only rebuilds two clai2 web assets; no conflicts or dependency changes; full feature diff unchanged modulo indexes/hunk offsets against old97fa and new16f bases. Finaltreec60885ff2046e54735463c19266cea78dc755541.
- Source: https://github.com/pydantic/pydantic-ai/pull/12008
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Optional WebSocket test fixtures are lazy · iter -
- Decision: Construct TLS and proxy handshake exceptions inside test execution, after the optional dependency skip guard.
- Why: Slim and evals CI collection reproduced NameError before the fix; missing-websockets collection and the targeted handshake/retry matrix now pass, with targeted Pyright clean. Test-harness-only exemption chains from reviewed 04ccd19b1ef58c8bf143feea0102f250278688ca; the only other delta is the previously verified clean UI main merge; review budget remains 2 of 3.
- Source: https://github.com/pydantic/pydantic-ai/actions/runs/41116142312
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Suppress failed handshakes for the shared socket lifetime · iter -
- Decision: Record a pre-send connection failure in its loop-local socket state; later requests in that lifetime use HTTP without another handshake or warning, and a fresh lifetime retries.
- Why: Douwebot finding reproduced for TLS, proxy and SDK connection failures on initial, idle-replacement and retirement handshakes: the second request attempted the handshake again. Keep the failure flag under the opening lock so waiting requests observe it.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4428008177
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · pre-push review 3 of 3 at f130df56f3 (maintainer feedback task) · iter -
- Decision: dispatched (reserved)
- Why: Tree b6d2c60f3e4c411f06fe52c5a88f86dec7e6d8a9; scoped follow-up from last reviewed 04ccd19b1ef58c8bf143feea0102f250278688ca plus affected callers and public review 41120390730. Bounded task budget is now 3 of 3, not reset after hosted feedback; policy main16f2040f25147d70a2d67fc319d666f5a9062f60.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4428008177
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · pre-push review 3 of 3 outcome at f130df56f3 (maintainer feedback task) · iter -
- Decision: current; no findings
- Why: Reviewed tree b6d2c60f3e4c411f06fe52c5a88f86dec7e6d8a9 is unchanged; the scoped follow-up and hosted handshake finding were independently checked. Review budget is exhausted at 3 of 3.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4428008177
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Exempt clean main dependency sync at c620215636 · iter -
- Decision: Push the clean main merge without another pre-push review.
- Why: Chains from reviewed f130df56f35b3d88e8212af22b0e0c32df98606d/treeb6d2c60f3e4c411f06fe52c5a88f86dec7e6d8a9; main72fc98addf only updates joserfc in uv.lock. Entire feature diff before/after is byte-identical; no conflicts. make install completed before normal hooks, which pass. Budget remains exhausted at 3 of 3.
- Source: https://github.com/pydantic/pydantic-ai/pull/12014
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Expose complete recorded WebSocket frames in snapshots · iter -
- Decision: Replace piecemeal cassette assertions with generated inline snapshots of full outbound frames, deterministic outputs, and relevant history/provenance.
- Why: The required review identified fields that recordings can add or drop without failing selective assertions; snapshots make the entire contract reviewable. Keep actual frame replay matching and scope this round to tests plus consolidating the existing credential note in its table row.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4428313915
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Preserve durable borrowing while merging first-event deadlines · iter -
- Decision: Keep durable_unit_scope around the newly merged open_durable_unit_stream in DBOS, Prefect and Temporal model units; retain both timeout and WebSocket imports and regenerate the durable contract.
- Why: Main cde1d10f88 introduces first_event_timeout and retry/fallback changes. Actual conflicts were resolved by combining both behaviors. Existing WebSocket, real Worker/ActivityEnvironment, DBOS/Prefect streaming, first-event timeout, fallback, batch and manifest checks pass; targeted Pyright is clean.
- Source: https://github.com/pydantic/pydantic-ai/pull/11582
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
2026-10-30 · Push snapshot and merge follow-up at 4972122e5d under exhausted budget · iter -
- Decision: Push the verified review remediation and main integration without a fourth pre-push review.
- Why: Last reviewed f130df56f35b3d88e8212af22b0e0c32df98606d/treeb6d2c60f3e4c411f06fe52c5a88f86dec7e6d8a9; budget3 of3 exhausted. Snapshots were generated from unchanged recordings and playback passes. Main conflict resolution is not claimed exempt: preserve both scopes/timeouts, regenerate contract, and verify the focused WebSocket/durable/timeout/fallback/batch/manifest matrix, targeted Pyright and normal hooks. Final tree39740bf09cd0282d051f3bafe43922dd4c0d7aab.
- Source: https://github.com/pydantic/pydantic-ai/pull/10444#discussion_r4428313915
- Session: 01a17f94-09f2-7db1-8461-346e575fb310
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.