Skip to content

v2.77.0 (2026-11-27)

Latest

Choose a tag to compare

@dsfaccini dsfaccini released this 27 Nov 23:32
435f94c

What's Changed

⚠️ Compatibility Notes

  • Add SQLite, Postgres and MongoDB backends for ConversationStore, and rename the Pax session store to SqliteSessionStore by @DouweM in #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 #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 #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 #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 #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 #12655
    • Default FallbackCompaction chains now recover from UnexpectedModelBehavior instead of propagating it immediately.
  • @yogeshwaran10 made their first contribution in #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 #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 #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 #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 #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 #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 #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 #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 #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 #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 #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 #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 #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 #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 #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 #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 #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 #14744
    • The google and google-realtime extras now require google-genai>=2.34.0.

🚀 Features

  • Place Memory and Planning run-start context before the user prompt with enqueue(placement='before_prompt') by @DouweM in #14269
  • Add SQLite, Postgres and MongoDB backends for ConversationStore, and rename the Pax session store to SqliteSessionStore by @DouweM in #10473
  • Let CodeMode sandboxes import host modules with external_modules by @adtyavrdhn in #14934
  • Add a compact_history() capability hook, RunContext.request_compaction() and first-party compaction events by @DouweM in #11454
  • Skip disk sub-agents below 'operator' authority and keep the parent's authority for working_directory delegates by @adtyavrdhn in #11839
  • Stamp model-stream events with a ModelResponseOrigin so consumers can tell retried and replaced attempts apart by @DouweM in #14402
  • Let fallback_on take UnsupportedSettingWarning to skip a model that would ignore a setting the request relies on by @DouweM in #12431
  • Add thinking_summary to return readable thinking across providers, and anthropic_thinking_display and bedrock_thinking_display by @DouweM in #11084
  • Record images and other media in tool results as GenAI blob/uri/file message parts in spans by @DouweM in #14043
  • Send native mid-conversation system messages to Claude on Microsoft Foundry by @DouweM in #14778
  • Add Agent.compact_history() to compact a message history without continuing the conversation by @DouweM in #14827
  • Skip event kinds a Temporal stream_agent_events() subscriber does not know, instead of failing the stream by @DouweM in #14391
  • Skip missing and unreadable skill libraries and skills by default, add SkillCatalog.advice, and search pax skill folders nearest directory first by @DouweM in #10524
  • Let read_file return common video formats as files by @DouweM in #11780
  • Add pydantic_ai_harness.temporal, .dbos and .prefect as the import paths for the durable engines by @DouweM in #14981
  • Point GoogleModel and GoogleInteractionsModel errors at the other class for features only it serves by @dsfaccini in #14724
  • Add StructuredDict(validate=True) to validate output against its JSON schema by @DouweM in #14456
  • Show the /permissions mode in the Pax footer by @DouweM in #14700
  • Add pax -x NAME to load a plugin for one launch without saving it by @DouweM in #14431

