AIGenLab
EN

UPDATEpydantic-ai v2.77.0

Pydantic AI v2.77.0 ships three conversation store backends

Version & typev2.77.0 · Feature
In short

The Pydantic AI release notes for v2.77.0 add SQLite, Postgres and MongoDB backends for ConversationStore, expose compaction as a hook with its own events, and reject two request shapes that could not succeed.

What changed in this release

31 checkpoints in 6 groups, organized by task from the official notes. Checkpoints do not count separate features or commits.

Conversation stores

  • ConversationStore gains SQLite, Postgres and MongoDB backends.
  • Pax's session store becomes SqliteSessionStore and ConversationConflict becomes SessionConflict, with the old names still importable.
  • Five cases where saving a run's conversation to a store kept the wrong messages or failed are fixed.
  • Conversation search scores only the newest 2000 messages, and queries over 1,000 characters or 32 unique terms raise ModelRetry.

History compaction

  • A compact_history() capability hook and RunContext.request_compaction() are added.
  • Agent.compact_history() compacts a history without continuing the conversation.
  • AgentStreamEvent gains CompactionStartEvent and CompactionEndEvent.
  • Compaction receipts are sent as CompactionReceiptPart in the application's voice.
  • A failed SummarizingCompaction no longer ends the parent run, and FallbackCompaction chains recover from UnexpectedModelBehavior.
  • Compaction selects tool results by part position so a reused tool_call_id cannot blank a kept result.

Models and thinking

  • thinking_summary returns readable thinking across providers.
  • Claude on Anthropic and Bedrock gains two thinking display settings.
  • Claude on Microsoft Foundry receives native mid-conversation system messages and tool_addition blocks.
  • Mid-conversation system prompts to Groq openai/gpt-oss-* models are sent as <system> user text.
  • Bedrock Mistral Large 3, Ministral 3 and some Gemini requests no longer carry a filler turn, which misses the prompt cache once after upgrade.
  • The google and google-realtime extras require google-genai>=2.34.0.

Usage and cost

  • XSearch and ImageGeneration fallback sub-agent requests and tokens count toward the run's UsageLimits.
  • cost() raises ValueError instead of a bare AssertionError when the model name is missing.
  • SpendLimits.from_spec raises UserError for a non-numeric usd budget.
  • A capability that reads FallbackModel.profile gets a UserError that points at ModelFallback.
  • SubAgent.max_calls no longer counts a task-control delegation that never starts.

Request boundaries and streaming

  • A stream that ends before its terminal event yields state='incomplete'.
  • Tool requests to GPT-5.4 or GPT-5.6 with reasoning on raise ModelRequestRejectedError before they are sent.
  • OpenAIChatModel on OpenAI or Azure raises UserError for image output.
  • FileUnderstanding limits text document downloads to 500 MiB per request.
  • PlaywrightBrowser accepts beforeunload dialogs and reports a same-document go_back as a move.

Sub-agents, skills and MCP

  • SubAgents skips definition files below operator authority, and working_directory delegates drop to the parent's authority.
  • Skills skips missing or unreadable libraries by default, and missing_directories='error' keeps the failing behaviour.
  • Stdio MCP servers started by a plain agent.run() stop when the agent and toolset go out of scope.
  • MCPToolset no longer caches a stale tool list when tools/list_changed arrives mid-listing.
  • The durable engines import from pydantic_ai_harness.temporal, .dbos and .prefect.

Read the original announcement

On this page
  1. Release inventory
  2. The release splits a long…
  3. Conversation history can…
  4. Compaction now has a hook…
  5. One thinking setting now…
  6. Fallback sub-agent reques…
  7. Two doomed request shapes…
  8. Sub-agent files and skill…
  9. All three tools ship stor…
  10. From v2.76.0 to v2.77.0
  11. Release analysis
  12. Questions
  13. Sources & method

ContextThe release splits a long conversation into where it lives and when it is compacted

This release treats long conversations as two decisions: which database keeps the history, and when it is compacted. Multi-turn apps feel it first; single-turn text apps and teams running neither durable jobs nor Pax session storage can skip this round's detail.

The v2.77.0 core features and fixes read in Pydantic AI release notes put compatibility notes first: store renames, skipped skill libraries and the streamed state are behaviour changes. The old names still import with a HarnessDeprecationWarning, so migration can proceed backend by backend.

Six groups carry the release: stores, compaction, models and thinking, usage and cost, request boundaries and streaming, and sub-agents plus skills. The figure below maps the inventory onto them; vertical and horizontal comparisons follow the item-by-item sections, which take each group in turn.

How this release's inventory lands across six groups: conversation stores and history compaction hold ten entries between them and form the bulk, while the rest spread across models and thinking, usage and cost, request boundaries, and sub-agents plus skills.
Where the 31 grouped changes landWhere the 31 grouped changes landConversation stores4History compaction6Models and thinking6Usage and cost5Request boundaries and streaming5Sub-agents, skills and MCP5
AIGenLab original

