What happened
pydantic‑ai v2.58.0 was released on 2026‑10‑17 [S1]. The diff shows 119 commits, six contributors, and 300 files changed, with 6,379 lines added and 1,865 lines removed [S0]. A breaking‑change marker removes the Group clai2 sessions by project and worktree, keeping removed worktrees under their repository (#10349) [S0]. This means code that relied on automatic grouping will no longer find those sessions and must be updated [S0]. The compatibility notes say that a resumed suspended response is counted only in the run that produced it, affecting RunUsage, UsageLimits and SpendLimits [S1]. In practice, this prevents double‑counting of usage when a model pauses and later resumes [S1]. RealtimeConnection now yields lifecycle events through a public pydantic_ai.realtime.lifecycle module [S1]. Developers can now listen for start, stop and error events from a realtime session [S1]. A new DelegationTasks.steer method lets developers steer a running delegated task [S1]. This gives callers a way to change a task’s direction without restarting it [S1]. ModelSettings gains max_retries and request_timeout options [S1]. These settings let users limit how many times a provider call is retried and how long each attempt may take [S1]. Agents can be bounded with a timeout= argument or a RunContext.deadline value [S1]. This adds a hard stop for long‑running agent runs [S1]. DBOS workflows that use Planning may fail to recover after the upgrade; finish any active workflows before upgrading or roll out a new DBOS version [S1].
Why it matters
Removing automatic clai2 session grouping breaks code that relied on project‑level grouping, so developers must adjust session handling or adopt a different pattern [S0]. Teams that use clai2 should audit their session code and test new grouping logic before deployment [S0]. The new accounting rule prevents double‑counting of usage for resumed suspended responses, which can lower unexpected quota spikes and billing surprises [S1]. Operators should check their usage dashboards after the upgrade to confirm the new counts are correct [S1]. Timeout and deadline parameters give operators a way to stop runaway agent runs, protecting compute budgets and improving reliability in production [S1]. Before enabling these limits, verify the typical run duration so legitimate jobs are not cut off early [S1]. The added max_retries and request_timeout settings let teams tune provider interactions without writing custom wrappers, simplifying error handling for unstable endpoints [S1]. Users should test the retry count against their provider’s rate limits to avoid throttling [S1]. The DBOS warning signals that existing event‑stream handlers may lose ordering guarantees; teams using DBOS should plan a staged rollout to avoid state loss [S1]. A safe approach is to pause in‑flight Planning workflows, upgrade, then resume with the new DBOS version [S1]. Overall, the changes tighten resource accounting and give more control over long‑running agent processes.
Background
pydantic‑ai wraps large‑language‑model providers with typed classes, exposing agents, tools, and realtime connections as objects [S0][S1]. The library updates often to match provider API shifts and to add developer‑facing features. Historically, the clai2 component grouped sessions by the surrounding project and worktree, a convenience for monorepo setups. Suspended responses let a model pause execution and wait for external input before resuming; prior releases counted their usage across the whole session. The new rule now counts usage only in the run that produced the response, which changes how quotas are calculated [S1]. DBOS is used to replay events and recover agent state after crashes, relying on ordered Planning events. The release notes warn that DBOS workflows using the Planning status tool with an event_stream_handler might not resume after an upgrade, so finish any active workflows first to avoid losing state [S1].
Caveats and other views
The release notes do not provide a migration guide for the clai2 grouping removal, so developers will need to experiment with alternative session management. The usage rule for suspended responses only applies to new runs; historic usage data remains unchanged. The DBOS warning mentions only Planning workflows, so other DBOS event types may still work but should be tested.
What we don’t know yet
It is unknown whether the clai2 grouping will return in a later minor version. The impact on third‑party libraries that import clai2 internals has not been documented. No performance benchmarks are supplied for the new timeout and deadline features, so their overhead remains unclear.