🐛 Bug Fixes

  • Send mid-conversation system prompts to Groq openai/gpt-oss-* models as <system> user text by @DouweM in #14539
  • Report 'incomplete' for a streamed response that ends before the provider's terminal event by @dsfaccini in #14086
  • Count XSearch and ImageGeneration fallback subagent requests toward the run's usage and UsageLimits by @pydanty in #14154
  • Return a union output's Literal member instead of raising TypeError by @dsfaccini in #14871
  • Recognize media markers in restore_media by the shape the writer produces by @dsfaccini in #14794
  • Raise ModelRequestRejectedError before OpenAIChatModel sends tools to GPT-5.4 and GPT-5.6 models with reasoning on by @dsfaccini in #14887
  • Support AQ. prefix for Gemini API keys in secret detector by @yogeshwaran10 in #13551
  • Fix five cases where saving a run's conversation to a store keeps the wrong messages or fails by @adtyavrdhn in #14710
  • Stop Temporal and Prefect from retrying SuspendedResponseExpired by @dsfaccini in #14787
  • Fix MCPToolset caching a stale tool list when tools/list_changed arrives mid-listing by @pydanty in #14563
  • Journal Json tool arguments as JSON strings so Temporal, Render and Azure Durable Task revalidate them by @DouweM in #14767
  • Keep the parent run alive when automatic SummarizingCompaction fails by @DouweM in #12655
  • Raise ValueError instead of a bare AssertionError from cost() when the model name is missing by @DouweM in #14715
  • Keep a client tool's ElevenLabs-side settings when elevenlabs_agents_tool_sync='sync' updates it by @DouweM in #14734
  • Refuse PlaywrightBrowser and CDPBrowser in the deprecated TemporalAgent, DBOSAgent and PrefectAgent by @DouweM in #14749
  • Return the response from a capability's durable after_model_request instead of failing by @DouweM in #14703
  • Select compaction tool results by part position so a reused tool_call_id can't blank a kept result by @DouweM in #14452
  • Search with a linear-time regex engine when FileSystem matches in Python by @DouweM in #14899
  • Match DBOS child workflows to their tool calls by a stable ID on recovery by @mpfaffenberger in #13893
  • Read UseEnumMemberDocstrings member docstrings for enums defined in notebook cells, and warn when they cannot be read by @DouweM in #14637
  • Catch overflowing integer Retry-After values in wait_retry_after by @dsfaccini in #14973
  • Send compaction receipts in the application's voice as a CompactionReceiptPart instead of a UserPromptPart by @DouweM in #14597
  • Keep server-side history system prompts under manage_system_prompt='server' in UIAdapter by @pydanty in #13798
  • [mcp-context] Hold MCPToolset weakly in its message handler so dropped stdio toolsets stop their servers by @pydanty in #14666
  • Make strip_markdown_fences linear on text with unclosed code fences by @dsfaccini in #14954
  • Say when the Anthropic API version, not the model, rejected dropped sampling settings by @DouweM in #14633
  • 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 #14882
  • Raise a UserError for image output on OpenAIChatModel with the OpenAI and Azure providers, which return no images by @DouweM in #14870
  • Stop sending filler turns to Bedrock Mistral Large 3 and Ministral 3, and to Gemini after a leading text model turn by @DouweM in #14785
  • End the open message part in UI event streams when a restarted part's start arrives by @DouweM in #14426
  • Raise a UserError pointing to ModelFallback when a capability reads FallbackModel.profile by @DouweM in #14813
  • Raise a UserError for a non-numeric usd budget in SpendLimits.from_spec by @DouweM in #15003
  • Run the LoopJudge judge inside second_model_prompt() so frame lookalikes in the judged output get no user-attributed note by @DouweM in #15004
  • Run ApprovalReviewer's reviewer request as a second-model prompt, so frame lookalikes in reviewed calls get no lookalike note by @DouweM in #15005
  • Accept beforeunload dialogs in PlaywrightBrowser, as Playwright and CDPBrowser do by @DouweM in #15015
  • Report a same-document go_back/go_forward in PlaywrightBrowser as a move by @DouweM in #15017
  • Stop charging SubAgent.max_calls for a task-control delegation that never starts by @DouweM in #15010
  • Set OpenRouter image, audio and video input flags from a checked-in snapshot of its model list by @DouweM in #14470
  • Make pydantic_ai.new_message_index on a successful run's invoke_agent span point at the run's own messages in pydantic_ai.all_messages by @pydanty in #14608
  • Limit FileUnderstanding's text document downloads to a 500 MiB total per request by @dsfaccini in #14904
  • Fix new_messages() for a resumed run when ReinjectSystemPrompt meets 'asap' content a hook enqueues by @pydanty in #14561
  • [mcp-context] Stop plain agent.run() calls from keeping stdio MCP servers alive by @pydanty in #14889
  • Run the gh-aw engine's Pax on the environment its workflow step and the engine set by @dsfaccini in #14892
  • Map google-genai's ContinuationInterruptedError and record a non-streamed continued decode's context size on GoogleInteractionsModel by @dsfaccini in #14744

New Contributors

Full Changelog: v2.76.0...v2.77.0