Conversation history can now live in SQLite, Postgres or MongoDB

  1. Backends: ConversationStore gains SQLite, Postgres and MongoDB, so long histories sit in a database the team runs.
  2. Rename: the Pax store and conflict error become SqliteSessionStore and SessionConflict; old names import with a warning.
  3. Upgrade step: update imports and connection settings; old names still import with a deprecation warning, so migrate backend by backend.

Compaction now has a hook and events, so the app picks the moment

  1. Hook: compact_history() and RunContext.request_compaction() let the app choose a moment while automatic SummarizingCompaction remains available.
  2. Standalone pass: Agent.compact_history() compacts a history without continuing the conversation.
  3. Stream: AgentStreamEvent adds CompactionStartEvent and CompactionEndEvent; receipts arrive as CompactionReceiptPart.

One thinking setting now returns readable summaries from Claude

  1. Unified summaries: thinking_summary returns readable thinking across providers, so a UI keeps one parser.
  2. Two switches: anthropic_thinking_display and bedrock_thinking_display send display: 'summarized' when thinking is set.
  3. Cost: summaries precede the first text token and may add a little latency; newer Claude models return them instead of empty thinking.

Fallback sub-agent requests now count against the run's usage limits

  1. Scope: XSearch and ImageGeneration fallback requests and tokens count toward the run's UsageLimits.
  2. Upgrade step: review jobs near request_limit=50; runs that used to finish can raise UsageLimitExceeded.
  3. Cost errors: cost() raises ValueError when the model name is missing, so AssertionError handlers change.

Two doomed request shapes are rejected locally, and short streams report incomplete

  1. Stream end: an Anthropic, Google or OpenAI Responses stream that stops early yields state='incomplete'.
  2. Tool requests: OpenAIChatModel with GPT-5.4/5.6 from OpenAIProvider, reasoning on and tools attached, raises ModelRequestRejectedError before sending.
  3. Image output: OpenAIChatModel on OpenAI or Azure raises UserError when a request allows image output.

Sub-agent files and skills load by authority, and stdio MCP servers stop with the run

  1. Sub-agent authority: SubAgents skips files below operator authority; a working_directory delegate drops to parent authority.
  2. Skills: Skills(...) skips missing, non-library or unreadable paths; skips warn except missing directories. Use missing_directories='error' to fail.
  3. MCP lifetime: stdio MCP servers started by a plain agent.run() stop once the agent and toolset go out of scope.

All three tools ship storage and compaction, with different interfaces

All three answer where history lives and when it is compacted; compaction is a wrapper, a setting or a hook.

OpenAI Agents SDK wraps compaction around a session. Google ADK v2.14.0 adds token-threshold and per-session controls; its experimental v2.15.0 BufferedSessionService can flush background batches. Pydantic AI adds app-triggered entry points and events while keeping automatic SummarizingCompaction. The table compares that step, not identical architectures.

Bottom line: use the session wrapper for built-in compaction, evaluate ADK's experimental background writer when database latency hurts, and use the hook when workflows need their own steps.

UpdateOpenAI Agents SDK v0.25.0Google ADK v2.14.0–v2.15.1Pydantic AI v2.77.0
Conversation storagev0.25.0 exposes third-party session adapter utilities; v0.24.0-alpha.8 adds SQLAlchemySQLiteSessionStore for an app-owned synchronous SQLite engine.SqliteSessionService writes to SQLite with a 30-second busy timeout in v2.15.0; experimental BufferedSessionService buffers events and flushes background batches.SQLite, Postgres and MongoDB backends; the Pax store becomes SqliteSessionStore.
History compactionCompaction wraps the session: OpenAIResponsesCompactionSession defaults to gpt-6-luna.Since v2.14.0: token-threshold compaction counts tool outputs since the last model call; plugins configure compaction per session and AgentTool nested history follows the caller threshold.compact_history() hook, request_compaction() and CompactionStart/End events; Agent.compact_history() too.
Thinking output0.24.0-alpha.8 lets a request opt into reasoning summaries.Since v2.14.0, streamed thought signatures get their own part and stay out of SQLite memory search; since v2.15.0, evals no longer score model thoughts.thinking_summary returns readable thinking; Claude on Bedrock and Anthropic sends display: 'summarized'.
Usage accountingFailed and incomplete Responses calls keep token usage; restored checkpoints keep spent budgets.Since v2.15.0, usage events carry cached token counts; since v2.14.0, turns without usage skip the token_usage_v1 average.Fallback sub-agent requests count toward UsageLimits, including request_limit=50.
Request boundariesMissing stream completion is diagnosed better; incomplete calls retain usage.Since v2.14.0, a LiteLlm stream without a finish reason is truncated; since v2.15.1, A2A stops persisting streamed output without last_chunk.Early stream end yields incomplete; OpenAIChatModel with GPT-5.4/5.6 from OpenAIProvider, reasoning on and tools attached, raises ModelRequestRejectedError locally.
Sub-agents and skillsRead-only environments, skills and command tools can come from app callbacks with app permissions.Since v2.14.0, AgentTool sub-agents share the parent's memory service; since v2.15.0, cloned LlmAgents get tools for their own sub-agents and traces follow inherited models.Sub-agents below operator authority skip; delegates drop to parent authority; skills skip.

