Download Latest Version v2.79.0 (2026-12-04) source code.zip (231.2 MB)
Home / v2.77.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-11-27 22.5 kB
v2.77.0 (2026-11-27) source code.tar.gz 2026-11-27 222.6 MB
v2.77.0 (2026-11-27) source code.zip 2026-11-27 228.3 MB
Totals: 3 Items   450.9 MB 0

What's Changed

⚠️ Compatibility Notes

  • Add SQLite, Postgres and MongoDB backends for ConversationStore, and rename the Pax session store to SqliteSessionStore by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10473
  • SqliteConversationStore and ConversationConflict in pydantic_ai_harness.step_persistence.conversations, the Pax session-browser store, are renamed SqliteSessionStore and SessionConflict. The old names still import, with a HarnessDeprecationWarning.
  • Skip missing and unreadable skill libraries and skills by default, add SkillCatalog.advice, and search pax skill folders nearest directory first by @DouweM in https://github.com/pydantic/pydantic-ai/pull/10524
  • Skills(...) without missing_directories now skips a missing, non-library or unreadable library path instead of failing the run, with a warning for every case except a missing directory; pass missing_directories='error' to keep failing. An unreadable skill directory or SKILL.md is skipped with a warning instead of raising PermissionError. SkipReason gains a value, so an exhaustive match on it stops type-checking. pax launched in a subdirectory can pick a different skill when two folders hold one with the same name.
  • Add thinking_summary to return readable thinking across providers, and anthropic_thinking_display and bedrock_thinking_display by @DouweM in https://github.com/pydantic/pydantic-ai/pull/11084
  • On Anthropic and Claude on Bedrock, a request that sets the unified thinking setting now sends thinking.display: 'summarized'. Newer Claude models then return summarized thinking instead of empty thinking, which can add a little latency before the first text token.
  • 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
  • AgentStreamEvent gains CompactionStartEvent and CompactionEndEvent. They're emitted only when something calls request_compaction() or a compact_history hook 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 for working_directory delegates by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/11839
  • SubAgents no longer loads a sub-agent definition file below 'operator' authority, such as every file in a workspace at authority='none': it skips the file with a warning. A working_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's path_authority entries contains it. Add such an entry to keep that repository's instructions, skills and agent definitions as instructions. Pax's Review specialist on another checkout now reads that checkout's AGENTS.md as data. Durable runs using SubAgents with agent_folders record one realpath per 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 SummarizingCompaction fails by @DouweM in https://github.com/pydantic/pydantic-ai/pull/12655
  • Default FallbackCompaction chains now recover from UnexpectedModelBehavior instead of propagating it immediately.
  • @yogeshwaran10 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/13551
  • The default google_api_key secret pattern now also redacts AQ. followed by 40 to 200 key characters.
  • 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 has state='incomplete' when an Anthropic, Google or OpenAI Responses stream ends before its terminal event. Code that reads response.state != 'incomplete' as the last yield, as the V2 upgrade guide suggested for the old is_last, or reads state == 'complete' as "the stream ended", sees the difference.
  • Count XSearch and ImageGeneration fallback subagent requests toward the run's usage and UsageLimits by @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 default request_limit=50, so a run near a limit that used to finish can raise UsageLimitExceeded.
  • Place Memory and Planning run-start context before the user prompt with enqueue(placement='before_prompt') by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14269
  • New runs record Memory's run-start snapshot and Planning's run-start plan before the user's prompt, inside the prompt's ModelRequest, instead of in a separate ModelRequest after it. Code that looks for the snapshot at all_messages()[1], or for the prompt as the last part of its request, sees a different shape.
  • Send compaction receipts in the application's voice as a CompactionReceiptPart instead of a UserPromptPart by @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 a UserPromptPart. 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 as UserPromptParts should look for CompactionReceiptPart.
  • Send native mid-conversation system messages to Claude on Microsoft Foundry by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14778
  • On an AsyncAnthropicFoundry client 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 as tool_addition blocks. A conversation already in progress misses the prompt cache once.
  • Stop sending filler turns to Bedrock Mistral Large 3 and Ministral 3, and to Gemini after a leading text model turn 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 model turn, the request no longer contains the filler turn, so a conversation that was prompt-cached before the upgrade misses the cache once.
  • Raise a UserError for image output on OpenAIChatModel with the OpenAI and Azure providers, which return no images by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14870
  • With OpenAIChatModel on the OpenAI or Azure provider, a request that allows image output, such as output_type=BinaryImage or output_type=[str, BinaryImage], now raises UserError before it is sent. Before, BinaryImage alone could never succeed and [str, BinaryImage] returned text.
  • Raise ModelRequestRejectedError before OpenAIChatModel sends 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 OpenAIChatModel and a GPT-5.4 or GPT-5.6 model from OpenAIProvider, a request that sends tools with reasoning on now raises ModelRequestRejectedError before it is sent, instead of the provider's 400 as a ModelHTTPError. except ModelHTTPError, a check on its status_code or body, and a fallback_on that names ModelHTTPError no longer match it.
  • Show the /permissions mode in the Pax footer by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14700
  • The FooterField literal gains 'permissions', and Status.FIT_STEPS gains a step that hides it, so an exhaustive match over FooterField, or a comparison of FIT_STEPS to a fixed tuple, sees one more value.
  • Use pydantic-ai-pax for Pax's keyring service and Logfire service_name default by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14616
  • LogfireSettings.service_name in Pax's Logfire plugin now defaults to pydantic-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 the pydantic-ai-pax service and is copied from the old service on first read.
  • Run the gh-aw engine on pydantic-ai-pax by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14847
  • A gh-aw workflow that imports the engine definition from main and sets its own engine: version: to a release from 0.59.0 to 0.72.x now fails at install time, because the engine installs pydantic-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.
  • Update Gemini Flash docs and example references to gemini-4-hydrogen by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14875
  • pydantic-ai-slim now requires genai-prices>=0.2.4, which prices Gemini 4 Hydrogen and Carbon.
  • Raise ValueError instead of a bare AssertionError from cost() when the model name is missing by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14715
  • ModelResponse.cost(), EmbeddingResult.cost() and ImageGenerationResult.cost() raise ValueError('Model name is required to calculate price') instead of a bare AssertionError when the model name is missing. Code that caught AssertionError from cost() needs ValueError instead.
  • Bound search_conversation_history's query and scan only the newest max_scanned_messages so one search cannot stall the event loop by @DouweM in https://github.com/pydantic/pydantic-ai/pull/14882
  • ConversationSearch's search_conversation_history now scores only the newest max_scanned_messages in-scope messages (default 2000) 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 raises ModelRetry.
  • [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 see get_current_run_context() return None instead of the run that opened the connection. On FastMCP 3, or with Client(mode='legacy'), a ConcurrencyLimiter shared between the agent and a sampling model now hangs a plain run instead of raising UserError, as async with agent: already did; #14908 tracks the fix.
  • 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 .env file committed to the repository no longer supplies its variables. Set them with engine.env.
  • Map google-genai's ContinuationInterruptedError and record a non-streamed continued decode's context size on GoogleInteractionsModel by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/14744
  • The google and google-realtime extras now require google-genai>=2.34.0.

🚀 Features

🐛 Bug Fixes

New Contributors

Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.76.0...v2.77.0

Source: README.md, updated 2026-11-27