- Added Anthropic
claude-sonnet-4-6fallback model entry to generated model definitions.
- Added
transporttoStreamOptionswith values"sse","websocket", and"auto"(currently supported byopenai-codex-responses). - Added WebSocket transport support for OpenAI Codex Responses (
openai-codex-responses).
- OpenAI Codex Responses now defaults to SSE transport unless
transportis explicitly set. - OpenAI Codex Responses WebSocket connections are cached per
sessionIdand expire after 5 minutes of inactivity.
- Added MiniMax M2.5 model entries for
minimax,minimax-cn,openrouter, andvercel-ai-gatewayproviders, plusminimax-m2.5-freeforopencode.
- Added optional
metadatafield toStreamOptionsfor passing provider-specific metadata (e.g. Anthropicuser_idfor abuse tracking/rate limiting) (#1384 by @7Sageer) - Added
gpt-5.3-codex-sparkmodel definition for OpenAI and OpenAI Codex providers (128k context, text-only, research preview). Not yet functional, may become available in the next few hours or days.
- Routed GitHub Copilot Claude 4.x models through Anthropic Messages API, centralized Copilot dynamic header handling, and added Copilot Claude Anthropic stream coverage (#1353 by @NateSmyth)
- Fixed OpenAI completions and responses streams to tolerate malformed trailing tool-call JSON without failing parsing (#1424)
- Updated the Antigravity system instruction to a more compact version for Google Gemini CLI compatibility
- Use
parametersJsonSchemafor Google provider tool declarations to support full JSON Schema (anyOf, oneOf, const, etc.) (#1398 by @jarib) - Reverted incorrect Antigravity model change:
claude-opus-4-6-thinkingback toclaude-opus-4-5-thinking(model doesn't exist on Antigravity endpoint) - Corrected opencode context windows for Claude Sonnet 4 and 4.5 (#1383)
- Added OpenRouter
automodel alias for automatic model routing (#1361 by @yogasanas)
- Replaced Claude Opus 4.5 with Opus 4.6 in model definitions (#1345 by @calvin-hpnet)
- Added
AWS_BEDROCK_SKIP_AUTHandAWS_BEDROCK_FORCE_HTTP1environment variables for connecting to unauthenticated Bedrock proxies (#1320 by @virtuald)
- Set OpenAI Responses API requests to
store: falseby default to avoid server-side history logging (#1308) - Re-exported TypeBox
Type,Static, andTSchemafrom@mariozechner/pi-aito match documentation and avoid duplicate TypeBox type identity issues in pnpm setups (#1338) - Fixed Bedrock adaptive thinking handling for Claude Opus 4.6 with interleaved thinking beta responses (#1323 by @markusylisiurunen)
- Fixed
AWS_BEDROCK_SKIP_AUTHenvironment detection to avoidprocessaccess in non-Node.js environments
- Fixed
supportsXhigh()to treat Anthropic Messages Opus 4.6 models as xhigh-capable sostreamSimplecan mapxhighto adaptive effortmax
- Fixed Bedrock Opus 4.6 model IDs (removed
:0suffix) and cache pricing forus.*andeu.*variants - Added missing
eu.anthropic.claude-opus-4-6-v1inference profile to model catalog - Fixed Claude Opus 4.6 context window metadata to 200000 for Anthropic and OpenCode providers
- Added adaptive thinking support for Claude Opus 4.6 with effort levels (
low,medium,high,max) - Added
effortoption toAnthropicOptionsfor controlling adaptive thinking depth thinkingEnablednow automatically uses adaptive thinking for Opus 4.6+ models and budget-based thinking for older modelsstreamSimple/completeSimpleautomatically mapThinkingLevelto effort levels for Opus 4.6
- Updated
@anthropic-ai/sdkto 0.73.0 - Updated
@aws-sdk/client-bedrock-runtimeto 3.983.0 - Updated
@google/genaito 1.40.0 - Removed
fast-xml-parseroverride (no longer needed)
- Added Claude Opus 4.6 model to the generated model catalog
- Added GPT-5.3 Codex model to the generated model catalog (OpenAI Codex provider only)
- Fixed OpenAI Codex Responses provider to respect configured baseUrl (#1244)
- Fixed xhigh thinking level support check to accept gpt-5.2 model IDs (#1209)
- Fixed
cache_controlnot being applied to string-format user messages in Anthropic provider
- Fixed
cacheRetentionoption not being passed through inbuildBaseOptions(#1154) - Fixed OAuth login/refresh not using HTTP proxy settings (
HTTP_PROXY,HTTPS_PROXYenv vars) (#1132) - Fixed OpenAI-compatible completions to omit unsupported
stricttool fields for providers that reject them (#1172)
- Added
PI_AI_ANTIGRAVITY_VERSIONenvironment variable to override the Antigravity User-Agent version when Google updates their version requirements (#1129) - Added
cacheRetentionstream option with provider-specific mappings for prompt cache controls, defaulting to short retention (#1134)
- Added
maxRetryDelayMsoption toStreamOptionsto cap server-requested retry delays. When a provider (e.g., Google Gemini CLI) requests a delay longer than this value, the request fails immediately with an informative error instead of waiting silently. Default: 60000ms (60 seconds). Set to 0 to disable the cap. (#1123) - Added Qwen thinking format support for OpenAI-compatible completions via
enable_thinking. (#940 by @4h9fbZ)
- Added Vercel AI Gateway routing support via
vercelGatewayRoutingoption in model config (#1051 by @ben-vargas)
- Updated Antigravity User-Agent from 1.11.5 to 1.15.8 to fix rejected requests (#1079)
- Fixed tool call argument defaults for Anthropic and Google history conversion when providers omit inputs (#1065)
- Added Kimi For Coding provider support (Moonshot AI's Anthropic-compatible coding API)
- Added Hugging Face provider support via OpenAI-compatible Inference Router (#994)
- Added
PI_CACHE_RETENTIONenvironment variable to control cache TTL for Anthropic (5m vs 1h) and OpenAI (in-memory vs 24h). Set tolongfor extended retention. Only applies to direct API calls (api.anthropic.com, api.openai.com). (#967)
- Fixed OpenAI completions
toolChoicehandling to correctly settype: "function"wrapper (#998 by @williamtwomey) - Fixed cross-provider handoff failing when switching from OpenAI Responses API providers (github-copilot, openai-codex) to other providers due to pipe-separated tool call IDs not being normalized, and trailing underscores in truncated IDs being rejected by OpenAI Codex (#1022)
- Fixed 429 rate limit errors incorrectly triggering auto-compaction instead of retry with backoff (#1038)
- Fixed Anthropic provider to handle
sensitivestop_reason returned by API (#978) - Fixed DeepSeek API compatibility by detecting
deepseek.comURLs and disabling unsupporteddeveloperrole (#1048) - Fixed Anthropic provider to preserve input token counts when proxies omit them in
message_deltaevents (#1045)
- Fixed OpenCode Zen model generation to exclude deprecated models (#970 by @DanielTatarkin)
- Added OpenRouter provider routing support for custom models via
openRouterRoutingcompat field (#859 by @v01dpr1mr0s3) - Added
azure-openai-responsesprovider support for Azure OpenAI Responses API. (#890 by @markusylisiurunen) - Added HTTP proxy environment variable support for API requests (#942 by @haoqixu)
- Added
createAssistantMessageEventStream()factory function for use in extensions. - Added
resetApiProviders()to clear and re-register built-in API providers.
- Refactored API streaming dispatch to use an API registry with provider-owned
streamSimplemapping. - Moved environment API key resolution to
env-api-keys.tsand re-exported it from the package entrypoint. - Azure OpenAI Responses provider now uses base URL configuration with deployment-aware model mapping and no longer includes service tier handling.
- Fixed Bun runtime detection for dynamic imports in browser-compatible modules (stream.ts, openai-codex-responses.ts, openai-codex.ts) (#922 by @dannote)
- Fixed streaming functions to use
model.apiinstead of hardcoded API types - Fixed Google providers to default tool call arguments to an empty object when omitted
- Fixed OpenAI Responses streaming to handle
arguments.doneevents on OpenAI-compatible endpoints (#917 by @williballenthin) - Fixed OpenAI Codex Responses tool strictness handling after the shared responses refactor
- Fixed Azure OpenAI Responses streaming to guard deltas before content parts and correct metadata and handoff gating
- Fixed OpenAI completions tool-result image batching after consecutive tool results (#902 by @terrorobe)
- Added
headersoption toStreamOptionsfor custom HTTP headers in API requests. Supported by all providers except Amazon Bedrock (which uses AWS SDK auth). Headers are merged with provider defaults andmodel.headers, withoptions.headerstaking precedence. - Added
originatoroption tologinOpenAICodex()for custom OAuth client identification - Browser compatibility for pi-ai: replaced top-level Node.js imports with dynamic imports for browser environments (#873)
- Fixed OpenAI Responses API 400 error "function_call without required reasoning item" when switching between models (same provider, different model). The fix omits the
idfield for function_calls from different models to avoid triggering OpenAI's reasoning/function_call pairing validation (#886)
- Added AWS credential detection for ECS/Kubernetes environments:
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_CONTAINER_CREDENTIALS_FULL_URI,AWS_WEB_IDENTITY_TOKEN_FILE(#848)
- Fixed OpenAI Responses 400 error "reasoning without following item" by skipping errored/aborted assistant messages entirely in transform-messages.ts (#838)
- Removed
strictResponsesPairingcompat option (no longer needed after the transform-messages fix)
- Added
OpenAIResponsesCompatinterface withstrictResponsesPairingoption for Azure OpenAI Responses API, which requires strict reasoning/message pairing in history replay (#768 by @prateekmedia)
- Split
OpenAICompatintoOpenAICompletionsCompatandOpenAIResponsesCompatfor type-safe API-specific compat settings
- Fixed tool call ID normalization for cross-provider handoffs (e.g., Codex to Antigravity Claude) (#821)
- OpenAI Codex responses now use the context system prompt directly in the instructions field.
- Fixed orphaned tool results after errored assistant messages causing Codex API errors. When an assistant message has
stopReason: "error", its tool calls are now excluded from pending tool tracking, preventing synthetic tool results from being generated for calls that will be dropped by provider-specific converters. (#812) - Fixed Bedrock Claude max_tokens handling to always exceed thinking budget tokens, preventing compaction failures. (#797 by @pjtf93)
- Fixed Claude Code tool name normalization to match the Claude Code tool list case-insensitively and remove invalid mappings.
- Fixed OpenAI-compatible provider feature detection to use
model.providerin addition to URL, allowing custom base URLs (e.g., proxies) to work correctly with provider-specific settings (#774) - Fixed Gemini 3 context loss when switching from providers without thought signatures: unsigned tool calls are now converted to text with anti-mimicry notes instead of being skipped
- Fixed string numbers in tool arguments not being coerced to numbers during validation (#786 by @dannote)
- Fixed Bedrock tool call IDs to use only alphanumeric characters, avoiding API errors from invalid characters (#781 by @pjtf93)
- Fixed empty error assistant messages (from 429/500 errors) breaking the tool_use to tool_result chain by filtering them in
transformMessages
- Fixed OpenCode provider's
/v1endpoint to usesystemrole instead ofdeveloperrole, fixing400 Incorrect role informationerror for models usingopenai-completionsAPI (#755 by @melihmucuk) - Added retry logic to OpenAI Codex provider for transient errors (429, 5xx, connection failures). Uses exponential backoff with up to 3 retries. (#733)
- Added MiniMax China (
minimax-cn) provider support (#725 by @tallshort) - Added
gpt-5.2-codexmodels for GitHub Copilot and OpenCode Zen providers (#734 by @aadishv)
- Avoid unsigned Gemini 3 tool calls (#741 by @roshanasingh4)
- Fixed signature support for non-Anthropic models in Amazon Bedrock provider (#727 by @unexge)
- Fixed OpenAI Responses timeout option handling (#706 by @markusylisiurunen)
- Fixed Bedrock tool call conversion to apply message transforms (#707 by @pjtf93)
- Export
parseStreamingJsonfrom main package for tsx dev mode compatibility
- Added Vercel AI Gateway provider with model discovery and
AI_GATEWAY_API_KEYenv support (#689 by @timolins)
- Fixed z.ai thinking/reasoning: z.ai uses
thinking: { type: "enabled" }instead of OpenAI'sreasoning_effort. AddedthinkingFormatcompat flag to handle this. (#688)
- MiniMax provider support with M2 and M2.1 models via Anthropic-compatible API (#656 by @dannote)
- Add Amazon Bedrock provider with prompt caching for Claude models (experimental, tested with Anthropic Claude models only) (#494 by @unexge)
- Added
serviceTieroption for OpenAI Responses requests (#672 by @markusylisiurunen) - Anthropic caching on OpenRouter: Interactions with Anthropic models via OpenRouter now set a 5-minute cache point using Anthropic-style
cache_controlbreakpoints on the last assistant or user message. (#584 by @nathyong) - Google Gemini CLI provider improvements: Added Antigravity endpoint fallback (tries daily sandbox then prod when
baseUrlis unset), header-based retry delay parsing (Retry-After,x-ratelimit-reset,x-ratelimit-reset-after), stablesessionIdderivation from first user message for cache affinity, empty SSE stream retry with backoff, andanthropic-betaheader for Claude thinking models (#670 by @kim0)
- Fixed Google provider thinking detection:
isThinkingPart()now only checksthought === true, notthoughtSignature. Per Google docs,thoughtSignatureis for context replay and can appear on any part type. Also removedidfield fromfunctionCall/functionResponse(rejected by Vertex AI and Cloud Code Assist), and addedtextSignatureround-trip for multi-turn reasoning context. (#631 by @theBucky)
- OpenAI Codex: switched to bundled system prompt matching opencode, changed originator to "pi", simplified prompt handling
- Added
GOOGLE_APPLICATION_CREDENTIALSenv var support for Vertex AI credential detection (standard for CI/production). - Added
supportsUsageInStreamingcompatibility flag for OpenAI-compatible providers that rejectstream_options: { include_usage: true }. Defaults totrue. Set tofalsein model config for providers like gatewayz.ai. (#596 by @XesGaDeus) - Improved Google model pricing info (#588 by @aadishv)
- Fixed
os.homedir()calls at module load time; now resolved lazily when needed. - Fixed OpenAI Responses tool strict flag to use a boolean for LM Studio compatibility (#598 by @gnattu)
- Fixed Google Cloud Code Assist OAuth for paid subscriptions: properly handles long-running operations for project provisioning, supports
GOOGLE_CLOUD_PROJECT/GOOGLE_CLOUD_PROJECT_IDenv vars for paid tiers, and handles VPC-SC affected users (#582 by @cmf)
- Added OpenCode Zen provider support with 26 models (Claude, GPT, Gemini, Grok, Kimi, GLM, Qwen, etc.). Set
OPENCODE_API_KEYenv var to use.
- Fixed Gemini CLI abort handling: detect native
AbortErrorin retry catch block, cancel SSE reader when abort signal fires (#568 by @tmustier) - Fixed Antigravity provider 429 errors by aligning request payload with CLIProxyAPI v6.6.89: inject Antigravity system instruction with
role: "user", setrequestType: "agent", and useantigravityuserAgent. Added bridge prompt to override Antigravity behavior (identity, paths, web dev guidelines) with Pi defaults. (#571 by @ben-vargas) - Fixed thinking block handling for cross-model conversations: thinking blocks are now converted to plain text (no
<thinking>tags) when switching models. Previously,<thinking>tags caused models to mimic the pattern and output literal tags. Also fixed empty thinking blocks causing API errors. (#561)
thinkingBudgetsoption inSimpleStreamOptionsfor customizing token budgets per thinking level on token-based providers (#529 by @melihmucuk)
- Removed OpenAI Codex model aliases (
gpt-5,gpt-5-mini,gpt-5-nano,codex-mini-latest,gpt-5-codex,gpt-5.1-codex,gpt-5.1-chat-latest). Use canonical model IDs:gpt-5.1,gpt-5.1-codex-max,gpt-5.1-codex-mini,gpt-5.2,gpt-5.2-codex. (#536 by @ghoulr)
- Fixed OpenAI Codex context window from 400,000 to 272,000 tokens to match Codex CLI defaults and prevent 400 errors. (#536 by @ghoulr)
- Fixed Codex SSE error events to surface message, code, and status. (#551 by @tmustier)
- Fixed context overflow detection for
context_length_exceedederror codes.
- Exported OpenAI Codex utilities:
CacheMetadata,getCodexInstructions,getModelFamily,ModelFamily,buildCodexPiBridge,buildCodexSystemPrompt,CodexSystemPrompt(#510 by @mitsuhiko)
sessionIdoption inStreamOptionsfor providers that support session-based caching. OpenAI Codex provider uses this to setprompt_cache_keyand routing headers.
- Codex provider now always includes
reasoning.encrypted_contenteven when customincludeoptions are passed (#484 by @kim0)
- OpenAI Codex models no longer have per-thinking-level variants (e.g.,
gpt-5.2-codex-high). Use the base model ID and set thinking level separately. The Codex provider clamps reasoning effort to what each model supports internally. (initial implementation by @ben-vargas in #472)
- Headless OAuth support for all callback-server providers (Google Gemini CLI, Antigravity, OpenAI Codex): paste redirect URL when browser callback is unreachable (#428 by @ben-vargas, #468 by @crcatala)
- Cancellable GitHub Copilot device code polling via AbortSignal
- Codex requests now omit the
reasoningfield entirely when thinking is off, letting the backend use its default instead of forcing a value. (#472)
- OpenAI Codex OAuth provider with Responses API streaming support:
openai-codex-responsesstreaming provider with SSE parsing, tool-call handling, usage/cost tracking, and PKCE OAuth flow (#451 by @kim0)
- Vertex AI dummy value for
getEnvApiKey(): Returns"<authenticated>"when Application Default Credentials are configured (~/.config/gcloud/application_default_credentials.jsonexists) and bothGOOGLE_CLOUD_PROJECT(orGCLOUD_PROJECT) andGOOGLE_CLOUD_LOCATIONare set. This allowsstreamSimple()to work with Vertex AI without explicitapiKeyoption. The ADC credentials file existence check is cached per-process to avoid repeated filesystem access.
- Google Vertex AI models no longer appear in available models list without explicit authentication. Previously,
getEnvApiKey()returned a dummy value forgoogle-vertex, causing models to show up even when Google Cloud ADC was not configured.
- Vertex AI provider with ADC (Application Default Credentials) support. Authenticate with
gcloud auth application-default login, setGOOGLE_CLOUD_PROJECTandGOOGLE_CLOUD_LOCATION, and access Gemini models via Vertex AI. (#300 by @default-anton)
- Gemini CLI rate limit handling: Added automatic retry with server-provided delay for 429 errors. Parses delay from error messages like "Your quota will reset after 39s" and waits accordingly. Falls back to exponential backoff for other transient errors. (#370)
- Agent API moved: All agent functionality (
agentLoop,agentLoopContinue,AgentContext,AgentEvent,AgentTool,AgentToolResult, etc.) has moved to@mariozechner/pi-agent-core. Import from that package instead of@mariozechner/pi-ai.
GoogleThinkingLeveltype: Exported type that mirrors Google'sThinkingLevelenum values ("THINKING_LEVEL_UNSPECIFIED" | "MINIMAL" | "LOW" | "MEDIUM" | "HIGH"). Allows configuring Gemini thinking levels without importing from@google/genai.ANTHROPIC_OAUTH_TOKENenv var: Now checked beforeANTHROPIC_API_KEYingetEnvApiKey(), allowing OAuth tokens to take precedence.event-stream.jsexport:AssistantMessageEventStreamutility now exported from package index.
- OAuth uses Web Crypto API: PKCE generation and OAuth flows now use Web Crypto API (
crypto.subtle) instead of Node.jscryptomodule. This improves browser compatibility while still working in Node.js 20+. - Deterministic model generation:
generate-models.tsnow sorts providers and models alphabetically for consistent output across runs. (#332 by @mrexodia)
- OpenAI completions empty content blocks: Empty text or thinking blocks in assistant messages are now filtered out before sending to the OpenAI completions API, preventing validation errors. (#344 by @default-anton)
- Thinking token duplication: Fixed thinking content duplication with chutes.ai provider. The provider was returning thinking content in both
reasoning_contentandreasoningfields, causing each chunk to be processed twice. Now only the first non-empty reasoning field is used. - zAi provider API mapping: Fixed zAi models to use
openai-completionsAPI with correct base URL (https://api.z.ai/api/coding/paas/v4) instead of incorrect Anthropic API mapping. (#344, #358 by @default-anton)
- OAuth storage removed (#296): All storage functions (
loadOAuthCredentials,saveOAuthCredentials,setOAuthStorage, etc.) removed. Callers are responsible for storing credentials. - OAuth login functions:
loginAnthropic,loginGitHubCopilot,loginGeminiCli,loginAntigravitynow returnOAuthCredentialsinstead of saving to disk. - refreshOAuthToken: Now takes
(provider, credentials)and returns newOAuthCredentialsinstead of saving. - getOAuthApiKey: Now takes
(provider, credentials)and returns{ newCredentials, apiKey }or null. - OAuthCredentials type: No longer includes
type: "oauth"discriminator. Callers add discriminator when storing. - setApiKey, resolveApiKey: Removed. Callers must manage their own API key storage/resolution.
- getApiKey: Renamed to
getEnvApiKey. Only checks environment variables for known providers.
- Thinking tag leakage: Fixed Claude mimicking literal
</thinking>tags in responses. Unsigned thinking blocks (from aborted streams) are now converted to plain text without<thinking>tags. The TUI still displays them as thinking blocks. (#302 by @nicobailon)
- xhigh thinking level support: Added
supportsXhigh()function to check if a model supports xhigh reasoning level. Also clamps xhigh to high for OpenAI models that don't support it. (#236 by @theBucky)
-
Gemini multimodal tool results: Fixed images in tool results causing flaky/broken responses with Gemini models. For Gemini 3, images are now nested inside
functionResponse.partsper the docs. For older models (which don't support multimodal function responses), images are sent in a separate user message. -
Queued message steering: When
getQueuedMessagesis provided, the agent loop now checks for queued user messages after each tool call and skips remaining tool calls in the current assistant message when a queued message arrives (emitting error tool results). -
Double API version path in Google provider URL: Fixed Gemini API calls returning 404 after baseUrl support was added. The SDK was appending its default apiVersion to baseUrl which already included the version path. (#251 by @shellfyred)
-
Anthropic SDK retries disabled: Re-enabled SDK-level retries (default 2) for transient HTTP failures. (#252)
-
Gemini 3 Flash thinking support: Extended thinking level support for Gemini 3 Flash models (MINIMAL, LOW, MEDIUM, HIGH) to match Pro models' capabilities. (#212 by @markusylisiurunen)
-
GitHub Copilot thinking models: Added thinking support for additional Copilot models (o3-mini, o1-mini, o1-preview). (#234 by @aadishv)
-
Gemini tool result format: Fixed tool result format for Gemini 3 Flash Preview which strictly requires
{ output: value }for success and{ error: value }for errors. Previous format using{ result, isError }was rejected by newer Gemini models. Also improved type safety by removingas anycasts. (#213, #220) -
Google baseUrl configuration: Google provider now respects
baseUrlconfiguration for custom endpoints or API proxies. (#216, #221 by @theBucky) -
GitHub Copilot vision requests: Added
Copilot-Vision-Requestheader when sending images to GitHub Copilot models. (#222) -
GitHub Copilot X-Initiator header: Fixed X-Initiator logic to check last message role instead of any message in history. This ensures proper billing when users send follow-up messages. (#209)
-
Image limits test suite: Added comprehensive tests for provider-specific image limitations (max images, max size, max dimensions). Discovered actual limits: Anthropic (100 images, 5MB, 8000px), OpenAI (500 images, ≥25MB), Gemini (~2500 images, ≥40MB), Mistral (8 images, ~15MB), OpenRouter (~40 images context-limited, ~15MB). (#120)
-
Tool result streaming: Added
tool_execution_updateevent and optionalonUpdatecallback toAgentTool.execute()for streaming tool output during execution. Tools can now emit partial results (e.g., bash stdout) that are forwarded to subscribers. (#44) -
X-Initiator header for GitHub Copilot: Added X-Initiator header handling for GitHub Copilot provider to ensure correct call accounting (agent calls are not deducted from quota). Sets initiator based on last message role. (#200 by @kim0)
- Normalized tool_execution_end result:
tool_execution_endevent now always containsAgentToolResult(no longerAgentToolResult | string). Errors are wrapped in the standard result format.
- Reasoning disabled by default: When
reasoningoption is not specified, thinking is now explicitly disabled for all providers. Previously, some providers like Gemini with "dynamic thinking" would use their default (thinking ON), causing unexpected token usage. This was the original intended behavior. (#180 by @markusylisiurunen)
- Interleaved thinking for Anthropic: Added
interleavedThinkingoption toAnthropicOptions. When enabled, Claude 4 models can think between tool calls and reason after receiving tool results. Enabled by default (no extra token cost, just unlocks the capability). SetinterleavedThinking: falseto disable.
Dedicated to Peter's shoulder (@steipete)
- Interleaved thinking for Anthropic: Enabled interleaved thinking in the Anthropic provider, allowing Claude models to output thinking blocks interspersed with text responses.
- GitHub Copilot provider: Added
github-copilotas a known provider with models sourced from models.dev. Includes Claude, GPT, Gemini, Grok, and other models available through GitHub Copilot. (#191 by @cau1k)
-
GitHub Copilot gpt-5 models: Fixed API selection for gpt-5 models to use
openai-responsesinstead ofopenai-completions(gpt-5 models are not accessible via completions endpoint) -
GitHub Copilot cross-model context handoff: Fixed context handoff failing when switching between GitHub Copilot models using different APIs (e.g., gpt-5 to claude-sonnet-4). Tool call IDs from OpenAI Responses API were incompatible with other models. (#198)
-
Gemini 3 Pro thinking levels: Thinking level configuration now works correctly for Gemini 3 Pro models. Previously all levels mapped to -1 (minimal thinking). Now LOW/MEDIUM/HIGH properly control test-time computation. (#176 by @markusylisiurunen)
- Anthropic SDK retries disabled: Set
maxRetries: 0on Anthropic client to allow application-level retry handling. The SDK's built-in retries were interfering with coding-agent's retry logic. (#157)
- Mistral provider: Added support for Mistral AI models via the OpenAI-compatible API. Includes automatic handling of Mistral-specific requirements (tool call ID format). Set
MISTRAL_API_KEYenvironment variable to use.
-
Fixed Mistral 400 errors after aborted assistant messages by skipping empty assistant messages (no content, no tool calls) (#165)
-
Removed synthetic assistant bridge message after tool results for Mistral (no longer required as of Dec 2025) (#165)
-
Fixed bug where
ANTHROPIC_API_KEYenvironment variable was deleted globally after first OAuth token usage, causing subsequent prompts to fail (#164)
agentLoopContinuefunction: Continue an agent loop from existing context without adding a new user message. Validates that the last message isuserortoolResult. Useful for retry after context overflow or resuming from manually-added tool results.
- Removed provider-level tool argument validation. Validation now happens in
agentLoopviaexecuteToolCalls, allowing models to retry on validation errors. For manual tool execution, usevalidateToolCall(tools, toolCall)orvalidateToolArguments(tool, toolCall).
-
Added
validateToolCall(tools, toolCall)helper that finds the tool by name and validates arguments. -
OpenAI compatibility overrides: Added
compatfield toModelforopenai-completionsAPI, allowing explicit configuration of provider quirks (supportsStore,supportsDeveloperRole,supportsReasoningEffort,maxTokensField). Falls back to URL-based detection if not set. Useful for LiteLLM, custom proxies, and other non-standard endpoints. (#133, thanks @fink-andreas for the initial idea and PR) -
xhigh reasoning level: Added
xhightoReasoningEfforttype for OpenAI codex-max models. For non-OpenAI providers (Anthropic, Google),xhighis automatically mapped tohigh. (#143)
- Updated SDK versions: OpenAI SDK 5.21.0 → 6.10.0, Anthropic SDK 0.61.0 → 0.71.2, Google GenAI SDK 1.30.0 → 1.31.0
- Added
totalTokensfield toUsagetype: All code that constructsUsageobjects must now include thetotalTokensfield. This field represents the total tokens processed by the LLM (input + output + cache). For OpenAI and Google, this uses native API values (total_tokens,totalTokenCount). For Anthropic, it's computed asinput + output + cacheRead + cacheWrite.
- Added
gpt-5.1-codex-maxmodel support
-
OpenAI Token Counting: Fixed
usage.inputto exclude cached tokens for OpenAI providers. Previously,inputincluded cached tokens, causing double-counting when calculating total context size viainput + cacheRead. Nowinputrepresents non-cached input tokens across all providers, makinginput + output + cacheRead + cacheWritethe correct formula for total context size. -
Fixed Claude Opus 4.5 cache pricing (was 3x too expensive)
- Corrected cache_read: $1.50 → $0.50 per MTok
- Corrected cache_write: $18.75 → $6.25 per MTok
- Added manual override in
scripts/generate-models.tsuntil upstream fix is merged - Submitted PR to models.dev: anomalyco/models.dev#439
Initial release with multi-provider LLM support.