From v2.76.0 to v2.77.0, compaction and storage become configurable entry points

From v2.76.0 to v2.77.0 three behaviours move: when compaction starts, where history is stored, and how a finished stream is read.

The previous version trimmed inside a capability; this version pulls compaction into a hook, a standalone call and events.

Each cell below is the behaviour its own release note states, and a migration has to read both columns.

The earlier v2.73.0 (2026-11-24) is only an observation point; the table takes the adjacent formal release v2.76.0 as its baseline, and each column states only what its own release page says.

Featurev2.76.0v2.77.0
Where history goesA trimming capability leaves every run message in result.conversation.SQLite, Postgres and MongoDB backends; the Pax store is renamed.
How compaction startsSummarizingCompaction and RelevanceCompaction trim inside the run.compact_history() hook, request_compaction() and CompactionStart/End events.
Anthropic settingsSampling settings are dropped for API version 2026-10-21.Thinking sends display: 'summarized'; thinking_summary unifies output.
Usage limitsTemporal and Prefect stop retrying UsageLimitExceeded.Fallback sub-agent requests count toward UsageLimits, default request_limit=50.
How a stream endsAnthropic tool calls cut off by the token limit raise IncompleteToolCall.An early stream end yields state='incomplete'.
Skill loadingCoder reads project skills like the session's LocalWorkspace.Sub-agents below operator authority skip; unreadable skills skip with a warning; a missing directory is skipped silently.

Release analysisUpgrade checks focus on tool rejection, usage limits and durable sub-agents

Upgrade checks have three targets: OpenAIChatModel calls using GPT-5.4 or GPT-5.6 from OpenAIProvider with reasoning and tools, long jobs near the default request_limit=50, and durable SubAgents runs with agent_folders. Single-turn text apps with in-memory history can wait, as can pure question answering without handoffs.

OpenAI Agents SDK v0.25.0 folds compaction into a session wrapper and changes its default model. Google ADK v2.14.0 adds token-threshold and per-session controls; its experimental v2.15.0 BufferedSessionService can flush background batches. Pydantic AI adds app-triggered entry points and events while keeping automatic SummarizingCompaction.

Our own view, not independently tested: rerun the tool-and-reasoning regression before changing the store, and attach the hook at handoff points. Do not keep catching AssertionError; schedule the old class-name migration when the deprecation warning appears.

Three checks: log request_limit and actual usage, run the store against a shadow database, and watch CompactionStart/End at one handoff before widening it.

AIGenLab views

Not independently tested

Apps that hand off long conversations should settle where result.conversation is stored before enabling the compaction hook; the other order hits the storage migration first.

Our own view, based on the release notes for the ConversationStore backends and the compact_history hook; no migration was run on a real service

Once the app owns the compaction moment, acceptance should follow workflow steps rather than message counts.

Our own view, not independently tested, based on compaction events being emitted only when request_compaction() is called or a compact_history hook exists

Jobs near request_limit=50 should record a week of baseline usage before deciding whether to raise the limit or cut fallback sub-agent calls.

Our own view, not independently tested, based on fallback sub-agent requests now counting toward UsageLimits under the default request_limit=50

Questions

Which calls start failing earlier after the upgrade?
OpenAIChatModel on OpenAI or Azure raises UserError when image output is allowed. With GPT-5.4/5.6 from OpenAIProvider, reasoning on and tools attached, it raises ModelRequestRejectedError before sending.
Can the old conversation store names still be imported?
Yes. SqliteConversationStore and ConversationConflict still import but raise HarnessDeprecationWarning; their new names are SqliteSessionStore and SessionConflict.
Does compaction always add time to the first token?
Not necessarily. The release note says newer Claude models returning thinking summaries can add a little latency before the first text token.

Official sources and scope

  • Pydantic AI v2.77.0 release notes Every v2.77.0 fact in this article: version, publish date, the six change groups and their boundaries
  • Pydantic AI v2.76.0 release notes The v2.76.0 side of the vertical table: message retention, in-run trimming, Anthropic sampling settings, IncompleteToolCall, UsageLimitExceeded retries and skill loading
  • OpenAI Agents SDK v0.25.0 release notes The comparison cells on session adapter utilities, the gpt-6-luna compaction default, usage kept for incomplete calls and stream completion diagnostics
  • OpenAI Agents SDK v0.24.0-alpha.8 release notes The comparison cells on SQLAlchemySQLiteSessionStore, checkpoint budgets, reasoning summaries and skill callbacks
  • Google ADK v2.15.0 release notes The comparison cells on BufferedSessionService, the 30-second SQLite busy timeout, cached token usage, evals ignoring thoughts, and sub-agent tools and traces
  • Google ADK v2.14.0 release notes The comparison cells on token-threshold compaction, per-session compaction, thought parts, truncated streams without a finish reason and MCP connection cleanup
  • Google ADK v2.15.1 release notes The comparison cell on A2A no longer persisting streamed output without last_chunk

Dates beside sources indicate when we consulted them, not when the vendor released the update. Procedures are editorial guidance, not independently tested.