- Home
- Releases
- Pydantic AI
- 2.77.0
Pydantic AI 2.77.0 release notes
Pydantic AI 2.77.0 was released on November 27, 2026. It is the latest version.
Release notes
What's Changed
⚠️ Compatibility Notes
- Add SQLite, Postgres and MongoDB backends for
ConversationStore, and rename the Pax session store toSqliteSessionStoreby @DouweM in https://github.com/pydantic/pydantic-ai/pull/10473SqliteConversationStoreandConversationConflictinpydantic_ai_harness.step_persistence.conversations, the Pax session-browser store, are renamedSqliteSessionStoreandSessionConflict. The old names still import, with aHarnessDeprecationWarning.
- Skip missing and unreadable skill libraries and skills by default, add
SkillCatalog.advice, and searchpaxskill folders nearest directory first by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10524Skills(...)withoutmissing_directoriesnow skips a missing, non-library or unreadable library path instead of failing the run, with a warning for every case except a missing directory; passmissing_directories='error'to keep failing. An unreadable skill directory orSKILL.mdis skipped with a warning instead of raisingPermissionError.SkipReasongains a value, so an exhaustivematchon it stops type-checking.paxlaunched in a subdirectory can pick a different skill when two folders hold one with the same name.
- Add
thinking_summaryto return readable thinking across providers, andanthropic_thinking_displayandbedrock_thinking_displayby @DouweM in https://github.com/pydantic/pydantic-ai/pull/11084- On Anthropic and Claude on Bedrock, a request that sets the unified
thinkingsetting now sendsthinking.display: 'summarized'. Newer Claude models then return summarized thinking instead of empty thinking, which can add a little latency before the first text token.
- On Anthropic and Claude on Bedrock, a request that sets the unified
- Add a
compact_history()capability hook,RunContext.request_compaction()and first-party compaction events by @DouweM in https://github.com/pydantic/pydantic-ai/pull/11454AgentStreamEventgainsCompactionStartEventandCompactionEndEvent. They're emitted only when something callsrequest_compaction()or acompact_historyhook exists, so no existing run's stream changes, but an exhaustive match over the union (assert_never) stops type-checking.
- Skip disk sub-agents below
'operator'authority and keep the parent's authority forworking_directorydelegates by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/11839SubAgentsno longer loads a sub-agent definition file below'operator'authority, such as every file in a workspace atauthority='none': it skips the file with a warning. Aworking_directory=delegate's workspace is lowered to the lowest authority the parent gives that directory, and a directory outside the parent's working directory is at'none'unless one of the parent'spath_authorityentries contains it. Add such an entry to keep that repository's instructions, skills and agent definitions as instructions. Pax'sReviewspecialist on another checkout now reads that checkout'sAGENTS.mdas data. Durable runs usingSubAgentswithagent_foldersrecord onerealpathper agent definition file at run start, so let in-flight runs finish, or use Temporal worker versioning or a new DBOS app version, before upgrading.
- Keep the parent run alive when automatic
SummarizingCompactionfails by @DouweM in https://github.com/pydantic/pydantic-ai/pull/12655- Default
FallbackCompactionchains now recover fromUnexpectedModelBehaviorinstead of propagating it immediately.
- Default
- @yogeshwaran10 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/13551
- The default
google_api_keysecret pattern now also redactsAQ.followed by 40 to 200 key characters.
- The default
- Report
'incomplete'for a streamed response that ends before the provider's terminal event by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14086- The final
stream_response()yield now hasstate='incomplete'when an Anthropic, Google or OpenAI Responses stream ends before its terminal event. Code that readsresponse.state != 'incomplete'as the last yield, as the V2 upgrade guide suggested for the oldis_last, or readsstate == 'complete'as "the stream ended", sees the difference.
- The final
- Count
XSearchandImageGenerationfallback subagent requests toward the run's usage andUsageLimitsby @pydanty in https://github.com/pydantic/pydantic-ai/pull/14154- A fallback subagent's requests and tokens now count against the run's
UsageLimits, including the defaultrequest_limit=50, so a run near a limit that used to finish can raiseUsageLimitExceeded.
- A fallback subagent's requests and tokens now count against the run's
- Place
MemoryandPlanningrun-start context before the user prompt withenqueue(placement='before_prompt')by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14269- New runs record
Memory's run-start snapshot andPlanning's run-start plan before the user's prompt, inside the prompt'sModelRequest, instead of in a separateModelRequestafter it. Code that looks for the snapshot atall_messages()[1], or for the prompt as the last part of its request, sees a different shape.
- New runs record
- Send compaction receipts in the application's voice as a
CompactionReceiptPartinstead of aUserPromptPartby @DouweM in https://github.com/pydantic/pydantic-ai/pull/14597- Models now see a compaction receipt in the operator's voice, as a
CompactionReceiptPart, instead of aUserPromptPart. Receipts already in a saved history are still recognized, and the next compaction replaces them, which moves the cached prefix once. Code that reads receipts from history asUserPromptParts should look forCompactionReceiptPart.
- Models now see a compaction receipt in the operator's voice, as a
- Send native mid-conversation system messages to Claude on Microsoft Foundry by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14778
- On an
AsyncAnthropicFoundryclient with a supported Claude model, mid-conversation system prompts are sent as native{'role': 'system'}entries instead of<system>-tagged user text, and tools revealed mid-run astool_additionblocks. A conversation already in progress misses the prompt cache once.
- On an
- Stop sending filler turns to Bedrock Mistral Large 3 and Ministral 3, and to Gemini after a leading text
modelturn by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14785- For Bedrock Mistral Large 3 and Ministral 3, and for Gemini after a leading text
modelturn, the request no longer contains the filler turn, so a conversation that was prompt-cached before the upgrade misses the cache once.
- For Bedrock Mistral Large 3 and Ministral 3, and for Gemini after a leading text
- Raise a
UserErrorfor image output onOpenAIChatModelwith the OpenAI and Azure providers, which return no images by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14870- With
OpenAIChatModelon the OpenAI or Azure provider, a request that allows image output, such asoutput_type=BinaryImageoroutput_type=[str, BinaryImage], now raisesUserErrorbefore it is sent. Before,BinaryImagealone could never succeed and[str, BinaryImage]returned text.
- With
- Raise
ModelRequestRejectedErrorbeforeOpenAIChatModelsends tools to GPT-5.4 and GPT-5.6 models with reasoning on by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14887- With
OpenAIChatModeland a GPT-5.4 or GPT-5.6 model fromOpenAIProvider, a request that sends tools with reasoning on now raisesModelRequestRejectedErrorbefore it is sent, instead of the provider's 400 as aModelHTTPError.except ModelHTTPError, a check on itsstatus_codeorbody, and afallback_onthat namesModelHTTPErrorno longer match it.
- With
- Show the
/permissionsmode in the Pax footer by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14700- The
FooterFieldliteral gains'permissions', andStatus.FIT_STEPSgains a step that hides it, so an exhaustive match overFooterField, or a comparison ofFIT_STEPSto a fixed tuple, sees one more value.
- The
- Use
pydantic-ai-paxfor Pax's keyring service and Logfireservice_namedefault by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14616LogfireSettings.service_namein Pax's Logfire plugin now defaults topydantic-ai-pax, so Pax's traces appear under that service name. A saved previous default is migrated once, and any other saved name is kept; to keep the old name, set it in/plugins configure logfire. Pax's keyring entry moves to thepydantic-ai-paxservice and is copied from the old service on first read.
- Run the gh-aw engine on
pydantic-ai-paxby @DouweM in https://github.com/pydantic/pydantic-ai/pull/14847- A gh-aw workflow that imports the engine definition from
mainand sets its ownengine: version:to a release from 0.59.0 to 0.72.x now fails at install time, because the engine installspydantic-ai-pax, which has no release at those versions. Raise the override to 0.73.0 or newer, or drop it to use the definition's pin.
- A gh-aw workflow that imports the engine definition from
- Update Gemini Flash docs and example references to
gemini-4-hydrogenby @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14875pydantic-ai-slimnow requiresgenai-prices>=0.2.4, which prices Gemini 4 Hydrogen and Carbon.
- Raise
ValueErrorinstead of a bareAssertionErrorfromcost()when the model name is missing by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14715ModelResponse.cost(),EmbeddingResult.cost()andImageGenerationResult.cost()raiseValueError('Model name is required to calculate price')instead of a bareAssertionErrorwhen the model name is missing. Code that caughtAssertionErrorfromcost()needsValueErrorinstead.
- Bound
search_conversation_history's query and scan only the newestmax_scanned_messagesso one search cannot stall the event loop by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14882ConversationSearch'ssearch_conversation_historynow scores only the newestmax_scanned_messagesin-scope messages (default2000) and says so in its result when the cap cuts the corpus; raise the setting to search further back. A query over 1,000 characters or 32 unique terms raisesModelRetry.
- [mcp-context] Stop plain
agent.run()calls from keeping stdio MCP servers alive by @pydanty in https://github.com/pydantic/pydantic-ai/pull/14889- Stdio MCP servers that plain
agent.run()calls start now stop once the agent and toolset go out of scope. FastMCP handlers called from a kept-alive stdio connection, such as sampling callbacks, now seeget_current_run_context()returnNoneinstead of the run that opened the connection. On FastMCP 3, or withClient(mode='legacy'), aConcurrencyLimitershared between the agent and a sampling model now hangs a plain run instead of raisingUserError, asasync with agent:already did; #14908 tracks the fix.
- Stdio MCP servers that plain
- Run the gh-aw engine's Pax on the environment its workflow step and the engine set by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14892
- The gh-aw engine's Pax run now sets
PYTHON_DOTENV_DISABLED=1, so a.envfile committed to the repository no longer supplies its variables. Set them withengine.env.
- The gh-aw engine's Pax run now sets
- Map google-genai's
ContinuationInterruptedErrorand record a non-streamed continued decode's context size onGoogleInteractionsModelby @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14744- The
googleandgoogle-realtimeextras now requiregoogle-genai>=2.34.0.
- The
🚀 Features
- Place
MemoryandPlanningrun-start context before the user prompt withenqueue(placement='before_prompt')by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14269 - Add SQLite, Postgres and MongoDB backends for
ConversationStore, and rename the Pax session store toSqliteSessionStoreby @DouweM in https://github.com/pydantic/pydantic-ai/pull/10473 - Let
CodeModesandboxes import host modules withexternal_modulesby @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/14934 - Add a
compact_history()capability hook,RunContext.request_compaction()and first-party compaction events by @DouweM in https://github.com/pydantic/pydantic-ai/pull/11454 - Skip disk sub-agents below
'operator'authority and keep the parent's authority forworking_directorydelegates by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/11839 - Stamp model-stream events with a
ModelResponseOriginso consumers can tell retried and replaced attempts apart by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14402 - Let
fallback_ontakeUnsupportedSettingWarningto skip a model that would ignore a setting the request relies on by @DouweM in https://github.com/pydantic/pydantic-ai/pull/12431 - Add
thinking_summaryto return readable thinking across providers, andanthropic_thinking_displayandbedrock_thinking_displayby @DouweM in https://github.com/pydantic/pydantic-ai/pull/11084 - Record images and other media in tool results as GenAI
blob/uri/filemessage parts in spans by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14043 - Send native mid-conversation system messages to Claude on Microsoft Foundry by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14778
- Add
Agent.compact_history()to compact a message history without continuing the conversation by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14827 - Skip event kinds a Temporal
stream_agent_events()subscriber does not know, instead of failing the stream by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14391 - Skip missing and unreadable skill libraries and skills by default, add
SkillCatalog.advice, and searchpaxskill folders nearest directory first by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10524 - Let
read_filereturn common video formats as files by @DouweM in https://github.com/pydantic/pydantic-ai/pull/11780 - Add
pydantic_ai_harness.temporal,.dbosand.prefectas the import paths for the durable engines by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14981 - Point
GoogleModelandGoogleInteractionsModelerrors at the other class for features only it serves by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14724 - Add
StructuredDict(validate=True)to validate output against its JSON schema by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14456 - Show the
/permissionsmode in the Pax footer by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14700 - Add
pax -x NAMEto load a plugin for one launch without saving it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14431
🐛 Bug Fixes
- Send mid-conversation system prompts to Groq
openai/gpt-oss-*models as<system>user text by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14539 - Report
'incomplete'for a streamed response that ends before the provider's terminal event by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14086 - Count
XSearchandImageGenerationfallback subagent requests toward the run's usage andUsageLimitsby @pydanty in https://github.com/pydantic/pydantic-ai/pull/14154 - Return a union output's
Literalmember instead of raisingTypeErrorby @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14871 - Recognize media markers in
restore_mediaby the shape the writer produces by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14794 - Raise
ModelRequestRejectedErrorbeforeOpenAIChatModelsends tools to GPT-5.4 and GPT-5.6 models with reasoning on by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14887 - Support AQ. prefix for Gemini API keys in secret detector by @yogeshwaran10 in https://github.com/pydantic/pydantic-ai/pull/13551
- Fix five cases where saving a run's conversation to a store keeps the wrong messages or fails by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/14710
- Stop Temporal and Prefect from retrying
SuspendedResponseExpiredby @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14787 - Fix
MCPToolsetcaching a stale tool list whentools/list_changedarrives mid-listing by @pydanty in https://github.com/pydantic/pydantic-ai/pull/14563 - Journal
Jsontool arguments as JSON strings so Temporal, Render and Azure Durable Task revalidate them by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14767 - Keep the parent run alive when automatic
SummarizingCompactionfails by @DouweM in https://github.com/pydantic/pydantic-ai/pull/12655 - Raise
ValueErrorinstead of a bareAssertionErrorfromcost()when the model name is missing by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14715 - Keep a client tool's ElevenLabs-side settings when
elevenlabs_agents_tool_sync='sync'updates it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14734 - Refuse
PlaywrightBrowserandCDPBrowserin the deprecatedTemporalAgent,DBOSAgentandPrefectAgentby @DouweM in https://github.com/pydantic/pydantic-ai/pull/14749 - Return the response from a capability's durable
after_model_requestinstead of failing by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14703 - Select compaction tool results by part position so a reused
tool_call_idcan't blank a kept result by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14452 - Search with a linear-time regex engine when
FileSystemmatches in Python by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14899 - Match DBOS child workflows to their tool calls by a stable ID on recovery by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/13893
- Read
UseEnumMemberDocstringsmember docstrings for enums defined in notebook cells, and warn when they cannot be read by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14637 - Catch overflowing integer
Retry-Aftervalues inwait_retry_afterby @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14973 - Send compaction receipts in the application's voice as a
CompactionReceiptPartinstead of aUserPromptPartby @DouweM in https://github.com/pydantic/pydantic-ai/pull/14597 - Keep server-side history system prompts under
manage_system_prompt='server'inUIAdapterby @pydanty in https://github.com/pydantic/pydantic-ai/pull/13798 - [mcp-context] Hold
MCPToolsetweakly in its message handler so dropped stdio toolsets stop their servers by @pydanty in https://github.com/pydantic/pydantic-ai/pull/14666 - Make
strip_markdown_fenceslinear on text with unclosed code fences by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14954 - Say when the Anthropic API version, not the model, rejected dropped sampling settings by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14633
- Bound
search_conversation_history's query and scan only the newestmax_scanned_messagesso one search cannot stall the event loop by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14882 - Raise a
UserErrorfor image output onOpenAIChatModelwith the OpenAI and Azure providers, which return no images by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14870 - Stop sending filler turns to Bedrock Mistral Large 3 and Ministral 3, and to Gemini after a leading text
modelturn by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14785 - End the open message part in UI event streams when a restarted part's start arrives by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14426
- Raise a
UserErrorpointing toModelFallbackwhen a capability readsFallbackModel.profileby @DouweM in https://github.com/pydantic/pydantic-ai/pull/14813 - Raise a
UserErrorfor a non-numericusdbudget inSpendLimits.from_specby @DouweM in https://github.com/pydantic/pydantic-ai/pull/15003 - Run the
LoopJudgejudge insidesecond_model_prompt()so frame lookalikes in the judged output get no user-attributed note by @DouweM in https://github.com/pydantic/pydantic-ai/pull/15004 - Run
ApprovalReviewer's reviewer request as a second-model prompt, so frame lookalikes in reviewed calls get no lookalike note by @DouweM in https://github.com/pydantic/pydantic-ai/pull/15005 - Accept
beforeunloaddialogs inPlaywrightBrowser, as Playwright andCDPBrowserdo by @DouweM in https://github.com/pydantic/pydantic-ai/pull/15015 - Report a same-document
go_back/go_forwardinPlaywrightBrowseras a move by @DouweM in https://github.com/pydantic/pydantic-ai/pull/15017 - Stop charging
SubAgent.max_callsfor a task-control delegation that never starts by @DouweM in https://github.com/pydantic/pydantic-ai/pull/15010 - Set OpenRouter image, audio and video input flags from a checked-in snapshot of its model list by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14470
- Make
pydantic_ai.new_message_indexon a successful run'sinvoke_agentspan point at the run's own messages inpydantic_ai.all_messagesby @pydanty in https://github.com/pydantic/pydantic-ai/pull/14608 - Limit
FileUnderstanding's text document downloads to a 500 MiB total per request by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14904 - Fix
new_messages()for a resumed run whenReinjectSystemPromptmeets'asap'content a hook enqueues by @pydanty in https://github.com/pydantic/pydantic-ai/pull/14561 - [mcp-context] Stop plain
agent.run()calls from keeping stdio MCP servers alive by @pydanty in https://github.com/pydantic/pydantic-ai/pull/14889 - Run the gh-aw engine's Pax on the environment its workflow step and the engine set by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14892
- Map google-genai's
ContinuationInterruptedErrorand record a non-streamed continued decode's context size onGoogleInteractionsModelby @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14744
New Contributors
- @yogeshwaran10 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/13551
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.76.0...v2.77.0
Source: GitHub release v2.77.0