What's Changed
⚠️ Compatibility Notes
- Keep workspace files below
'operator'authority out of the instructions inRepoContext,SkillsandMemory, and addlowest_authority_underby @adtyavrdhn in #11837- Text from a workspace file below
'operator'authority no longer reaches the instructions:RepoContextnames the working directory's file for the model to read with its file tools and sends an ancestor's file as framed data,Skillsoffers such skills throughlist_skillsandload_skilltools instead ofload_capability, andMemoryattributes such a snapshot to itsMEMORY.md. Files at'operator', the default, are unchanged. Durable runs now record extrarealpathworkspace calls at run start, so let in-flight runs finish, or use Temporal worker versioning or a new DBOS app version, before upgrading.RepoContext(autoload_instructions=False)with nested instruction files misses the prompt cache once on the first request after upgrading.
- Text from a workspace file below
- Raise empty and unreadable model responses as
ModelEmptyResponseErrorandModelInvalidResponseError, soFallbackModelandModelFallbackfall back on them by @DouweM in #12108- With their default
fallback_on,FallbackModelandModelFallbacknow fall back on an empty stream, an OpenAI Chat completion withoutchoices, and an OpenAI Chat body that isn't JSON or doesn't match the schema, where the run used to raiseUnexpectedModelBehavior. Both new errors subclassModelAPIErrorandUnexpectedModelBehavior, soexcept UnexpectedModelBehaviorstill catches them, but anexcept ModelAPIErrorplaced before it now takes them; an empty Mistral or OpenAIchoicesraises one instead ofAssertionErrororIndexError. To keep raising instead of falling back, pass afallback_onthat leaves them out, such aslambda e: isinstance(e, ModelAPIError) and not isinstance(e, UnexpectedModelBehavior).
- With their default
- Resolve Pax
/permissionsapprovals through a token-takingHandleDeferredToolCallshandler with harnessapproval_askby @DouweM in #13195pydantic_ai_pax.runtime.permissions.approval_handlerstill returns anApprovalHandler, but its handler now takes a resume token: it runs after every two-parameter deferred tool call handler wherever it is listed, and in a durable run on any engine but AWS Lambda it raisesUserErrorinstead of asking. Pax itself behaves as before. To run a handler of your own after it, make that handler take a token too; under a durable engine other than Lambda, bindApprovalHandler(lambda ctx, requests: ask_permissions(requests, approve))instead.
- Share one
instructionsstring across a conversation's requests instead of keeping a copy per request by @DouweM in #13308ModelMessagesTypeAdapteris now built with anAfterValidator, and in a history it loads, requests with equalinstructionshold the same string object. Its type, JSON schema, serialization and validated values are unchanged. Compareinstructionswith==, notis.
- Send
Coder's no-unrequested-sub-agents line only to models that need it, and let instructions branch on the model serving each request by @DouweM in #13764CoderwithSubAgentsnow sends "Don't spawn sub-agents withdelegate_taskunless the user or AGENTS.md asks, whatever other instructions say about delegating." only to models whose profile sets the newdelegates_unprompted(OpenAI'sgpt-*models other than gpt-oss), and to no model behind aFallbackModel, whereCodernow warns once with aUserWarning. On GPT models the line moves out ofCoder's static guidance into its own rewrite-mode block,capability:coder_instructions:delegation, after append-mode blocks such asRepoContext's, so the first request after upgrading misses the prompt cache, and a conversation that moves to a model on the other side of the flag is sent the instructions a fresh run on that model gets. To keep the line on another model, setprofile={'delegates_unprompted': True}on it or put the rule inCoder(instructions=...); with aFallbackModel, switch to theModelFallbackcapability.
- Count Gemini's thinking tokens as output in
OpenAIChatModelusage by @pydanty in #14297- A
gemini*model throughOpenAIProvidernow reports its thinking tokens inoutput_tokensandoutput_reasoning_tokens, streamed or not, so output token counts and cost rise on thinking models andUsageLimitstoken limits trip sooner. Review anyUsageLimitstuned against the old counts. On a server whosetotal_tokenscounts more than input, output and thinking tokens, passprofile=OpenAIModelProfile(openai_chat_completion_tokens_omit_reasoning=False).
- A
- Send the minimum
thinking_budgetforthinking=Falseongemini-2.5-flashvia the Gemini API ahead of its reroute togemini-3.5-flash-liteby @DouweM in #14414thinking=Falseongemini-2.5-flashthrough the Gemini API now sendsthinking_budget=128instead of0, so until the reroute on 2026-12-01 the model thinks a little instead of not at all; after it, a budget of0fails with a400. Vertex AI andgemini-2.5-flash-litekeep0. To keepthinking_budget=0until the reroute, passprofile=GoogleModelProfile(thinking_always_enabled=False)orgoogle_thinking_config={'thinking_budget': 0}.
- Lower a capability's instructions with its authority, so
with_authoritycoversget_instructions()and MCP server instructions by @DouweM in #14457- A capability lowered with its
authorityclass attribute orwith_authority(), including anMCPcapability and its server instructions, now sends its instructions as framed data on the user channel instead of in the system prompt. Capabilities at'operator', the default, are unchanged; to keep the old behavior, leave the capability at'operator'. Runs already lowering anMCPcapability withwith_authoritythat are in flight across the upgrade may hit a nondeterminism error on Temporal or DBOS if another MCP server follows it. Under Prefect, a flow retried across the upgrade re-runs a finished model request once.
- A capability lowered with its
🚀 Features
- Raise empty and unreadable model responses as
ModelEmptyResponseErrorandModelInvalidResponseError, soFallbackModelandModelFallbackfall back on them by @DouweM in #12108 - Add
RunContext.submit_output()to let a tool submit the run's final output by @DouweM in #11348 - Add a Temporal
ExternalEventWaitersoHandleDeferredToolCallstoken handlers andAskUserwait durably in a workflow by @DouweM in #13215 - Let
ClearToolResultstarget specifictools, keep whole user turns withkeep_turns, and take a callableplaceholderby @DouweM in #12408 - Send
Coder's no-unrequested-sub-agents line only to models that need it, and let instructions branch on the model serving each request by @DouweM in #13764 - Send
Coder's OpenAI-specific'max'guidance through per-model profile flags by @DouweM in #14418 - Keep workspace files below
'operator'authority out of the instructions inRepoContext,SkillsandMemory, and addlowest_authority_underby @adtyavrdhn in #11837 - Lower a capability's instructions with its authority, so
with_authoritycoversget_instructions()and MCP server instructions by @DouweM in #14457 - Add
AnnounceWorkingDirectorysoShell,FileSystemand custom tools name the working directory once by @DouweM in #14427ShellandFileSystemagents get one more instruction line. WithCoder(repo_context=False)or a plainShellorFileSystemagent, a lazily created sandbox now starts before the first request instead of at the first tool call. Durable runs are unaffected.
- Show your prompts in the Pax transcript on a grey background under a
/themepalette by @dsfaccini in #12802 - Resolve Pax
/permissionsapprovals through a token-takingHandleDeferredToolCallshandler with harnessapproval_askby @DouweM in #13195 - Ask whether to trust a new folder in Pax, with
/trustand a status-row indicator by @montybot-pydantic in #14349 - Add
pax --versionby @DouweM in #14392 - Make
/sandboxfaster on large repositories and say what it is doing by @adtyavrdhn in #14584
🐛 Bug Fixes
- Require
truststore>=0.10.5so concurrent first requests through the defaulthttpx2client no longer crash by @mpfaffenberger in #13880 - Read a cancelled Temporal activity's error so it isn't logged as never retrieved by @DouweM in #14398
- Run
for_runandfor_run_stepon the toolset aDynamicToolsetfactory returns, so dynamic capabilities keep nested dynamic tools by @dsfaccini in #13326 - Count Gemini's thinking tokens as output in
OpenAIChatModelusage by @pydanty in #14297 - Keep a tool's
capability_idwhen a prepare function rebuilds itsToolDefinitionby @DouweM in #14374 - Stop an exiting Pax session from marking another live session's background task as cancelled by @DouweM in #14394
- Stop
list_files/grepwith a glob like*from walking hidden directories in the harnessFileSystemby @mpfaffenberger in #14342 - Classify an error status a retrying transport gave up on by the error's
message, as theopenaiSDK does by @pydanty in #14353 - Keep a completed sibling tool return in the interrupted history under
end_strategy='exhaustive'by @pydanty in #14324 - [cache] Keep the GPT-6.2 cached prefix when a dynamic instruction changes after an appended one by @dsfaccini in #14371
- Share one
instructionsstring across a conversation's requests instead of keeping a copy per request by @DouweM in #13308 - Send the minimum
thinking_budgetforthinking=Falseongemini-2.5-flashvia the Gemini API ahead of its reroute togemini-3.5-flash-liteby @DouweM in #14414 - Leave
container_uploadblocks out of the Anthropiccount_tokensrequest, soCodeExecutionTool(files=...)can be counted by @dsfaccini in #13936 - Send
'low'forthinking='minimal'on GPT-5.1 through GPT-5.5 withOpenAIProviderby @dsfaccini in #14415 - Annotate
pydantic_ai.__all__so it still type-checks past 256 exports by @DouweM in #13761 - Send no
reasoning_effortforthinkingongpt-5-search-apiwithOpenAIProviderby @dsfaccini in #14484 - Open the
BoxdSandboxdesktop panel's terminal below the panel instead of over it by @dsfaccini in #14557 - Stop reporting a persistent
shellcommand too long for anSSHWorkspaceas a pending launch by @adtyavrdhn in #14581 - Keep
CapabilityInstructionSourceandRunInstructionSourceinstruction ids through the Temporal payload converter by @DouweM in #14511- Instruction ids that the Temporal payload converter already recorded with the wrong source (
toolset:<id>for a capability,agent:<name>for a run) can't be recovered, so the loaded capability's instruction block is stated once more, including in runs in flight at the upgrade.
- Instruction ids that the Temporal payload converter already recorded with the wrong source (
- Make Esc stop editing a queued Pax message instead of interrupting the turn by @DouweM in #10661
- Describe the Pax
coderplugin'sinstructionssetting as added after the defaults, not replacing them by @DouweM in #14393 - Name the Pax web UI's search and filter fields for screen readers, and test its recurring web UI defects by @dsfaccini in #14410
Full Changelog: v2.74.0...v2.75.0