- Remove setApiKey, resolveApiKey, and global apiKeys Map from stream.ts - Rename getApiKey to getApiKeyFromEnv (only checks env vars) - Remove OAuth storage layer (storage.ts deleted) - OAuth login/refresh functions now return credentials instead of saving - getOAuthApiKey/refreshOAuthToken now take credentials as params - Add test/oauth.ts helper for ai package tests - Simplify root npm run check (single biome + tsgo pass) - Remove redundant check scripts from most packages - Add web-ui and coding-agent examples to biome/tsgo includes coding-agent still has compile errors - needs refactoring for new API
12 KiB
Changelog
[Unreleased]
Breaking Changes
- setApiKey, resolveApiKey: Removed. Callers must manage their own API key storage/resolution.
- getApiKey: Renamed to
getApiKeyFromEnv. Only checks environment variables for known providers. - OAuth storage removed: 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.
[0.27.7] - 2025-12-24
Fixed
- 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)
[0.25.1] - 2025-12-21
Added
- 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)
Fixed
-
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)
[0.23.5] - 2025-12-19
Added
-
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)
Fixed
-
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)
[0.22.3] - 2025-12-16
Added
-
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)
Changed
- Normalized tool_execution_end result:
tool_execution_endevent now always containsAgentToolResult(no longerAgentToolResult | string). Errors are wrapped in the standard result format.
Fixed
- 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)
[0.22.2] - 2025-12-15
Added
- 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.
[0.22.1] - 2025-12-15
Dedicated to Peter's shoulder (@steipete)
Added
- Interleaved thinking for Anthropic: Enabled interleaved thinking in the Anthropic provider, allowing Claude models to output thinking blocks interspersed with text responses.
[0.22.0] - 2025-12-15
Added
- 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)
Fixed
-
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)
[0.18.2] - 2025-12-11
Changed
- 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)
[0.18.1] - 2025-12-10
Added
- 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
-
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)
[0.17.0] - 2025-12-09
Added
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.
Breaking Changes
- 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
-
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)
Changed
- 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
[0.13.0] - 2025-12-06
Breaking Changes
- 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.
[0.12.10] - 2025-12-04
Added
- Added
gpt-5.1-codex-maxmodel support
Fixed
-
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: https://github.com/sst/models.dev/pull/439
[0.9.4] - 2025-11-26
Initial release with multi-provider LLM support.