omk-ai 0.98.1 → 0.98.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,1580 @@
1
+ # Changelog
2
+
3
+ ## [0.98.3] - 2026-09-06
4
+
5
+ ## [0.98.2] - 2026-09-02
6
+
7
+ ### Fixed
8
+
9
+ - Claude Fable models were configured for budget-based thinking, which that family does not accept: `thinking: {type: "enabled", budget_tokens: N}` and any sampling parameter each return HTTP 400, so every reasoning turn on `claude-fable-5` / `claude-fable-5-1` failed before producing a token. Fable now carries `forceAdaptiveThinking` and `supportsTemperature: false` like the Opus 4.7/4.8 line, so requests send `thinking: {type: "adaptive"}` and drop temperature.
10
+ - Claude Fable exposed no `thinkingLevelMap`, so its `xhigh` and `max` effort tiers were invisible to `getSupportedThinkingLevels()` and `/thinking max` silently clamped to `high` (top-tier levels are only exposed when a model maps them explicitly). All 18 Fable routes now map `xhigh` -> effort `xhigh` and `max` -> effort `max`, matching Opus 4.7/4.8.
11
+ - Claude Fable rejected every **thinking-off** turn with `400 "thinking.type.disabled" is not supported for this model`, so `claude-fable-5` / `claude-fable-5-1` failed whenever reasoning was not requested — the common default path. Fable always thinks adaptively, so the `thinking` field is now omitted for that family instead of sending an explicit disable. The new `supportsDisabledThinking` compat flag scopes this to Fable only: Opus 4.6/4.8, Opus 5, and Sonnet 5 are adaptive too but still accept an explicit disable, and dropping it there would have billed users for thinking they had turned off.
12
+ - The spoofed Claude Code client version was pinned at 2.1.75 and had drifted into three separate copies (2.1.75 / 2.1.75 / 2.1.177). Anthropic gates newer models on that version, so `claude-fable-5-1` rejected every request with `400 claude_code_version_too_old`. The version now lives in one module (`CLAUDE_CODE_VERSION`) at 2.1.258.
13
+
14
+ ## [0.98.1] - 2026-08-30
15
+
16
+ ## [0.98.0] - 2026-08-28
17
+
18
+ ### Added
19
+
20
+ - Refreshed the model catalogs. GLM-5.3 Flash is now registered on five routes (`glm-5.3-flash` on Z.AI and Z.AI Coding, `zai/glm-5.3-flash` on Vercel AI Gateway, `z-ai/glm-5.3-flash` on OpenRouter, `@cf/zai-org/glm-5.3-flash` on Cloudflare Workers AI), alongside `glm-5.3-highspeed`, Qwen3.8 Flash, MiniMax M3, DeepSeek V4 Pro 0813, Tencent HY4 preview, GPT-OSS Safeguard 120B, and Ling 3.0 Flash Fin — 21 models added, 72 retired, 1,279 to 1,217 overall. Every upstream source answered during the refresh, so the removals are upstream retirements rather than a short read.
21
+
22
+ ### Changed
23
+
24
+ - Tests no longer pin volatile model ids, which is what turned each catalog refresh into unrelated failures. `stealth/ox-alpha` was pinned by name and by property, but OpenRouter's stealth slots are temporary previews that rotate, so the assertions now cover whatever `stealth/*` entries exist under the same contract. The Fireworks router test pinned the `-turbo` generation that was retired with the move to the K3 line, and now asserts what actually makes a router a router; image input is checked per model because it follows the routed model rather than the class. Cloudflare deprecated the AI Gateway `/compat` endpoint and upstream stopped listing `workers-ai/*` under that provider, so the gateway integration blocks that targeted it were retargeted to a surviving gateway model or removed where direct Workers AI coverage already existed. The two unit tests that cover our `/compat` request shaping now build the model explicitly, since the client path still ships for existing integrations while no catalog entry targets it.
25
+
26
+ ### Fixed
27
+
28
+ - The model catalog generators no longer overwrite the committed catalog after a short read. Each provider pass caught its own fetch error and returned an empty result, so a timeout, rate limit, or transient 5xx deleted that provider from the catalog while the script still exited 0 — and the resulting diff is indistinguishable from upstream retiring models, which makes the regeneration unreviewable. `generate-models` now records every failed source and refuses to write, listing what failed and offering `--allow-partial` for a loss that is real; `generate-image-models` throws instead of writing an empty catalog. Verified in a network namespace with no connectivity: both exit 1 and leave the committed files byte-identical. Zyloo keeps its own fallback because it degrades to a curated six-model constant that matches the live list rather than to nothing.
29
+
30
+ ## [0.97.0] - 2026-08-24
31
+
32
+ ### Changed
33
+
34
+ - Every GPT-5.6 route now advertises OMK's uniform 1,000,000-token context window, including Codex Sol, Terra, Luna, and MoA.
35
+
36
+ ## [0.96.2] - 2026-08-21
37
+
38
+ ### Security
39
+
40
+ - Qwen OAuth now rejects non-HTTPS or unapproved `resource_url` origins before storing credentials or creating models, constrains device verification links to `chat.qwen.ai`, and never includes token response bodies in errors.
41
+
42
+ ## [0.96.1] - 2026-08-20
43
+
44
+ ### Added
45
+
46
+ - Native `xai` now owns Grok thinking levels and sends model-specific `reasoning_effort` values. Grok 4.6 exposes `xhigh` (with `max`/`ultra` aliases). Grok 4.5 and 4.3 expose `max`/`ultra` in the selector and map them to `high`; only Grok 4.3 maps thinking off to `none`.
47
+
48
+ ### Fixed
49
+
50
+ - Native xAI OAuth now locks every `xai` model request to the official `https://api.x.ai/v1` origin after all provider and model overrides, preventing subscription bearer tokens from being forwarded to a custom endpoint. API-key-only configurations retain their explicit provider configuration.
51
+
52
+ ### Removed
53
+
54
+ - Removed the built-in `grok-oauth-proxy` OAuth provider. Use native `xai` OAuth or `XAI_API_KEY`.
55
+
56
+ ## [0.96.0] - 2026-08-16
57
+
58
+ ### Added
59
+
60
+ - GLM-5.3 (`glm-5.3`) is now registered for the Z.AI coding-plan endpoints (`zai`, `zai-coding-cn`) and OpenCode Go, with a 1M context window, 131,072 max output tokens, `compat.supportsReasoningEffort`, and thinking levels up to `max`. Upstream currently publishes GLM-5.3 only on the coding-plan surface, so it is intentionally absent from the plain Z.AI and OpenRouter catalogs.
61
+ - Gemini 3.7 Flash (`gemini-3.7-flash`) is now registered for `google`, `google-vertex`, `openrouter`, `github-copilot`, `vercel-ai-gateway`, and `opencode`, with a 1,048,576-token context window and 65,536 max output tokens. The hand-maintained Vertex list gained a matching `Gemini 3.7 Flash (Vertex)` entry at $0.75/$3.75 per million tokens with $0.075 cache reads.
62
+
63
+ ### Changed
64
+
65
+ - The `openai-codex/gpt-5.6-sol` harness now advertises a 1,000,000-token context window; Terra and Luna retain their 372,000-token Codex metadata.
66
+ - The GLM reasoning-effort gate now matches GLM-5.2 **and later** GLM-5.x releases instead of hard-coding 5.2, so new minor versions inherit `supportsReasoningEffort` and the `max` thinking map without another code change. `glm-5`, `glm-5-turbo`, and `glm-5.1` remain excluded because they do not accept `reasoning_effort`.
67
+
68
+ ### Fixed
69
+
70
+ - NVIDIA NIM's `z-ai/glm-5.2` model metadata now enables `reasoning_effort`, so its generated `max` thinking level is transmitted instead of being silently omitted. Other NVIDIA models retain conservative compatibility defaults.
71
+ - OpenCode's `grok-build-0.1` no longer emits `compat.supportsReasoningEffort` after upstream moved the model from `openai-completions` to `openai-responses`. The field only exists on `OpenAICompletionsCompat`, so regeneration produced a registry that failed to typecheck; it is now applied only when the resolved api accepts it.
72
+ - Groq's Qwen3 `reasoning_effort` mapping follows the upstream `qwen/qwen3-32b` → `qwen/qwen3.6-27b` rename and now keys off the provider plus a `qwen3` id match, so the successor model keeps mapping to Groq's `none`/`default` values instead of inheriting the generic Qwen `high`/`max` tiers it does not accept.
73
+ - Grok 4.6 exposed no `thinkingLevelMap`, so its upstream `xhigh` effort tier was invisible to `getSupportedThinkingLevels()` and `/thinking xhigh` silently clamped down to `high` on every provider (xAI, OpenRouter, Vercel AI Gateway, GitHub Copilot, OpenCode). The generator now reads models.dev `reasoning_options` and maps `xhigh` only for Grok models that actually advertise it, so `grok-4.5` and `grok-4.3` stay capped at `high` instead of being handed an effort value they reject. A regression test covers both directions.
74
+ - Integration test fixtures no longer reference models removed upstream (`claude-opus-4-1-20250805`, `gemini-2.0-flash`, `github-copilot` `gemini-2.5-pro`, `groq` `qwen/qwen3-32b`, `zai` `glm-5.2-highspeed[1m]`), which previously broke `tsgo --noEmit` while remaining invisible to Vitest because those suites are credential-gated and skipped.
75
+
76
+ ## [0.95.2] - 2026-08-15
77
+
78
+ ### Changed
79
+
80
+ - GPT-5.6 MoA keeps Sol/Terra advisers tool-free but now gives Sol synthesis the active tool contract and tool history, forwarding synthesis tool calls through the normal agent loop.
81
+
82
+ ### Fixed
83
+
84
+ - Every `glm-5.2` model entry (zai, zai-coding-cn, opencode, opencode-go, openrouter, vercel-ai-gateway, fireworks, together, huggingface, nvidia, cloudflare workers-ai/ai-gateway) now carries an explicit `thinkingLevelMap` that exposes the `max` thinking level (`max: "max"`) instead of capping the `/thinking` and `Ctrl+T` selectors at `high`. Z.AI GLM-5.2 entries also re-enable `compat.supportsReasoningEffort` so the effort is transmitted. The prior fix only covered `opencode`/`opencode-go` and was lost on the next catalog regeneration; the map now lives in `generate-models.ts` so it survives regeneration, and a regression test covers every registry entry.
85
+
86
+ ## [0.95.1] - 2026-08-01
87
+
88
+ ## [0.95.0] - 2026-07-31
89
+
90
+ ### Fixed
91
+
92
+ - Anthropic requests now replace recognized PNG, JPEG, GIF, or WebP blocks above the 1,900 px safety limit with a descriptive text placeholder before sending, preventing repeated oversized-image failures without mutating the stored transcript.
93
+ - Anthropic streaming now emits Claude Code's official `anthropic-ratelimit-unified-5h-*` and `7d-*` response values through the existing non-blocking `StreamOptions.onRateLimit` observer.
94
+ - OpenAI Codex streaming now emits passive `x-codex-primary-*`, `x-codex-secondary-*`, and `codex.rate_limits` quota signals through the same non-blocking observer.
95
+ - OpenCode Zen (`opencode`) now includes `kimi-k3` with the current pricing and limits reported by models.dev, and provider handoff tests cover current Zen and Go model IDs.
96
+ - `cross-provider-handoff.test.ts` referenced deprecated/removed OpenCode Zen (`glm-4.7-free`, `minimax-m2.1-free`) and OpenCode Go (`kimi-k2.5`, `minimax-m2.5`) model ids that no longer resolve via `getModel()` (would throw once real OpenCode credentials are configured); replaced with current models (`glm-5.1`, `minimax-m2.7` for Zen; `kimi-k2.6`, `minimax-m2.7` for Go) and added explicit `kimi-k3` coverage for both tiers.
97
+ - OpenCode Zen/Go `glm-5.2` was missing `thinkingLevelMap`, so the `xhigh`/`max` thinking levels were invisible in `getSupportedThinkingLevels()` (top-tier levels are only exposed when a model explicitly maps them) even though models.dev reports `glm-5.2` supports `reasoning_options: {effort: ["high", "max"]}`. Added `thinkingLevelMap: { xhigh: "high", max: "max" }` to both `opencode` and `opencode-go` `glm-5.2` entries so `/thinking max` now reaches the API as `reasoning_effort: "max"` instead of clamping down to `high`.
98
+ - Provider errors reporting an insufficient balance are now classified as non-retryable quota failures instead of transient 429s.
99
+ - OpenAI Codex and Anthropic OAuth login now retain the signed-in email (plus Claude organization metadata) so clients can identify stored subscription accounts without exposing opaque account IDs.
100
+
101
+ ## [0.94.1] - 2026-07-27
102
+
103
+ ## [0.94.0] - 2026-07-27
104
+
105
+ ## [0.93.0] - 2026-07-26
106
+
107
+ ### Added
108
+
109
+ - Added `utils/retry.ts` (ported from upstream Pi 0.82.0): `retryAssistantCall`, `isRetryableAssistantError`, `RetryPolicy`, and `RetryCallbacks` with abortable backoff sleeps and quota/billing fail-fast classification, including DNS/transport (`getaddrinfo`, `ENOTFOUND`, `EAI_AGAIN`) and premature-stream patterns.
110
+ - Added `utils/provider-retry.ts` (ported from upstream Pi 0.82.0): `retryProviderRequest` reproduces the OpenAI/Anthropic SDK retry policy with abortable sleeps; anthropic, openai-responses, azure-openai-responses, openai-completions, and openrouter-images providers now call SDKs with `maxRetries: 0` and wrap requests so retries honor the caller AbortSignal.
111
+
112
+ ### Changed
113
+
114
+ - openai-codex-responses: provider-requested retry delays above `maxRetryDelayMs` now fail fast (`RetryDelayExceededError`) instead of being silently clamped, matching upstream Pi 0.82.0.
115
+
116
+ ## [0.92.0] - 2026-07-23
117
+
118
+ ### Added
119
+
120
+ - New OAuth provider integrations: Cursor, Devin, GitLab Duo, Google Antigravity, Google Gemini CLI, Kimi, OpenCode, Perplexity, xAI, and Zhipu coding-plan flows, with shared Google OAuth helpers.
121
+
122
+ ### Fixed
123
+
124
+ - The local-LLM (Ollama) E2E suite now honors `OMK_NO_LOCAL_LLM` (it previously checked the wrong `PI_NO_LOCAL_LLM` variable), so credential-less test runs skip local-provider tests instead of timing out.
125
+
126
+ ## [0.91.0] - 2026-07-21
127
+
128
+ ### Added
129
+
130
+ - Added two built-in subscription (OAuth) providers to `/login` → "Use a subscription": **Qwen (Qwen Code Subscription)** via the RFC 8628 device-authorization + PKCE flow (client id, endpoints and scopes mirror the open-source qwen-code CLI; the token `resource_url` is used to expose `qwen3-coder-plus`/`qwen3-coder-flash` through the `openai-completions` API) and **Grok (xAI OAuth Proxy)**, whose login verifies the local `grok-oauth-proxy` (`/health`) instead of running a competing xAI refresher and exposes `grok-4.5`/`grok-4.3` against the proxy base URL (`OMK_GROK_PROXY_BASE_URL` / `OMK_GROK_PROXY_API_KEY` overridable).
131
+
132
+ ### Fixed
133
+
134
+ - Corrected `kimi-coding` model IDs used by the provider integration tests to the registered `kimi-for-coding` identifier, restoring a clean `tsgo --noEmit` across the workspace.
135
+
136
+ ## [0.90.8] - 2026-07-13
137
+
138
+ ### Added
139
+
140
+ - Added tool-free `openai-codex/gpt-5.6-moa`, a virtual GPT-5.6 model that runs bounded Sol and Terra advisers concurrently and streams a Sol synthesis as one response while reusing the existing Codex OAuth credential.
141
+
142
+ ### Fixed
143
+
144
+ - Fixed GPT-5.6 Codex `max`/`ultra` requests returning HTTP 400 by mapping OMK's higher thinking tiers to the backend's highest accepted literal effort, `xhigh`.
145
+ - Fixed Codex SSE cancellation after response headers so caller aborts and bounded virtual-model streams terminate the upstream response body, including when response observers reject.
146
+ - Fixed Codex `response.failed` events dropping terminal usage before error propagation and normalized failed, cancelled, non-terminal, missing, or unknown completed statuses to error terminals, and rejected SSE EOF without a terminal event.
147
+ - Fixed tool-free Codex requests still serializing tool-choice fields and non-retryable protocol/API failures being retried.
148
+ - Fixed parent-session cleanup leaving role-isolated MoA WebSocket resources and fallback state alive.
149
+ - Fixed tool-free MoA requests replaying historical tool calls/results as transport-level function items by flattening them into inert context.
150
+
151
+ ## [0.90.7] - 2026-07-11
152
+
153
+ ### Added
154
+
155
+ - Added an `ultra` thinking level above `max` (maximum reasoning with automatic task delegation). It is only exposed when a model explicitly maps it — currently GPT-5.6 Sol/Terra on the `openai-codex` provider — and gracefully clamps down (`ultra` → `max`/`xhigh`/`high`) everywhere else, including budget-based Claude models on Bedrock and Google thinking APIs.
156
+ - Added the GPT-5.6 model family (released 2026-07-09): `gpt-5.6`, `gpt-5.6-sol`, `gpt-5.6-terra`, and `gpt-5.6-luna` for the `openai` and `azure-openai-responses` providers (1.05M context, 128k max output, reasoning efforts `none` through `max`), OpenRouter variants including `-pro`, Vercel AI Gateway variants, and `openai-codex` (ChatGPT OAuth) Sol/Terra/Luna entries with the 372k context window served by Codex. GPT-5.6 models expose the `max` thinking level above `xhigh` and map `off` to effort `none` on the OpenAI API.
157
+
158
+ ### Changed
159
+
160
+ - Regenerated the built-in model catalog from models.dev and OpenRouter: OpenRouter now includes latest tool-capable entries such as `x-ai/grok-4.5`, `openai/gpt-5.5`, `deepseek/deepseek-v4-*`, and AionLabs Aion 2.0/3.0; OpenCode Zen gains `grok-4.5` and `hy3-free`; OpenCode Go remains the built-in `opencode-go` provider (13 tool-capable models including `kimi-k2.6`, `minimax-m3`, `qwen3.7-*`, DeepSeek V4, GLM 5.1/5.2) with shared `OPENCODE_API_KEY` auth.
161
+
162
+ ### Fixed
163
+
164
+ - Fixed npm trusted-publishing identity after the GitHub repository rename by aligning package metadata with `dmae97/omk`.
165
+
166
+ ## [0.90.6] - 2026-07-09
167
+
168
+ ## [0.90.5] - 2026-07-07
169
+
170
+ ## [0.90.4] - 2026-07-04
171
+
172
+ ## [0.90.3] - 2026-07-02
173
+
174
+ ## [0.90.2] - 2026-07-02
175
+
176
+ ### Added
177
+
178
+ - Added a `max` thinking level above `xhigh`. Claude Opus 4.7 and 4.8 now expose both `xhigh` (effort `xhigh`) and `max` (effort `max`); models that only support the top effort keep their existing single level, and `max` gracefully clamps down on models without it.
179
+ - Added Claude Sonnet 5 (`claude-sonnet-5`) with adaptive thinking forced on, sampling parameters disabled, a 1M context window, and 128k max output tokens.
180
+ - Added Zyloo as a built-in OpenAI-compatible provider with static model metadata for Claude Opus 4.7, GPT-5.5, Gemini 3.5 Flash, DeepSeek V4 Pro, and Grok 4.3, plus dynamic model fetching when `ZYLOO_API_KEY` is set.
181
+
182
+ ## [0.90.1] - 2026-06-28
183
+
184
+ ### Changed
185
+
186
+ - Changed package metadata and lockstep release documentation to the standalone `omk-ai` package line used by OMK releases.
187
+
188
+ ## [0.80.8] - 2026-06-27
189
+
190
+ ### Breaking Changes
191
+
192
+ - Renamed the npm package from `@earendil-works/pi-ai` to `omk-ai`, renamed the CLI binary to `omk-ai`, and updated package metadata to the OMK repository.
193
+
194
+ ### Added
195
+
196
+ - Added OMK v0.80.8 release metadata for lockstep publishing with the CLI, TUI, and agent runtime packages.
197
+ - Added Ant Ling as a built-in OpenAI-compatible provider with Ling 2.6 and Ring 2.6 models.
198
+ - Added MiniMax-M3 model to the `minimax` and `minimax-cn` direct providers, and removed the hardcoded context-window override that was masking models.dev values ([#5313](https://github.com/earendil-works/pi/issues/5313)).
199
+ - Added NVIDIA NIM as a built-in OpenAI-compatible provider, exposing public NIM models that support tool use.
200
+
201
+ ### Fixed
202
+
203
+ - Fixed Amazon Bedrock requests to replace blank required user/tool-result text with a placeholder and skip blank replay text blocks ([#4975](https://github.com/earendil-works/pi/issues/4975)).
204
+ - Fixed OpenAI GPT-5.5 generated metadata to omit unsupported minimal thinking ([#5243](https://github.com/earendil-works/pi/issues/5243)).
205
+ - Fixed OpenRouter Kimi K2.6 thinking replay and preserved developer-role instructions for OpenRouter OpenAI and Anthropic models ([#5309](https://github.com/earendil-works/pi/issues/5309)).
206
+ - Fixed GitHub Copilot and OpenRouter test model references that became stale after model regeneration.
207
+
208
+ ## [0.78.0] - 2026-05-29
209
+
210
+ ### Breaking Changes
211
+
212
+ - Changed direct provider stream functions to require explicit `options.apiKey`; top-level `stream*`/`complete*` helpers still resolve built-in environment auth.
213
+
214
+ ### Added
215
+
216
+ - Added custom Amazon Bedrock request header support via `StreamOptions.headers`, excluding reserved AWS signing headers ([#5178](https://github.com/earendil-works/pi-mono/pull/5178) by [@stephanmck](https://github.com/stephanmck)).
217
+
218
+ ### Fixed
219
+
220
+ - Fixed OpenRouter Moonshot Kimi K2.6 requests to use `system` instead of unsupported `developer` messages ([#5159](https://github.com/earendil-works/pi-mono/issues/5159)).
221
+ - Fixed OpenCode Go Kimi K2.6 thinking requests to send `thinking` objects instead of invalid string values, and fixed OpenCode Zen Grok Build thinking requests to omit unsupported `reasoning_effort` ([#5169](https://github.com/earendil-works/pi-mono/issues/5169)).
222
+ - Fixed OpenAI Codex Responses SSE streams to abort response body reads after terminal events.
223
+ - Fixed OpenCode Kimi K2.6 generated metadata to use Anthropic-style thinking metadata instead of invalid reasoning-effort parameters.
224
+
225
+ ## [0.77.0] - 2026-05-28
226
+
227
+ ### Added
228
+
229
+ - Added OpenAI Codex subscription device-code login as a selectable headless alternative while keeping browser login as the default ([#4911](https://github.com/earendil-works/pi/pull/4911) by [@vegarsti](https://github.com/vegarsti)).
230
+ - Added Claude Opus 4.8 model metadata for Anthropic and updated Opus adaptive-thinking coverage to use it.
231
+
232
+ ### Fixed
233
+
234
+ - Fixed OpenRouter DeepSeek V4 `xhigh` reasoning metadata to preserve OpenRouter's native effort instead of sending DeepSeek's `max` effort ([#4801](https://github.com/earendil-works/pi/issues/4801)).
235
+ - Fixed OpenAI Codex Responses replay after switching from Anthropic extended-thinking sessions by generating unique fallback message item IDs for converted thinking/text blocks ([#5148](https://github.com/earendil-works/pi/issues/5148)).
236
+ - Fixed Anthropic-compatible replay for providers that return empty thinking signatures by adding an opt-in `allowEmptySignature` compatibility flag ([#4464](https://github.com/earendil-works/pi/issues/4464)).
237
+ - Fixed OpenAI and OpenRouter GPT-5.5 Pro thinking level metadata to expose only supported medium, high, and xhigh efforts.
238
+ - Fixed OpenCode Go Kimi K2.6 thinking-off requests to send `thinking: "none"` ([#5078](https://github.com/earendil-works/pi/issues/5078)).
239
+ - Fixed Xiaomi Token Plan model metadata to omit unsupported `mimo-v2-flash` variants ([#5075](https://github.com/earendil-works/pi/issues/5075)).
240
+
241
+ ## [0.76.0] - 2026-05-27
242
+
243
+ ### Fixed
244
+
245
+ - Fixed OpenAI Codex Responses cache-affinity headers to send `session-id` instead of proxy-incompatible `session_id` ([#4967](https://github.com/earendil-works/pi/issues/4967)).
246
+ - Fixed `openai-codex/gpt-5.3-codex-spark` generated metadata to use its 128k context window ([#4969](https://github.com/earendil-works/pi/issues/4969)).
247
+ - Fixed OpenRouter/Poolside context overflow detection for `maximum allowed input length` errors ([#4943](https://github.com/earendil-works/pi/issues/4943)).
248
+ - Fixed OpenAI Codex Responses WebSocket streams and SSE response-header waits to apply bounded timeouts instead of waiting indefinitely when no events arrive ([#4945](https://github.com/earendil-works/pi/issues/4945)).
249
+ - Fixed provider retry controls so OpenAI Codex Responses honors `maxRetries`, SDK retries default to `0`, and quota/billing 429s are not retried behind Pi's retry handling ([#4991](https://github.com/earendil-works/pi-mono/pull/4991) by [@mitsuhiko](https://github.com/mitsuhiko)).
250
+
251
+ ## [0.75.5] - 2026-05-23
252
+
253
+ ### Breaking Changes
254
+
255
+ - Changed `OAuthLoginCallbacks` to require `onDeviceCode` and `onSelect`, so OAuth providers can rely on pi supplying device-code and selection UI callbacks ([#4788](https://github.com/earendil-works/pi-mono/pull/4788) by [@vegarsti](https://github.com/vegarsti)).
256
+
257
+ ### Fixed
258
+
259
+ - Fixed custom Anthropic-compatible model aliases for adaptive-thinking Claude models by adding `compat.forceAdaptiveThinking` model metadata and moving built-in adaptive-thinking selection out of provider id substring checks ([#4797](https://github.com/earendil-works/pi-mono/pull/4797) by [@mbazso](https://github.com/mbazso)).
260
+ - Fixed GitHub Copilot OAuth login to rely on the required device-code callback without a runtime callback availability guard ([#4788](https://github.com/earendil-works/pi-mono/pull/4788) by [@vegarsti](https://github.com/vegarsti)).
261
+ - Fixed Amazon Bedrock provider loading under strict package managers by declaring its direct `@smithy/node-http-handler` dependency ([#4842](https://github.com/earendil-works/pi/issues/4842)).
262
+ - Fixed Amazon Bedrock Claude requests to send the model output token cap by default, matching Anthropic requests and avoiding Bedrock's 4096-token default truncation ([#4848](https://github.com/earendil-works/pi/issues/4848)).
263
+
264
+ ## [0.75.4] - 2026-05-20
265
+
266
+ ### Changed
267
+
268
+ - Changed source syntax to avoid TypeScript constructs that require JavaScript emit, keeping the package compatible with Node.js strip-only TypeScript checks.
269
+ - Removed the package-level development watch scripts now that the root TypeScript check validates strip-only-compatible sources.
270
+
271
+ ### Added
272
+
273
+ - Added first-class OAuth device-code callback metadata, shared polling support, and GitHub Copilot OAuth integration.
274
+
275
+ ### Fixed
276
+
277
+ - Fixed OpenAI-compatible `streamSimple()` requests to stop sending model-derived default output token caps, avoiding context-window reservation failures on servers such as vLLM while preserving explicit `maxTokens` and required Anthropic `max_tokens` handling ([#4675](https://github.com/earendil-works/pi/issues/4675)).
278
+ - Fixed OpenAI prompt cache keys to clamp session-derived values to the 64-character API limit across OpenAI Responses, Chat Completions, Codex Responses, and Azure OpenAI Responses ([#4720](https://github.com/earendil-works/pi/issues/4720)).
279
+
280
+ ## [0.75.3] - 2026-05-18
281
+
282
+ ## [0.75.2] - 2026-05-18
283
+
284
+ ### Fixed
285
+
286
+ - Fixed Xiaomi MiMo generated model metadata to replay assistant tool-call messages with `reasoning_content` for thinking-mode multi-turn requests ([#4678](https://github.com/earendil-works/pi/issues/4678)).
287
+
288
+ ## [0.75.1] - 2026-05-18
289
+
290
+ ### Fixed
291
+
292
+ - Fixed Anthropic-compatible API-key requests to ignore unrelated `ANTHROPIC_AUTH_TOKEN` environment values, avoiding invalid bearer credentials for providers such as Xiaomi MiMo ([#4342](https://github.com/earendil-works/pi/issues/4342)).
293
+ - Fixed Amazon Bedrock message conversion to skip unknown content blocks instead of failing the stream ([#4223](https://github.com/earendil-works/pi/issues/4223)).
294
+ - Fixed Azure OpenAI Responses and OpenAI Responses error formatting to prefix HTTP status codes onto `errorMessage`, so transient 5xx and 429 errors are correctly matched by the agent-level auto-retry classifier ([#4232](https://github.com/earendil-works/pi/issues/4232)).
295
+ - Fixed Xiaomi MiMo model metadata to use the OpenAI-compatible endpoints and `openai-completions` API, restoring multi-turn thinking/tool-call sessions ([#4505](https://github.com/earendil-works/pi/issues/4505)).
296
+ - Fixed OpenCode Go Kimi reasoning replay by normalizing streamed `reasoning` fields back to `reasoning_content` for OpenCode Go only ([#4251](https://github.com/earendil-works/pi/issues/4251)).
297
+
298
+ ### Removed
299
+
300
+ - Removed non-working OpenAI Codex fast model variants.
301
+
302
+ ## [0.75.0] - 2026-05-17
303
+
304
+ ### Breaking Changes
305
+
306
+ - Raised the minimum supported Node.js version to 22.19.0.
307
+
308
+ ### Fixed
309
+
310
+ - Fixed OpenAI Codex generated model metadata to use the current upstream model list ([#4603](https://github.com/earendil-works/pi-mono/pull/4603) by [@mattiacerutti](https://github.com/mattiacerutti)).
311
+ - Fixed GitHub Copilot GPT model thinking metadata to map unsupported minimal thinking to low ([#4622](https://github.com/earendil-works/pi-mono/pull/4622) by [@mattiacerutti](https://github.com/mattiacerutti)).
312
+ - Fixed `streamSimple()` defaults for models whose advertised output limit is effectively their full context window to avoid impossible default requests ([#4614](https://github.com/earendil-works/pi/issues/4614)).
313
+
314
+ ## [0.74.1] - 2026-05-16
315
+
316
+ ### Added
317
+
318
+ - Added image generation APIs, image model metadata, and built-in OpenRouter image generation support ([#3887](https://github.com/earendil-works/pi-mono/pull/3887) by [@cristinaponcela](https://github.com/cristinaponcela)).
319
+ - Added Together AI as a built-in OpenAI-compatible provider with generated model metadata and `TOGETHER_API_KEY` authentication ([#3624](https://github.com/earendil-works/pi-mono/pull/3624) by [@Nutlope](https://github.com/Nutlope)).
320
+
321
+ ### Fixed
322
+
323
+ - Fixed GitHub Copilot model availability to ignore generic `GH_TOKEN` and `GITHUB_TOKEN` environment variables, requiring OAuth login or `COPILOT_GITHUB_TOKEN` instead ([#4485](https://github.com/earendil-works/pi/issues/4485)).
324
+ - Fixed `openai-completions` streams to surface an error when the stream ends before any terminal `finish_reason`, so truncated responses can retry instead of being accepted as success ([#4345](https://github.com/earendil-works/pi/issues/4345)).
325
+ - Fixed Fireworks provider caching compatibility by adding session affinity headers and model metadata compat settings ([#4358](https://github.com/earendil-works/pi-mono/pull/4358) by [@yanirz](https://github.com/yanirz)).
326
+ - Fixed OpenAI Codex WebSocket transport to respect proxy environment variables under Bun ([#4354](https://github.com/earendil-works/pi-mono/pull/4354) by [@haoqixu](https://github.com/haoqixu)).
327
+ - Fixed OpenRouter cache usage normalization to preserve cached-token semantics without treating cached tokens as cache writes.
328
+ - Fixed Bedrock proxy handling to preserve `NO_PROXY` exclusions while using HTTP(S)-only proxy agents.
329
+ - Fixed compiled Bun binaries failing to start outside the repo when Bedrock proxy support tried to resolve `proxy-from-env` from external `node_modules` ([#4513](https://github.com/earendil-works/pi/issues/4513)).
330
+ - Fixed GitHub Copilot Claude test coverage to use the current Claude Sonnet 4.6 model ID.
331
+ - Fixed OpenAI Responses requests for models that support disabling reasoning to send `reasoning.effort: "none"` when thinking is off.
332
+ - Fixed Inception Mercury 2 tool calling on OpenRouter by marking `off` as unsupported in `thinkingLevelMap`, so the openai-completions provider omits the reasoning param instead of defaulting to `{reasoning:{effort:"none"}}` (which puts Mercury 2 in instant mode, disabling tool calls).
333
+ - Fixed OpenAI Codex SSE retries to honor `retry-after-ms` and `retry-after` headers before falling back to exponential backoff.
334
+ - Fixed context overflow detection for LiteLLM-wrapped OpenAI-compatible errors using `exceeds the model's maximum context length of ... tokens` wording ([#4563](https://github.com/earendil-works/pi/issues/4563)).
335
+ - Fixed `streamSimple()` defaults to respect model output limits above 32000 tokens instead of clamping provider requests to 32000 ([#4539](https://github.com/earendil-works/pi/issues/4539)).
336
+
337
+ ## [0.74.0] - 2026-05-07
338
+
339
+ ## [0.73.1] - 2026-05-07
340
+
341
+ ### Added
342
+
343
+ - Added OAuth login flow metadata so clients can present interactive provider choices during login ([#4190](https://github.com/earendil-works/pi-mono/pull/4190) by [@mitsuhiko](https://github.com/mitsuhiko)).
344
+
345
+ ### Fixed
346
+
347
+ - Fixed OpenAI Responses reasoning text streaming for LM Studio and other compatible providers that emit `response.reasoning_text.delta` events ([#4191](https://github.com/badlogic/pi-mono/pull/4191) by [@yaanfpv](https://github.com/yaanfpv)).
348
+ - Fixed OpenAI Codex OAuth refresh failures writing directly to stderr while the TUI is active ([#4141](https://github.com/badlogic/pi-mono/issues/4141)).
349
+ - Fixed OpenAI-compatible chat completion streams that interleave content and tool-call deltas in the same choice.
350
+ - Fixed the Kimi K2 P6 model alias to normalize to `kimi-for-coding` ([#4218](https://github.com/earendil-works/pi-mono/issues/4218)).
351
+ - Fixed OpenAI Codex Responses requests to send a non-empty system prompt ([#4184](https://github.com/earendil-works/pi-mono/issues/4184)).
352
+
353
+ ## [0.73.0] - 2026-05-04
354
+
355
+ ### Breaking Changes
356
+
357
+ - Switched the built-in `xiaomi` provider endpoint from Token Plan AMS (`https://token-plan-ams.xiaomimimo.com/anthropic`) to API billing (`https://api.xiaomimimo.com/anthropic`). `XIAOMI_API_KEY` now refers to the API billing key from [platform.xiaomimimo.com](https://platform.xiaomimimo.com). Users still on Token Plan must move to the appropriate `xiaomi-token-plan-*` provider and set the corresponding env var ([#4112](https://github.com/badlogic/pi-mono/pull/4112) by [@Phoen1xCode](https://github.com/Phoen1xCode)).
358
+
359
+ ### Added
360
+
361
+ - Added Xiaomi MiMo Token Plan regional providers with per-region env vars: `xiaomi-token-plan-cn` (`XIAOMI_TOKEN_PLAN_CN_API_KEY`), `xiaomi-token-plan-ams` (`XIAOMI_TOKEN_PLAN_AMS_API_KEY`), and `xiaomi-token-plan-sgp` (`XIAOMI_TOKEN_PLAN_SGP_API_KEY`) ([#4112](https://github.com/badlogic/pi-mono/pull/4112) by [@Phoen1xCode](https://github.com/Phoen1xCode)).
362
+ - Added `registerSessionResourceCleanup()` and `cleanupSessionResources()` so providers can register cleanup hooks for session-scoped resources.
363
+
364
+ ### Fixed
365
+
366
+ - Fixed generated OpenAI-compatible model metadata for Qwen 3.5/3.6 and MiniMax M2.7 to match models.dev and OpenCode Go ([#4110](https://github.com/badlogic/pi-mono/pull/4110) by [@jsynowiec](https://github.com/jsynowiec)).
367
+ - Fixed Bedrock Converse thinking effort mapping to preserve native `xhigh` for Claude Opus 4.7.
368
+ - Fixed OpenAI Codex Responses WebSocket transport to fall back to SSE when setup fails before streaming starts, and attach transport diagnostics to the assistant message ([#4133](https://github.com/badlogic/pi-mono/issues/4133)).
369
+
370
+ ## [0.72.1] - 2026-05-02
371
+
372
+ ## [0.72.0] - 2026-05-01
373
+
374
+ ### Breaking Changes
375
+
376
+ - Replaced `OpenAICompletionsCompat.reasoningEffortMap` with top-level `Model.thinkingLevelMap` for model-specific thinking controls ([#3208](https://github.com/badlogic/pi-mono/issues/3208)). Migration: move mappings from `model.compat.reasoningEffortMap` to `model.thinkingLevelMap`. See `packages/ai/README.md#custom-models` and `packages/coding-agent/docs/models.md#thinking-level-map`. Map values keep the same provider-specific string semantics, and `null` marks a pi thinking level unsupported. Example:
377
+
378
+ ```ts
379
+ // Before
380
+ compat: { reasoningEffortMap: { high: "high", xhigh: "max" } }
381
+
382
+ // After
383
+ thinkingLevelMap: { minimal: null, low: null, medium: null, high: "high", xhigh: "max" }
384
+ ```
385
+
386
+ - Removed `supportsXhigh()`. Migration: use `getSupportedThinkingLevels(model).includes("xhigh")` or `clampThinkingLevel(model, requestedLevel)` instead ([#3208](https://github.com/badlogic/pi-mono/issues/3208)).
387
+
388
+ ### Added
389
+
390
+ - Added Xiaomi MiMo Token Plan provider (Anthropic-compatible) with `XIAOMI_API_KEY` authentication ([#4005](https://github.com/badlogic/pi-mono/pull/4005) by [@Phoen1xCode](https://github.com/Phoen1xCode)).
391
+ - Added `Model.thinkingLevelMap`, `getSupportedThinkingLevels()`, and `clampThinkingLevel()` so model metadata can describe supported thinking levels and provider-specific level values ([#3208](https://github.com/badlogic/pi-mono/issues/3208)).
392
+
393
+ ### Fixed
394
+
395
+ - Fixed OpenAI Codex Responses `streamSimple()` to honor the configured transport instead of always using SSE, and made `auto` the default transport with cached WebSocket context when available ([#4083](https://github.com/badlogic/pi-mono/issues/4083)).
396
+ - Fixed Xiaomi MiMo model catalog to use the Token Plan Anthropic endpoint instead of the direct API ([#3912](https://github.com/badlogic/pi-mono/issues/3912)).
397
+
398
+ ## [0.71.1] - 2026-05-01
399
+
400
+ ### Added
401
+
402
+ - Added `websocket-cached` transport support for OpenAI Codex Responses used with ChatGPT subscription auth. This keeps the same WebSocket open for a session and, after the first request, sends only new conversation items instead of resending the full chat history when possible.
403
+
404
+ ## [0.71.0] - 2026-04-30
405
+
406
+ ### Breaking Changes
407
+
408
+ - Removed built-in Google Gemini CLI and Google Antigravity support, including provider registration, model metadata, OAuth, and package exports. Existing callers must switch to another supported provider.
409
+
410
+ ### Added
411
+
412
+ - Added Cloudflare AI Gateway as a built-in provider with OpenAI, Anthropic, and Workers AI gateway routing plus `CLOUDFLARE_API_KEY`/`CLOUDFLARE_ACCOUNT_ID`/`CLOUDFLARE_GATEWAY_ID` authentication ([#3856](https://github.com/badlogic/pi-mono/pull/3856) by [@mchenco](https://github.com/mchenco)).
413
+ - Added Moonshot AI as a built-in OpenAI-compatible provider with model catalog generation and `MOONSHOT_API_KEY` authentication.
414
+ - Added Mistral Medium 3.5 model metadata and reasoning-mode handling ([#4009](https://github.com/badlogic/pi-mono/pull/4009) by [@technocidal](https://github.com/technocidal)).
415
+ - Added `AssistantMessage.responseModel` on the openai-completions path: surfaces the concrete `chunk.model` when it differs from the requested id (e.g. OpenRouter `auto` -> `anthropic/...`) ([#3968](https://github.com/badlogic/pi-mono/pull/3968) by [@purrgrammer](https://github.com/purrgrammer)).
416
+
417
+ ### Fixed
418
+
419
+ - Fixed Google Vertex Gemini 3 tool call replay by no longer sending the non-Vertex `skip_thought_signature_validator` sentinel for unsigned tool calls ([#4032](https://github.com/badlogic/pi-mono/issues/4032)).
420
+ - Updated `@anthropic-ai/sdk` to `^0.91.1` to clear GHSA-p7fg-763f-g4gf audit findings ([#3992](https://github.com/badlogic/pi-mono/issues/3992)).
421
+ - Fixed DeepSeek V4 Flash `xhigh` thinking support so requests preserve `xhigh` and map it to DeepSeek's `max` reasoning effort ([#3944](https://github.com/badlogic/pi-mono/issues/3944)).
422
+ - Fixed Anthropic streams that end before `message_stop` to be treated as errors instead of successful partial responses ([#3936](https://github.com/badlogic/pi-mono/issues/3936)).
423
+ - Fixed generated OpenAI-compatible DeepSeek V4 models to carry the provider-specific reasoning effort mapping outside the direct DeepSeek provider ([#3940](https://github.com/badlogic/pi-mono/issues/3940)).
424
+ - Fixed DeepSeek V4 Flash and V4 Pro pricing metadata to match current official rates ([#3910](https://github.com/badlogic/pi-mono/issues/3910)).
425
+ - Fixed DeepSeek prompt cache hits to be tracked from `prompt_cache_hit_tokens` in OpenAI-compatible usage responses ([#3880](https://github.com/badlogic/pi-mono/issues/3880)).
426
+
427
+ ### Removed
428
+
429
+ - Removed built-in Google Gemini CLI and Google Antigravity provider, model, OAuth, and export support.
430
+
431
+ ## [0.70.6] - 2026-04-28
432
+
433
+ ### Added
434
+
435
+ - Added Cloudflare Workers AI as a built-in provider with model catalog generation, `CLOUDFLARE_API_KEY`/`CLOUDFLARE_ACCOUNT_ID` authentication, and OpenAI-compatible streaming support ([#3851](https://github.com/badlogic/pi-mono/pull/3851) by [@mchenco](https://github.com/mchenco)).
436
+
437
+ ### Fixed
438
+
439
+ - Removed generated Cloudflare Workers AI `User-Agent` model headers so attribution can be controlled by callers.
440
+ - Fixed Bedrock inference profile capability checks by normalizing profile ARNs to the underlying model name.
441
+
442
+ ## [0.70.5] - 2026-04-27
443
+
444
+ ## [0.70.4] - 2026-04-27
445
+
446
+ ## [0.70.3] - 2026-04-27
447
+
448
+ ### Added
449
+
450
+ - Added Azure Cognitive Services endpoint support for Azure OpenAI Responses base URLs ([#3799](https://github.com/badlogic/pi-mono/pull/3799) by [@marcbloech](https://github.com/marcbloech)).
451
+
452
+ ### Changed
453
+
454
+ - Changed OpenAI Codex Responses default text verbosity to `low` when no verbosity is specified.
455
+
456
+ ### Fixed
457
+
458
+ - Fixed API-key environment discovery to fall back to `/proc/self/environ` when Bun's sandbox leaves `process.env` empty ([#3801](https://github.com/badlogic/pi-mono/pull/3801) by [@mdsjip](https://github.com/mdsjip)).
459
+ - Fixed Bedrock prompt-caching and adaptive-thinking capability checks to use the model name when the model id is an inference profile ARN ([#3527](https://github.com/badlogic/pi-mono/pull/3527) by [@anirudhmarc](https://github.com/anirudhmarc)).
460
+ - Fixed Anthropic SSE parsing to ignore unknown proxy events such as OpenAI-style `done` terminators ([#3708](https://github.com/badlogic/pi-mono/issues/3708)).
461
+ - Fixed OpenAI-compatible prompt cache tests to cover proxies that explicitly disable long cache retention.
462
+ - Stopped sending `tools: []` on OpenAI-compatible, Anthropic, OpenAI Responses, OpenAI Codex Responses, and Azure OpenAI Responses requests when no tools are active (e.g. `pi --no-tools`). DashScope/Aliyun Qwen (OpenAI-compatible) rejects empty tools arrays with `"[] is too short - 'tools'"` (HTTP 400); the field is now omitted unless the conversation has tool history (the existing LiteLLM/Anthropic-proxy workaround) ([#3650](https://github.com/badlogic/pi-mono/pull/3650) by [@HQidea](https://github.com/HQidea)).
463
+ - Fixed `supportsXhigh()` to recognize DeepSeek V4 Pro, preserving `xhigh` reasoning requests so they map to DeepSeek's `max` effort ([#3662](https://github.com/badlogic/pi-mono/issues/3662))
464
+ - Fixed OpenAI-compatible DeepSeek V4 model replay to include empty `reasoning_content` on assistant messages when needed, preventing OpenRouter DeepSeek V4 sessions from failing after responses without reasoning deltas ([#3668](https://github.com/badlogic/pi-mono/issues/3668))
465
+
466
+ ## [0.70.2] - 2026-04-24
467
+
468
+ ### Fixed
469
+
470
+ - Fixed OpenAI/Azure/Anthropic provider request option forwarding to omit undefined `timeout`/`maxRetries`, avoiding SDK validation errors such as `timeout must be an integer` when provider controls are not set ([#3627](https://github.com/badlogic/pi-mono/issues/3627))
471
+
472
+ ## [0.70.1] - 2026-04-24
473
+
474
+ ### Added
475
+
476
+ - Added DeepSeek as a built-in OpenAI-compatible provider with V4 Flash and V4 Pro models and `DEEPSEEK_API_KEY` authentication.
477
+
478
+ ### Fixed
479
+
480
+ - Fixed DeepSeek V4 session replay 400 errors by adding `thinkingFormat: "deepseek"` (sends `thinking: { type }` + `reasoning_effort`), a `reasoningEffortMap`, and `requiresReasoningContentOnAssistantMessages` compat that injects empty `reasoning_content` on all replayed assistant messages when reasoning is enabled ([#3636](https://github.com/badlogic/pi-mono/issues/3636))
481
+ - Fixed GPT-5.5 generated context window metadata to use the observed 272k limit.
482
+ - Fixed provider request controls to expose `timeoutMs` and `maxRetries` in stream options and forward them through OpenAI/Azure/Anthropic request options, preventing unconfigurable SDK timeout/retry defaults on long-running local inference requests ([#3627](https://github.com/badlogic/pi-mono/issues/3627))
483
+
484
+ ## [0.70.0] - 2026-04-23
485
+
486
+ ### Added
487
+
488
+ - Added GPT-5.5 to OpenAI Codex model generation.
489
+ - Added `findEnvKeys()` so callers can identify configured provider API-key environment variables without exposing credential values while preserving `getEnvApiKey()` as the credential-value API.
490
+
491
+ ### Fixed
492
+
493
+ - Fixed `google-vertex` to forward custom `model.baseUrl` values to `@google/genai`, enabling Vertex proxy and gateway endpoints ([#3619](https://github.com/badlogic/pi-mono/issues/3619))
494
+ - Fixed OpenAI-compatible completion usage parsing to stop double-counting reasoning tokens already included in `completion_tokens` ([#3581](https://github.com/badlogic/pi-mono/issues/3581))
495
+ - Fixed long cache retention compatibility by adding `compat.supportsLongCacheRetention`, allowing Anthropic Messages and OpenAI-compatible proxies to explicitly disable long-retention fields while enabling long retention by default when requested ([#3543](https://github.com/badlogic/pi-mono/issues/3543))
496
+ - Fixed `openai-responses` compatibility by adding `compat.sendSessionIdHeader: false`, allowing strict OpenAI-compatible proxies to omit the underscore-containing `session_id` header while still sending other session-affinity headers ([#3579](https://github.com/badlogic/pi-mono/issues/3579))
497
+ - Fixed `anthropic-messages` tool streaming compatibility by adding `compat.supportsEagerToolInputStreaming`, allowing Anthropic-compatible providers to omit per-tool `eager_input_streaming` and use the legacy fine-grained tool streaming beta header instead ([#3575](https://github.com/badlogic/pi-mono/issues/3575))
498
+ - Fixed `supportsXhigh()` to recognize `openai-codex` `gpt-5.5`, preserving `xhigh` reasoning requests instead of clamping them to `high`.
499
+ - Fixed `openai-completions` streamed tool-call assembly to coalesce deltas by stable tool index when OpenAI-compatible gateways mutate tool call IDs mid-stream, preventing malformed Kimi K2.6/OpenCode tool streams from splitting one call into multiple bogus tool calls ([#3576](https://github.com/badlogic/pi-mono/issues/3576))
500
+ - Fixed `packages/ai` E2E coverage to use currently supported OpenAI Responses and OpenAI Codex models, and updated the Bedrock adaptive-thinking payload expectation to match the current `display: "summarized"` shape.
501
+ - Fixed built-in `kimi-coding` model generation to attach `User-Agent: KimiCLI/1.5` to all generated Kimi models, overriding the Anthropic SDK default UA so direct Kimi Coding requests use the provider's expected client identity ([#3586](https://github.com/badlogic/pi-mono/issues/3586))
502
+ - Fixed GPT-5.5 Codex capability handling to clamp unsupported minimal reasoning to `low` and apply the model's 2.5x priority service-tier pricing multiplier ([#3618](https://github.com/badlogic/pi-mono/pull/3618) by [@markusylisiurunen](https://github.com/markusylisiurunen))
503
+
504
+ ## [0.69.0] - 2026-04-22
505
+
506
+ ### Breaking Changes
507
+
508
+ - Migrated TypeBox support from `@sinclair/typebox` 0.34.x plus AJV to `typebox` 1.x plus TypeBox's built-in validator and value-conversion APIs. Tool argument validation now runs in eval-restricted JavaScript runtimes such as Cloudflare Workers and other environments that disallow `eval` / `new Function`, instead of being silently skipped. Migration: install and import from `typebox` instead of `@sinclair/typebox`, and retest any coercion-sensitive tool paths that serialize schemas to plain JSON because those now go through the new TypeBox-based validation and coercion path rather than AJV ([#3112](https://github.com/badlogic/pi-mono/issues/3112))
509
+
510
+ ### Fixed
511
+
512
+ - Fixed `google-gemini-cli` built-in model discovery to include `gemini-3.1-flash-lite-preview`, so Cloud Code Assist model lists expose it without requiring manual `--model` fallback selection ([#3545](https://github.com/badlogic/pi-mono/issues/3545))
513
+ - Fixed `transformMessages()` to synthesize missing trailing tool results for transcripts that end with unresolved assistant tool calls during direct low-level history replay ([#3555](https://github.com/badlogic/pi-mono/issues/3555))
514
+
515
+ ## [0.68.1] - 2026-04-22
516
+
517
+ ### Added
518
+
519
+ - Added Fireworks provider support via Fireworks' Anthropic-compatible Messages API, including built-in models sourced from models.dev and `FIREWORKS_API_KEY` auth ([#3519](https://github.com/badlogic/pi-mono/issues/3519))
520
+
521
+ ### Fixed
522
+
523
+ - Hardened Anthropic streaming against malformed tool-call JSON by owning SSE parsing with defensive JSON repair, replacing the deprecated `fine-grained-tool-streaming` beta header with per-tool `eager_input_streaming`, and updating stale test model references ([#3175](https://github.com/badlogic/pi-mono/issues/3175))
524
+ - Fixed Bedrock runtime endpoint resolution to stop pinning built-in regional endpoints over `AWS_REGION` / `AWS_PROFILE`, restoring `us.*` and `eu.*` inference profile support after v0.68.0 while preserving custom VPC/proxy endpoint overrides ([#3481](https://github.com/badlogic/pi-mono/issues/3481), [#3485](https://github.com/badlogic/pi-mono/issues/3485), [#3486](https://github.com/badlogic/pi-mono/issues/3486), [#3487](https://github.com/badlogic/pi-mono/issues/3487), [#3488](https://github.com/badlogic/pi-mono/issues/3488))
525
+
526
+ ## [0.68.0] - 2026-04-20
527
+
528
+ ### Added
529
+
530
+ - Added `PI_OAUTH_CALLBACK_HOST` support for built-in Anthropic, Gemini CLI, Google Antigravity, and OpenAI Codex OAuth flows, allowing local callback servers to bind to a custom interface instead of hardcoded `127.0.0.1` ([#3409](https://github.com/badlogic/pi-mono/pull/3409) by [@Michaelliv](https://github.com/Michaelliv))
531
+
532
+ ### Changed
533
+
534
+ - Changed Bedrock Converse requests to omit `inferenceConfig.maxTokens` when model token limits are unknown and to omit `temperature` when unset, letting Bedrock use model defaults and avoid unnecessary TPM quota reservation ([#3400](https://github.com/badlogic/pi-mono/pull/3400) by [@wirjo](https://github.com/wirjo))
535
+
536
+ ### Fixed
537
+
538
+ - Fixed `openai-completions` `compat.requiresThinkingAsText` assistant replay to preserve text-part serialization and avoid same-model crashes when prior assistant messages contain both thinking and text ([#3387](https://github.com/badlogic/pi-mono/issues/3387))
539
+ - Fixed Cloud Code Assist tool schemas to strip JSON Schema meta-declaration keys such as `$schema`, `$defs`, and `definitions` before sending OpenAPI `parameters`, avoiding provider validation failures for tool-enabled requests ([#3412](https://github.com/badlogic/pi-mono/pull/3412) by [@vladlearns](https://github.com/vladlearns))
540
+ - Fixed non-vision model requests to replace user and tool-result image blocks with explicit text placeholders instead of silently dropping them during provider payload conversion ([#3429](https://github.com/badlogic/pi-mono/issues/3429))
541
+ - Fixed direct OpenAI Chat Completions requests to map `sessionId` and `cacheRetention` to OpenAI prompt caching fields, sending `prompt_cache_key` when caching is enabled and `prompt_cache_retention: "24h"` for direct `api.openai.com` requests with long retention ([#3426](https://github.com/badlogic/pi-mono/issues/3426))
542
+ - Fixed OpenAI-compatible Chat Completions requests to optionally send aligned `session_id`, `x-client-request-id`, and `x-session-affinity` session-affinity headers from `sessionId` via `compat.sendSessionAffinityHeaders`, enabling cache-affinity routing for backends such as Fireworks ([#3430](https://github.com/badlogic/pi-mono/issues/3430))
543
+ - Fixed direct Bedrock runtime client construction to pass `model.baseUrl` through as the SDK `endpoint`, restoring support for custom Bedrock endpoints such as VPC or proxy routes ([#3402](https://github.com/badlogic/pi-mono/pull/3402) by [@wirjo](https://github.com/wirjo))
544
+ - Fixed OpenAI-compatible Chat Completions Anthropic-style prompt caching to apply `cache_control` markers to the system prompt, last tool definition, and last user/assistant text content via `compat.cacheControlFormat`, and enabled that compat for OpenCode/OpenCode Go Qwen 3.5/3.6 Plus models so prompt caching works there too ([#3392](https://github.com/badlogic/pi-mono/issues/3392))
545
+
546
+ ## [0.67.68] - 2026-04-17
547
+
548
+ ### Fixed
549
+
550
+ - Fixed Bedrock bearer-token authentication to use the SDK's native token auth path and omit Claude `thinking.display` for GovCloud targets, avoiding duplicate `Authorization` headers and GovCloud Converse validation errors ([#3359](https://github.com/badlogic/pi-mono/issues/3359))
551
+ - Fixed direct Mistral tool definitions to strip TypeBox symbol metadata before passing schemas to the SDK, restoring tool calls after the SDK's stricter outbound validation ([#3361](https://github.com/badlogic/pi-mono/issues/3361))
552
+
553
+ ## [0.67.67] - 2026-04-17
554
+
555
+ ### Added
556
+
557
+ - Added Bedrock Converse bearer-token authentication via `AWS_BEARER_TOKEN_BEDROCK`, enabling API-key style access without SigV4 credentials ([#3125](https://github.com/badlogic/pi-mono/pull/3125) by [@wirjo](https://github.com/wirjo))
558
+
559
+ ### Fixed
560
+
561
+ - Fixed Anthropic and Bedrock adaptive-thinking payload tests to expect the default `display: "summarized"` field when reasoning is enabled.
562
+ - Fixed Mistral Small 4 reasoning requests to use `reasoning_effort` instead of `prompt_mode`, restoring default thinking support for `mistral-small-2603` and `mistral-small-latest` ([#3338](https://github.com/badlogic/pi-mono/issues/3338))
563
+ - Fixed `qwen-chat-template` OpenAI-compatible requests to set `chat_template_kwargs.preserve_thinking: true`, preserving prior Qwen thinking across turns so multi-turn tool calls keep their arguments instead of degrading to empty `{}` payloads ([#3325](https://github.com/badlogic/pi-mono/issues/3325))
564
+ - Fixed OpenAI Codex service-tier accounting to trust the explicitly requested tier when the API echoes the default tier in responses, keeping downstream usage costs aligned with the caller-selected tier ([#3307](https://github.com/badlogic/pi-mono/pull/3307) by [@markusylisiurunen](https://github.com/markusylisiurunen))
565
+
566
+ ## [0.67.6] - 2026-04-16
567
+
568
+ ### Added
569
+
570
+ - Added `onResponse` to `StreamOptions` so callers can inspect provider HTTP status and headers after each response arrives and before the response stream is consumed ([#3128](https://github.com/badlogic/pi-mono/issues/3128))
571
+ - Added `thinkingDisplay` (`"summarized" | "omitted"`) to `AnthropicOptions` and `BedrockOptions`, wiring it through to the Anthropic/Bedrock `thinking` config. Defaults to `"summarized"` so Claude Opus 4.7 and Mythos Preview keep returning thinking text; set it to `"omitted"` to skip thinking streaming for faster time-to-first-text-token.
572
+
573
+ ### Fixed
574
+
575
+ - Fixed OpenAI Responses prompt caching for non-`api.openai.com` base URLs (OpenAI-compatible proxies such as litellm, theclawbay) by sending the `session_id` and `x-client-request-id` cache-affinity headers unconditionally when a `sessionId` is provided, matching the official Codex CLI behavior ([#3264](https://github.com/badlogic/pi-mono/pull/3264) by [@vegarsti](https://github.com/vegarsti))
576
+
577
+ ## [0.67.5] - 2026-04-16
578
+
579
+ ### Fixed
580
+
581
+ - Fixed Opus 4.7 adaptive thinking configuration across Anthropic and Bedrock providers by recognizing Opus 4.7 adaptive-thinking support and mapping `xhigh` reasoning to provider-supported effort values ([#3286](https://github.com/badlogic/pi-mono/pull/3286) by [@markusylisiurunen](https://github.com/markusylisiurunen))
582
+
583
+ ## [0.67.4] - 2026-04-16
584
+
585
+ ### Changed
586
+
587
+ - Added `claude-opus-4-7` model for Anthropic, OpenRouter.
588
+ - Changed Anthropic prompt caching to add a `cache_control` breakpoint on the last tool definition, so tool schemas can be cached independently from transcript updates while preserving existing cache retention behavior ([#3260](https://github.com/badlogic/pi-mono/issues/3260))
589
+ - Changed Kimi Coding model generation to normalize deprecated `k2p5` to `kimi-for-coding` from models.dev data and removed the old static fallback model list ([#3242](https://github.com/badlogic/pi-mono/issues/3242))
590
+
591
+ ## [0.67.3] - 2026-04-15
592
+
593
+ ### Fixed
594
+
595
+ - Fixed `google-vertex` API key resolution to treat `gcp-vertex-credentials` as an Application Default Credentials marker instead of a literal API key, so marker-based setups correctly fall back to ADC ([#3221](https://github.com/badlogic/pi-mono/pull/3221) by [@deepkilo](https://github.com/deepkilo))
596
+
597
+ ## [0.67.2] - 2026-04-14
598
+
599
+ ### Fixed
600
+
601
+ - Fixed direct OpenAI Responses requests to send aligned `prompt_cache_key`, `session_id`, and `x-client-request-id` values when `sessionId` is provided, improving prompt cache affinity for append-only sessions ([#3018](https://github.com/badlogic/pi-mono/pull/3018) by [@steipete](https://github.com/steipete))
602
+ - Fixed streaming-only `partialJson` scratch buffers leaking into persisted OpenAI Responses tool calls, which could corrupt follow-up payloads on resumed conversations.
603
+
604
+ ## [0.67.1] - 2026-04-13
605
+
606
+ ## [0.67.0] - 2026-04-13
607
+
608
+ ### Added
609
+
610
+ - Added full `OpenRouterRouting` field support, including fallbacks, parameter requirements, data collection, ZDR, ignore lists, quantizations, provider sorting, max price, and preferred throughput and latency constraints ([#2904](https://github.com/badlogic/pi-mono/pull/2904) by [@zmberber](https://github.com/zmberber))
611
+
612
+ ### Fixed
613
+
614
+ - Bumped default Antigravity User-Agent version to `1.21.9` ([#2901](https://github.com/badlogic/pi-mono/pull/2901) by [@aadishv](https://github.com/aadishv))
615
+ - Fixed thinking levels for Gemma 4 models to use `thinkingLevel` and map Pi reasoning levels to the model's supported thinking levels ([#2903](https://github.com/badlogic/pi-mono/pull/2903) by [@aadishv](https://github.com/aadishv))
616
+ - Fixed Gemini 2.5 Flash Lite minimal thinking budget to use the model's supported 512-token minimum instead of the regular Flash 128-token minimum, avoiding invalid thinking budget errors ([#2861](https://github.com/badlogic/pi-mono/pull/2861) by [@JasonOA888](https://github.com/JasonOA888))
617
+ - Fixed OpenAI Codex Responses requests to forward configured `serviceTier` values, restoring service-tier selection for Codex sessions ([#2996](https://github.com/badlogic/pi-mono/pull/2996) by [@markusylisiurunen](https://github.com/markusylisiurunen))
618
+
619
+ ## [0.66.1] - 2026-04-08
620
+
621
+ ## [0.66.0] - 2026-04-08
622
+
623
+ ### Fixed
624
+
625
+ - Fixed bare `readline` import to use `node:readline` prefix for Deno compatibility ([#2885](https://github.com/badlogic/pi-mono/issues/2885) by [@milosv-vtool](https://github.com/milosv-vtool))
626
+
627
+ ## [0.65.2] - 2026-04-06
628
+
629
+ ## [0.65.1] - 2026-04-05
630
+
631
+ ### Fixed
632
+
633
+ - Fixed OpenAI-compatible completions streaming usage to preserve `prompt_tokens_details.cache_write_tokens` and normalize OpenRouter `cached_tokens` to previous-request cache hits only, preventing cache read/write double counting in `usage` and cost calculation ([#2802](https://github.com/badlogic/pi-mono/issues/2802))
634
+
635
+ ## [0.65.0] - 2026-04-03
636
+
637
+ ### Added
638
+
639
+ - Added tool streaming support for newer Z.ai models ([#2732](https://github.com/badlogic/pi-mono/pull/2732) by [@kaofelix](https://github.com/kaofelix))
640
+
641
+ ### Fixed
642
+
643
+ - Fixed Anthropic context overflow detection to recognize HTTP 413 `request_too_large` errors, so callers can trigger compaction and retry instead of getting stuck on repeated oversized-image requests ([#2734](https://github.com/badlogic/pi-mono/issues/2734))
644
+ - Fixed OpenAI Responses tool-call streaming to emit a `toolcall_delta` when function call arguments arrive only in `response.function_call_arguments.done`, and to emit only the missing suffix when `.done` extends earlier streamed arguments ([#2745](https://github.com/badlogic/pi-mono/issues/2745))
645
+ - Fixed Bedrock throttling errors being misidentified as context overflow, causing unnecessary compaction instead of retry ([#2699](https://github.com/badlogic/pi-mono/pull/2699) by [@xu0o0](https://github.com/xu0o0))
646
+
647
+ ## [0.64.0] - 2026-03-29
648
+
649
+ ### Added
650
+
651
+ - Added opt-in faux provider helpers for deterministic tests and scripted demos: `registerFauxProvider()`, `fauxAssistantMessage()`, `fauxText()`, `fauxThinking()`, and `fauxToolCall()`.
652
+
653
+ ## [0.63.2] - 2026-03-29
654
+
655
+ ## [0.63.1] - 2026-03-27
656
+
657
+ ### Added
658
+
659
+ - Added `gemini-3.1-pro-preview-customtools` model support for the `google-vertex` provider ([#2610](https://github.com/badlogic/pi-mono/pull/2610) by [@gordonhwc](https://github.com/gordonhwc))
660
+
661
+ ### Fixed
662
+
663
+ - Fixed context overflow detection to recognize Ollama error responses like `prompt too long; exceeded max context length ...`, so callers can trigger compaction and retry instead of surfacing the raw overflow error ([#2626](https://github.com/badlogic/pi-mono/issues/2626))
664
+
665
+ ## [0.63.0] - 2026-03-27
666
+
667
+ ### Breaking Changes
668
+
669
+ - Removed deprecated direct `minimax` and `minimax-cn` model IDs, keeping only `MiniMax-M2.7` and `MiniMax-M2.7-highspeed`. Update pinned model IDs to one of those supported direct MiniMax models, or use another provider route that still exposes the older IDs ([#2596](https://github.com/badlogic/pi-mono/pull/2596) by [@liyuan97](https://github.com/liyuan97))
670
+
671
+ ### Fixed
672
+
673
+ - Fixed GitHub Copilot OpenAI Responses requests to omit the `reasoning` field entirely when no reasoning effort is requested, avoiding `400` errors from Copilot `gpt-5-mini` rejecting `reasoning: { effort: "none" }` during internal summary calls ([#2567](https://github.com/badlogic/pi-mono/issues/2567))
674
+ - Fixed Google and Vertex cost calculation to subtract cached prompt tokens from billable input tokens instead of double-counting them when providers report `cachedContentTokenCount` ([#2588](https://github.com/badlogic/pi-mono/pull/2588) by [@sparkleMing](https://github.com/sparkleMing))
675
+
676
+ ## [0.62.0] - 2026-03-23
677
+
678
+ ### Added
679
+
680
+ - Added `requestMetadata` option to `BedrockOptions` for AWS cost allocation tagging; key-value pairs are forwarded to the Bedrock Converse API `requestMetadata` field and appear in AWS Cost Explorer split cost allocation data ([#2511](https://github.com/badlogic/pi-mono/pull/2511) by [@wjonaskr](https://github.com/wjonaskr))
681
+ - Exported `BedrockOptions` type from the package root entry point, consistent with other provider option types.
682
+
683
+ ### Fixed
684
+
685
+ - Fixed OpenAI Responses replay for foreign tool-call item IDs by hashing foreign `function_call.id` values into bounded `fc_<hash>` IDs instead of preserving backend-specific normalized shapes that OpenAI Codex rejects.
686
+ - Fixed Anthropic thinking disable handling to send `thinking: { type: "disabled" }` for reasoning-capable models when thinking is explicitly off, and added payload and env-gated end-to-end coverage for the Anthropic provider ([#2022](https://github.com/badlogic/pi-mono/issues/2022))
687
+ - Fixed explicit thinking disable handling across Google, Google Vertex, Gemini CLI, OpenAI Responses, Azure OpenAI Responses, and OpenRouter-backed OpenAI-compatible completions. Gemini 3 models now fall back to the lowest supported thinking level when full disable is not supported, and OpenAI/OpenRouter reasoning models now send explicit `none` effort instead of relying on provider defaults ([#2490](https://github.com/badlogic/pi-mono/issues/2490))
688
+ - Fixed OpenAI-compatible completions streams to ignore null chunks instead of crashing ([#2466](https://github.com/badlogic/pi-mono/pull/2466) by [@Cheng-Zi-Qing](https://github.com/Cheng-Zi-Qing))
689
+
690
+ ## [0.61.1] - 2026-03-20
691
+
692
+ ### Changed
693
+
694
+ - Changed MiniMax model metadata to add missing `MiniMax-M2.1-highspeed` entries for the `minimax` and `minimax-cn` providers and normalize MiniMax Anthropic-compatible context limits to the provider's supported model set ([#2445](https://github.com/badlogic/pi-mono/pull/2445) by [@1500256797](https://github.com/1500256797))
695
+
696
+ ## [0.61.0] - 2026-03-20
697
+
698
+ ### Added
699
+
700
+ - Added `gpt-5.4-mini` model support for the `openai-codex` provider with Codex pricing metadata and unit coverage ([#2334](https://github.com/badlogic/pi-mono/pull/2334) by [@justram](https://github.com/justram))
701
+
702
+ ### Fixed
703
+
704
+ - Fixed `validateToolArguments()` to fall back gracefully when AJV schema compilation is blocked in restricted runtimes such as Cloudflare Workers, allowing tool execution to proceed without schema validation ([#2395](https://github.com/badlogic/pi-mono/issues/2395))
705
+ - Fixed `google-vertex` API key resolution to ignore placeholder auth markers like `<authenticated>` and fall back to ADC instead of sending them as literal API keys ([#2335](https://github.com/badlogic/pi-mono/issues/2335))
706
+ - Fixed OpenRouter reasoning requests to use the provider's nested `reasoning.effort` payload instead of OpenAI's `reasoning_effort`, restoring thinking level support for OpenRouter models ([#2298](https://github.com/badlogic/pi-mono/pull/2298) by [@PriNova](https://github.com/PriNova))
707
+ - Fixed Bedrock prompt caching for application inference profiles by allowing cache points to be forced with `AWS_BEDROCK_FORCE_CACHE=1` when the profile ARN does not expose the underlying Claude model name ([#2346](https://github.com/badlogic/pi-mono/pull/2346) by [@haoqixu](https://github.com/haoqixu))
708
+
709
+ ## [0.60.0] - 2026-03-18
710
+
711
+ ### Fixed
712
+
713
+ - Fixed Gemini 3 and Antigravity image tool results to stay inline as multimodal tool responses instead of being rerouted through separate follow-up messages ([#2052](https://github.com/badlogic/pi-mono/issues/2052))
714
+ - Fixed Bedrock Claude 4.6 model metadata to use the correct 200K context window instead of 1M ([#2305](https://github.com/badlogic/pi-mono/issues/2305))
715
+ - Fixed lazy built-in provider registration so compiled Bun binaries can still load providers on first use without eagerly bundling provider SDKs ([#2314](https://github.com/badlogic/pi-mono/issues/2314))
716
+ - Fixed built-in OAuth callback flows to share aligned callback handling across Anthropic, Gemini CLI, Antigravity, and OpenAI Codex, and fixed OpenAI Codex login to resolve immediately after callback completion ([#2316](https://github.com/badlogic/pi-mono/issues/2316))
717
+ - Fixed OpenAI-compatible z.ai `network_error` responses to surface as errors so callers can retry them instead of treating them as successful assistant messages ([#2313](https://github.com/badlogic/pi-mono/issues/2313))
718
+ - Fixed OpenAI Responses replay to normalize oversized resumed tool call IDs before sending them back to Codex and other Responses-compatible targets ([#2328](https://github.com/badlogic/pi-mono/issues/2328))
719
+
720
+ ## [0.59.0] - 2026-03-17
721
+
722
+ ### Added
723
+
724
+ - Added `client` injection support to `AnthropicOptions`, allowing callers to provide a pre-built Anthropic-compatible client instead of constructing one internally.
725
+
726
+ ### Changed
727
+
728
+ - Lazy-load built-in provider modules and root provider wrappers so importing `@mariozechner/pi-ai` no longer eagerly loads provider SDKs, significantly reducing base startup cost without changing dependency installation footprint ([#2297](https://github.com/badlogic/pi-mono/issues/2297))
729
+
730
+ ### Fixed
731
+
732
+ - Added provider-specific `responseId` support on `AssistantMessage` for providers that expose upstream response or message identifiers, including Anthropic, OpenAI, Google, Gemini CLI, and Mistral, and added end-to-end coverage for supported OAuth and API key providers ([#2245](https://github.com/badlogic/pi-mono/issues/2245))
733
+ - Fixed Claude 4.6 context window overrides in generated model metadata so build-time catalogs reflect the intended values ([#2286](https://github.com/badlogic/pi-mono/issues/2286))
734
+
735
+ ## [0.58.4] - 2026-03-16
736
+
737
+ ## [0.58.3] - 2026-03-15
738
+
739
+ ## [0.58.2] - 2026-03-15
740
+
741
+ ### Fixed
742
+
743
+ - Fixed Anthropic OAuth manual login and token refresh by using the localhost callback URI for pasted redirect/code flows and omitting `scope` from refresh-token requests ([#2169](https://github.com/badlogic/pi-mono/issues/2169))
744
+
745
+ ## [0.58.1] - 2026-03-14
746
+
747
+ ### Fixed
748
+
749
+ - Fixed OpenAI Codex websocket protocol to include required headers and properly terminate SSE streams on connection close ([#1961](https://github.com/badlogic/pi-mono/issues/1961))
750
+ - Fixed Bedrock prompt caching being enabled for non-Claude models, causing API errors ([#2053](https://github.com/badlogic/pi-mono/issues/2053))
751
+ - Fixed Qwen models via OpenAI-compatible providers by adding `qwen-chat-template` compat mode that uses Qwen's native chat template format ([#2020](https://github.com/badlogic/pi-mono/issues/2020))
752
+ - Fixed Bedrock unsigned thinking replay to handle edge cases with empty or malformed thinking blocks ([#2063](https://github.com/badlogic/pi-mono/issues/2063))
753
+ - Fixed xhigh reasoning effort detection for Claude Opus 4.6 to match by model ID instead of requiring explicit capability flag ([#2040](https://github.com/badlogic/pi-mono/issues/2040))
754
+ - Handle `finish_reason: "end"` from Ollama/LM Studio by mapping it to `"stop"` instead of throwing ([#2142](https://github.com/badlogic/pi-mono/issues/2142))
755
+
756
+ ## [0.58.0] - 2026-03-14
757
+
758
+ ### Added
759
+
760
+ - Added `GOOGLE_CLOUD_API_KEY` environment variable support for the `google-vertex` provider as an alternative to Application Default Credentials ([#1976](https://github.com/badlogic/pi-mono/pull/1976) by [@gordonhwc](https://github.com/gordonhwc))
761
+
762
+ ### Changed
763
+
764
+ - Raised Claude Opus 4.6, Sonnet 4.6, and related Bedrock model context windows from 200K to 1M tokens ([#2135](https://github.com/badlogic/pi-mono/pull/2135) by [@mitsuhiko](https://github.com/mitsuhiko))
765
+
766
+ ### Fixed
767
+
768
+ - Fixed GitHub Copilot device-code login polling to respect OAuth slow-down intervals, wait before the first token poll, and include a clearer clock-drift hint in WSL/VM environments when repeated slow-downs lead to timeout.
769
+ - Fixed usage statistics not being captured for OpenAI-compatible providers that return usage in `choice.usage` instead of the standard `chunk.usage` (e.g., Moonshot/Kimi) ([#2017](https://github.com/badlogic/pi-mono/issues/2017))
770
+ - Fixed tool result images not being sent in `function_call_output` items for OpenAI Responses API providers, causing image data to be silently dropped in tool results ([#2104](https://github.com/badlogic/pi-mono/issues/2104))
771
+ - Fixed assistant content being sent as structured content blocks instead of plain strings in the `openai-completions` provider, causing errors with some OpenAI-compatible backends ([#2008](https://github.com/badlogic/pi-mono/pull/2008) by [@geraldoaax](https://github.com/geraldoaax))
772
+ - Fixed error details in OpenAI Responses `response.failed` handler to include status code, error code, and message instead of a generic failure ([#1956](https://github.com/badlogic/pi-mono/pull/1956) by [@drewburr](https://github.com/drewburr))
773
+
774
+ ## [0.57.1] - 2026-03-07
775
+
776
+ ### Fixed
777
+
778
+ - Fixed context overflow detection to recognize z.ai `model_context_window_exceeded` errors surfaced through OpenAI-compatible stop reason handling ([#1937](https://github.com/badlogic/pi-mono/issues/1937))
779
+
780
+ ## [0.57.0] - 2026-03-07
781
+
782
+ ### Added
783
+
784
+ - Added per-request payload inspection and replacement hook support via `beforeProviderRequest`, allowing callers to inspect or replace provider payloads before sending.
785
+
786
+ ## [0.56.3] - 2026-03-06
787
+
788
+ ### Added
789
+
790
+ - Added `claude-sonnet-4-6` model for the `google-antigravity` provider ([#1859](https://github.com/badlogic/pi-mono/issues/1859)).
791
+ - Bumped default Antigravity User-Agent version to `1.18.4` ([#1859](https://github.com/badlogic/pi-mono/issues/1859)).
792
+
793
+ ### Fixed
794
+
795
+ - Fixed Antigravity Claude thinking beta header detection to use provider and model capability instead of `-thinking` suffix, so models like `claude-sonnet-4-6` receive the header correctly ([#1859](https://github.com/badlogic/pi-mono/issues/1859)).
796
+ - Fixed OpenAI Responses reasoning replay regression that dropped reasoning blocks on follow-up turns ([#1878](https://github.com/badlogic/pi-mono/issues/1878))
797
+
798
+ ## [0.56.2] - 2026-03-05
799
+
800
+ ### Added
801
+
802
+ - Added `gpt-5.4` model support for `openai`, `openai-codex`, `azure-openai-responses`, and `opencode` providers, with GPT-5.4 treated as xhigh-capable and capped to a 272000 context window in built-in metadata.
803
+ - Added `gpt-5.3-codex` fallback model availability for `github-copilot` until upstream model catalogs include it ([#1853](https://github.com/badlogic/pi-mono/issues/1853)).
804
+
805
+ ### Fixed
806
+
807
+ - Preserved OpenAI Responses assistant `phase` metadata (`commentary`, `final_answer`) across turns by encoding `id` and `phase` in `textSignature` for session persistence and replay, with backward compatibility for legacy plain signatures ([#1819](https://github.com/badlogic/pi-mono/issues/1819)).
808
+ - Fixed OpenAI Responses replay to omit empty thinking blocks, avoiding invalid no-op reasoning items in follow-up turns.
809
+ - Switched the Mistral provider from the OpenAI-compatible completions path to Mistral's native SDK and conversations API, preserving native thinking blocks and Mistral-specific message semantics across turns ([#1716](https://github.com/badlogic/pi-mono/issues/1716)).
810
+ - Fixed Antigravity endpoint fallback: 403/404 responses now cascade to the next endpoint instead of throwing immediately, added `autopush-cloudcode-pa.sandbox` endpoint to the fallback list, and removed extra fingerprint headers (`X-Goog-Api-Client`, `Client-Metadata`) from Antigravity requests ([#1830](https://github.com/badlogic/pi-mono/issues/1830)).
811
+ - Fixed `@mariozechner/pi-ai/oauth` package exports to point directly at built `dist` files, avoiding broken TypeScript resolution through unpublished wrapper targets ([#1856](https://github.com/badlogic/pi-mono/issues/1856)).
812
+ - Fixed Gemini 3 unsigned tool call replay: use `skip_thought_signature_validator` sentinel instead of converting function calls to text, preserving structured tool call context across multi-turn conversations ([#1829](https://github.com/badlogic/pi-mono/issues/1829)).
813
+
814
+ ## [0.56.1] - 2026-03-05
815
+
816
+ ## [0.56.0] - 2026-03-04
817
+
818
+ ### Breaking Changes
819
+
820
+ - Moved Node OAuth runtime exports off the top-level package entry. Import OAuth login/refresh functions from `@mariozechner/pi-ai/oauth` instead of `@mariozechner/pi-ai` ([#1814](https://github.com/badlogic/pi-mono/issues/1814))
821
+
822
+ ### Added
823
+
824
+ - Added `gemini-3.1-flash-lite-preview` fallback model entry for the `google` provider so it remains selectable until upstream model catalogs include it ([#1785](https://github.com/badlogic/pi-mono/issues/1785), thanks [@n-WN](https://github.com/n-WN)).
825
+ - Added OpenCode Go provider support with `opencode-go` model catalog entries and `OPENCODE_API_KEY` environment variable support ([#1757](https://github.com/badlogic/pi-mono/issues/1757)).
826
+
827
+ ### Changed
828
+
829
+ - Updated Antigravity Gemini 3.1 model metadata and request headers to match current upstream behavior.
830
+
831
+ ### Fixed
832
+
833
+ - Fixed Gemini 3.1 thinking-level detection in `google` and `google-vertex` providers so `gemini-3.1-*` models use Gemini 3 level-based thinking config instead of budget fallback ([#1785](https://github.com/badlogic/pi-mono/issues/1785), thanks [@n-WN](https://github.com/n-WN)).
834
+ - Fixed browser bundling failures by lazy-loading the Bedrock provider and removing Node-only side effects from the default browser import graph ([#1814](https://github.com/badlogic/pi-mono/issues/1814)).
835
+ - Fixed `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING` failures by replacing `Function`-based dynamic imports with module dynamic imports in browser-safe provider loading paths ([#1814](https://github.com/badlogic/pi-mono/issues/1814)).
836
+ - Fixed Bedrock region resolution for `AWS_PROFILE` by honoring `region` from the selected profile when present ([#1800](https://github.com/badlogic/pi-mono/issues/1800)).
837
+ - Fixed Groq Qwen3 reasoning effort mapping by translating unsupported effort values to provider-supported values ([#1745](https://github.com/badlogic/pi-mono/issues/1745)).
838
+
839
+ ## [0.55.4] - 2026-03-02
840
+
841
+ ## [0.55.3] - 2026-02-27
842
+
843
+ ## [0.55.2] - 2026-02-27
844
+
845
+ ### Fixed
846
+
847
+ - Restored built-in OAuth providers when unregistering dynamically registered provider IDs and added `resetOAuthProviders()` for registry reset flows.
848
+ - Fixed Z.ai thinking control using wrong parameter name (`thinking` instead of `enable_thinking`), causing thinking to always be enabled and wasting tokens/latency ([#1674](https://github.com/badlogic/pi-mono/pull/1674) by [@okuyam2y](https://github.com/okuyam2y))
849
+ - Fixed `redacted_thinking` blocks being silently dropped during Anthropic streaming. They are now captured as `ThinkingContent` with `redacted: true`, passed back to the API in multi-turn conversations, and handled in cross-model message transformation ([#1665](https://github.com/badlogic/pi-mono/pull/1665) by [@tctev](https://github.com/tctev))
850
+ - Fixed `interleaved-thinking-2025-05-14` beta header being sent for adaptive thinking models (Opus 4.6, Sonnet 4.6) where the header is deprecated or redundant ([#1665](https://github.com/badlogic/pi-mono/pull/1665) by [@tctev](https://github.com/tctev))
851
+ - Fixed temperature being sent alongside extended thinking, which is incompatible with both adaptive and budget-based thinking modes ([#1665](https://github.com/badlogic/pi-mono/pull/1665) by [@tctev](https://github.com/tctev))
852
+ - Fixed `(external, cli)` user-agent flag causing 401 errors on Anthropic setup-token endpoint ([#1677](https://github.com/badlogic/pi-mono/pull/1677) by [@LazerLance777](https://github.com/LazerLance777))
853
+ - Fixed crash when OpenAI-compatible provider returns a chunk with no `choices` array by adding optional chaining ([#1671](https://github.com/badlogic/pi-mono/issues/1671))
854
+
855
+ ## [0.55.1] - 2026-02-26
856
+
857
+ ### Added
858
+
859
+ - Added `gemini-3.1-pro-preview` model support to the `google-gemini-cli` provider ([#1599](https://github.com/badlogic/pi-mono/pull/1599) by [@audichuang](https://github.com/audichuang))
860
+
861
+ ### Fixed
862
+
863
+ - Fixed adaptive thinking for Claude Sonnet 4.6 in Anthropic and Bedrock providers, and clamped unsupported `xhigh` effort values to supported levels ([#1548](https://github.com/badlogic/pi-mono/pull/1548) by [@tctev](https://github.com/tctev))
864
+ - Fixed Vertex ADC credential detection race by avoiding caching a false negative during async import initialization ([#1550](https://github.com/badlogic/pi-mono/pull/1550) by [@jeremiahgaylord-web](https://github.com/jeremiahgaylord-web))
865
+
866
+ ## [0.55.0] - 2026-02-24
867
+
868
+ ## [0.54.2] - 2026-02-23
869
+
870
+ ## [0.54.1] - 2026-02-22
871
+
872
+ ## [0.54.0] - 2026-02-19
873
+
874
+ ## [0.53.1] - 2026-02-19
875
+
876
+ ## [0.53.0] - 2026-02-17
877
+
878
+ ### Added
879
+
880
+ - Added Anthropic `claude-sonnet-4-6` fallback model entry to generated model definitions.
881
+
882
+ ## [0.52.12] - 2026-02-13
883
+
884
+ ### Added
885
+
886
+ - Added `transport` to `StreamOptions` with values `"sse"`, `"websocket"`, and `"auto"` (currently supported by `openai-codex-responses`).
887
+ - Added WebSocket transport support for OpenAI Codex Responses (`openai-codex-responses`).
888
+
889
+ ### Changed
890
+
891
+ - OpenAI Codex Responses now defaults to SSE transport unless `transport` is explicitly set.
892
+ - OpenAI Codex Responses WebSocket connections are cached per `sessionId` and expire after 5 minutes of inactivity.
893
+
894
+ ## [0.52.11] - 2026-02-13
895
+
896
+ ### Added
897
+
898
+ - Added MiniMax M2.5 model entries for `minimax`, `minimax-cn`, `openrouter`, and `vercel-ai-gateway` providers, plus `minimax-m2.5-free` for `opencode`.
899
+
900
+ ## [0.52.10] - 2026-02-12
901
+
902
+ ### Added
903
+
904
+ - Added optional `metadata` field to `StreamOptions` for passing provider-specific metadata (e.g. Anthropic `user_id` for abuse tracking/rate limiting) ([#1384](https://github.com/badlogic/pi-mono/pull/1384) by [@7Sageer](https://github.com/7Sageer))
905
+ - Added `gpt-5.3-codex-spark` model 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.
906
+
907
+ ### Changed
908
+
909
+ - Routed GitHub Copilot Claude 4.x models through Anthropic Messages API, centralized Copilot dynamic header handling, and added Copilot Claude Anthropic stream coverage ([#1353](https://github.com/badlogic/pi-mono/pull/1353) by [@NateSmyth](https://github.com/NateSmyth))
910
+
911
+ ### Fixed
912
+
913
+ - Fixed OpenAI completions and responses streams to tolerate malformed trailing tool-call JSON without failing parsing ([#1424](https://github.com/badlogic/pi-mono/issues/1424))
914
+
915
+ ## [0.52.9] - 2026-02-08
916
+
917
+ ### Changed
918
+
919
+ - Updated the Antigravity system instruction to a more compact version for Google Gemini CLI compatibility
920
+
921
+ ### Fixed
922
+
923
+ - Use `parametersJsonSchema` for Google provider tool declarations to support full JSON Schema (anyOf, oneOf, const, etc.) ([#1398](https://github.com/badlogic/pi-mono/issues/1398) by [@jarib](https://github.com/jarib))
924
+ - Reverted incorrect Antigravity model change: `claude-opus-4-6-thinking` back to `claude-opus-4-5-thinking` (model doesn't exist on Antigravity endpoint)
925
+ - Corrected opencode context windows for Claude Sonnet 4 and 4.5 ([#1383](https://github.com/badlogic/pi-mono/issues/1383))
926
+
927
+ ## [0.52.8] - 2026-02-07
928
+
929
+ ### Added
930
+
931
+ - Added OpenRouter `auto` model alias for automatic model routing ([#1361](https://github.com/badlogic/pi-mono/pull/1361) by [@yogasanas](https://github.com/yogasanas))
932
+
933
+ ### Changed
934
+
935
+ - Replaced Claude Opus 4.5 with Opus 4.6 in model definitions ([#1345](https://github.com/badlogic/pi-mono/pull/1345) by [@calvin-hpnet](https://github.com/calvin-hpnet))
936
+
937
+ ## [0.52.7] - 2026-02-06
938
+
939
+ ### Added
940
+
941
+ - Added `AWS_BEDROCK_SKIP_AUTH` and `AWS_BEDROCK_FORCE_HTTP1` environment variables for connecting to unauthenticated Bedrock proxies ([#1320](https://github.com/badlogic/pi-mono/pull/1320) by [@virtuald](https://github.com/virtuald))
942
+
943
+ ### Fixed
944
+
945
+ - Set OpenAI Responses API requests to `store: false` by default to avoid server-side history logging ([#1308](https://github.com/badlogic/pi-mono/issues/1308))
946
+ - Re-exported TypeBox `Type`, `Static`, and `TSchema` from `@mariozechner/pi-ai` to match documentation and avoid duplicate TypeBox type identity issues in pnpm setups ([#1338](https://github.com/badlogic/pi-mono/issues/1338))
947
+ - Fixed Bedrock adaptive thinking handling for Claude Opus 4.6 with interleaved thinking beta responses ([#1323](https://github.com/badlogic/pi-mono/pull/1323) by [@markusylisiurunen](https://github.com/markusylisiurunen))
948
+ - Fixed `AWS_BEDROCK_SKIP_AUTH` environment detection to avoid `process` access in non-Node.js environments
949
+
950
+ ## [0.52.6] - 2026-02-05
951
+
952
+ ## [0.52.5] - 2026-02-05
953
+
954
+ ### Fixed
955
+
956
+ - Fixed `supportsXhigh()` to treat Anthropic Messages Opus 4.6 models as xhigh-capable so `streamSimple` can map `xhigh` to adaptive effort `max`
957
+
958
+ ## [0.52.4] - 2026-02-05
959
+
960
+ ## [0.52.3] - 2026-02-05
961
+
962
+ ### Fixed
963
+
964
+ - Fixed Bedrock Opus 4.6 model IDs (removed `:0` suffix) and cache pricing for `us.*` and `eu.*` variants
965
+ - Added missing `eu.anthropic.claude-opus-4-6-v1` inference profile to model catalog
966
+ - Fixed Claude Opus 4.6 context window metadata to 200000 for Anthropic and OpenCode providers
967
+
968
+ ## [0.52.2] - 2026-02-05
969
+
970
+ ## [0.52.1] - 2026-02-05
971
+
972
+ ### Added
973
+
974
+ - Added adaptive thinking support for Claude Opus 4.6 with effort levels (`low`, `medium`, `high`, `max`)
975
+ - Added `effort` option to `AnthropicOptions` for controlling adaptive thinking depth
976
+ - `thinkingEnabled` now automatically uses adaptive thinking for Opus 4.6+ models and budget-based thinking for older models
977
+ - `streamSimple`/`completeSimple` automatically map `ThinkingLevel` to effort levels for Opus 4.6
978
+
979
+ ### Changed
980
+
981
+ - Updated `@anthropic-ai/sdk` to 0.73.0
982
+ - Updated `@aws-sdk/client-bedrock-runtime` to 3.983.0
983
+ - Updated `@google/genai` to 1.40.0
984
+ - Removed `fast-xml-parser` override (no longer needed)
985
+
986
+ ## [0.52.0] - 2026-02-05
987
+
988
+ ### Added
989
+
990
+ - Added Claude Opus 4.6 model to the generated model catalog
991
+ - Added GPT-5.3 Codex model to the generated model catalog (OpenAI Codex provider only)
992
+
993
+ ## [0.51.6] - 2026-02-04
994
+
995
+ ### Fixed
996
+
997
+ - Fixed OpenAI Codex Responses provider to respect configured baseUrl ([#1244](https://github.com/badlogic/pi-mono/issues/1244))
998
+
999
+ ## [0.51.5] - 2026-02-04
1000
+
1001
+ ### Changed
1002
+
1003
+ - Changed Bedrock model generation to drop legacy workarounds now handled upstream ([#1239](https://github.com/badlogic/pi-mono/pull/1239) by [@unexge](https://github.com/unexge))
1004
+
1005
+ ## [0.51.4] - 2026-02-03
1006
+
1007
+ ## [0.51.3] - 2026-02-03
1008
+
1009
+ ### Fixed
1010
+
1011
+ - Fixed xhigh thinking level support check to accept gpt-5.2 model IDs ([#1209](https://github.com/badlogic/pi-mono/issues/1209))
1012
+
1013
+ ## [0.51.2] - 2026-02-03
1014
+
1015
+ ## [0.51.1] - 2026-02-02
1016
+
1017
+ ### Fixed
1018
+
1019
+ - Fixed `cache_control` not being applied to string-format user messages in Anthropic provider
1020
+
1021
+ ## [0.51.0] - 2026-02-01
1022
+
1023
+ ### Fixed
1024
+
1025
+ - Fixed `cacheRetention` option not being passed through in `buildBaseOptions` ([#1154](https://github.com/badlogic/pi-mono/issues/1154))
1026
+ - Fixed OAuth login/refresh not using HTTP proxy settings (`HTTP_PROXY`, `HTTPS_PROXY` env vars) ([#1132](https://github.com/badlogic/pi-mono/issues/1132))
1027
+ - Fixed OpenAI-compatible completions to omit unsupported `strict` tool fields for providers that reject them ([#1172](https://github.com/badlogic/pi-mono/issues/1172))
1028
+
1029
+ ## [0.50.9] - 2026-02-01
1030
+
1031
+ ### Added
1032
+
1033
+ - Added `PI_AI_ANTIGRAVITY_VERSION` environment variable to override the Antigravity User-Agent version when Google updates their version requirements ([#1129](https://github.com/badlogic/pi-mono/issues/1129))
1034
+ - Added `cacheRetention` stream option with provider-specific mappings for prompt cache controls, defaulting to short retention ([#1134](https://github.com/badlogic/pi-mono/issues/1134))
1035
+
1036
+ ## [0.50.8] - 2026-02-01
1037
+
1038
+ ### Added
1039
+
1040
+ - Added `maxRetryDelayMs` option to `StreamOptions` to 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](https://github.com/badlogic/pi-mono/issues/1123))
1041
+ - Added Qwen thinking format support for OpenAI-compatible completions via `enable_thinking`. ([#940](https://github.com/badlogic/pi-mono/pull/940) by [@4h9fbZ](https://github.com/4h9fbZ))
1042
+
1043
+ ## [0.50.7] - 2026-01-31
1044
+
1045
+ ## [0.50.6] - 2026-01-30
1046
+
1047
+ ## [0.50.5] - 2026-01-30
1048
+
1049
+ ## [0.50.4] - 2026-01-30
1050
+
1051
+ ### Added
1052
+
1053
+ - Added Vercel AI Gateway routing support via `vercelGatewayRouting` option in model config ([#1051](https://github.com/badlogic/pi-mono/pull/1051) by [@ben-vargas](https://github.com/ben-vargas))
1054
+
1055
+ ### Fixed
1056
+
1057
+ - Updated Antigravity User-Agent from 1.11.5 to 1.15.8 to fix rejected requests ([#1079](https://github.com/badlogic/pi-mono/issues/1079))
1058
+ - Fixed tool call argument defaults for Anthropic and Google history conversion when providers omit inputs ([#1065](https://github.com/badlogic/pi-mono/issues/1065))
1059
+
1060
+ ## [0.50.3] - 2026-01-29
1061
+
1062
+ ### Added
1063
+
1064
+ - Added Kimi For Coding provider support (Moonshot AI's Anthropic-compatible coding API)
1065
+
1066
+ ## [0.50.2] - 2026-01-29
1067
+
1068
+ ### Added
1069
+
1070
+ - Added Hugging Face provider support via OpenAI-compatible Inference Router ([#994](https://github.com/badlogic/pi-mono/issues/994))
1071
+ - Added `PI_CACHE_RETENTION` environment variable to control cache TTL for Anthropic (5m vs 1h) and OpenAI (in-memory vs 24h). Set to `long` for extended retention. Only applies to direct API calls (api.anthropic.com, api.openai.com). ([#967](https://github.com/badlogic/pi-mono/issues/967))
1072
+
1073
+ ### Fixed
1074
+
1075
+ - Fixed OpenAI completions `toolChoice` handling to correctly set `type: "function"` wrapper ([#998](https://github.com/badlogic/pi-mono/pull/998) by [@williamtwomey](https://github.com/williamtwomey))
1076
+ - 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](https://github.com/badlogic/pi-mono/issues/1022))
1077
+ - Fixed 429 rate limit errors incorrectly triggering auto-compaction instead of retry with backoff ([#1038](https://github.com/badlogic/pi-mono/issues/1038))
1078
+ - Fixed Anthropic provider to handle `sensitive` stop_reason returned by API ([#978](https://github.com/badlogic/pi-mono/issues/978))
1079
+ - Fixed DeepSeek API compatibility by detecting `deepseek.com` URLs and disabling unsupported `developer` role ([#1048](https://github.com/badlogic/pi-mono/issues/1048))
1080
+ - Fixed Anthropic provider to preserve input token counts when proxies omit them in `message_delta` events ([#1045](https://github.com/badlogic/pi-mono/issues/1045))
1081
+
1082
+ ## [0.50.1] - 2026-01-26
1083
+
1084
+ ### Fixed
1085
+
1086
+ - Fixed OpenCode Zen model generation to exclude deprecated models ([#970](https://github.com/badlogic/pi-mono/pull/970) by [@DanielTatarkin](https://github.com/DanielTatarkin))
1087
+
1088
+ ## [0.50.0] - 2026-01-26
1089
+
1090
+ ### Added
1091
+
1092
+ - Added OpenRouter provider routing support for custom models via `openRouterRouting` compat field ([#859](https://github.com/badlogic/pi-mono/pull/859) by [@v01dpr1mr0s3](https://github.com/v01dpr1mr0s3))
1093
+ - Added `azure-openai-responses` provider support for Azure OpenAI Responses API. ([#890](https://github.com/badlogic/pi-mono/pull/890) by [@markusylisiurunen](https://github.com/markusylisiurunen))
1094
+ - Added HTTP proxy environment variable support for API requests ([#942](https://github.com/badlogic/pi-mono/pull/942) by [@haoqixu](https://github.com/haoqixu))
1095
+ - Added `createAssistantMessageEventStream()` factory function for use in extensions.
1096
+ - Added `resetApiProviders()` to clear and re-register built-in API providers.
1097
+
1098
+ ### Changed
1099
+
1100
+ - Refactored API streaming dispatch to use an API registry with provider-owned `streamSimple` mapping.
1101
+ - Moved environment API key resolution to `env-api-keys.ts` and re-exported it from the package entrypoint.
1102
+ - Azure OpenAI Responses provider now uses base URL configuration with deployment-aware model mapping and no longer includes service tier handling.
1103
+
1104
+ ### Fixed
1105
+
1106
+ - Fixed Bun runtime detection for dynamic imports in browser-compatible modules (stream.ts, openai-codex-responses.ts, openai-codex.ts) ([#922](https://github.com/badlogic/pi-mono/pull/922) by [@dannote](https://github.com/dannote))
1107
+ - Fixed streaming functions to use `model.api` instead of hardcoded API types
1108
+ - Fixed Google providers to default tool call arguments to an empty object when omitted
1109
+ - Fixed OpenAI Responses streaming to handle `arguments.done` events on OpenAI-compatible endpoints ([#917](https://github.com/badlogic/pi-mono/pull/917) by [@williballenthin](https://github.com/williballenthin))
1110
+ - Fixed OpenAI Codex Responses tool strictness handling after the shared responses refactor
1111
+ - Fixed Azure OpenAI Responses streaming to guard deltas before content parts and correct metadata and handoff gating
1112
+ - Fixed OpenAI completions tool-result image batching after consecutive tool results ([#902](https://github.com/badlogic/pi-mono/pull/902) by [@terrorobe](https://github.com/terrorobe))
1113
+
1114
+ ## [0.49.3] - 2026-01-22
1115
+
1116
+ ### Added
1117
+
1118
+ - Added `headers` option to `StreamOptions` for custom HTTP headers in API requests. Supported by all providers except Amazon Bedrock (which uses AWS SDK auth). Headers are merged with provider defaults and `model.headers`, with `options.headers` taking precedence.
1119
+ - Added `originator` option to `loginOpenAICodex()` for custom OAuth client identification
1120
+ - Browser compatibility for pi-ai: replaced top-level Node.js imports with dynamic imports for browser environments ([#873](https://github.com/badlogic/pi-mono/issues/873))
1121
+
1122
+ ### Fixed
1123
+
1124
+ - Fixed OpenAI Responses API 400 error "function_call without required reasoning item" when switching between models (same provider, different model). The fix omits the `id` field for function_calls from different models to avoid triggering OpenAI's reasoning/function_call pairing validation ([#886](https://github.com/badlogic/pi-mono/issues/886))
1125
+
1126
+ ## [0.49.2] - 2026-01-19
1127
+
1128
+ ### Added
1129
+
1130
+ - Added AWS credential detection for ECS/Kubernetes environments: `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`, `AWS_CONTAINER_CREDENTIALS_FULL_URI`, `AWS_WEB_IDENTITY_TOKEN_FILE` ([#848](https://github.com/badlogic/pi-mono/issues/848))
1131
+
1132
+ ### Fixed
1133
+
1134
+ - Fixed OpenAI Responses 400 error "reasoning without following item" by skipping errored/aborted assistant messages entirely in transform-messages.ts ([#838](https://github.com/badlogic/pi-mono/pull/838))
1135
+
1136
+ ### Removed
1137
+
1138
+ - Removed `strictResponsesPairing` compat option (no longer needed after the transform-messages fix)
1139
+
1140
+ ## [0.49.1] - 2026-01-18
1141
+
1142
+ ### Added
1143
+
1144
+ - Added `OpenAIResponsesCompat` interface with `strictResponsesPairing` option for Azure OpenAI Responses API, which requires strict reasoning/message pairing in history replay ([#768](https://github.com/badlogic/pi-mono/pull/768) by [@prateekmedia](https://github.com/prateekmedia))
1145
+
1146
+ ### Changed
1147
+
1148
+ - Split `OpenAICompat` into `OpenAICompletionsCompat` and `OpenAIResponsesCompat` for type-safe API-specific compat settings
1149
+
1150
+ ### Fixed
1151
+
1152
+ - Fixed tool call ID normalization for cross-provider handoffs (e.g., Codex to Antigravity Claude) ([#821](https://github.com/badlogic/pi-mono/issues/821))
1153
+
1154
+ ## [0.49.0] - 2026-01-17
1155
+
1156
+ ### Changed
1157
+
1158
+ - OpenAI Codex responses now use the context system prompt directly in the instructions field.
1159
+
1160
+ ### Fixed
1161
+
1162
+ - 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](https://github.com/badlogic/pi-mono/issues/812))
1163
+ - Fixed Bedrock Claude max_tokens handling to always exceed thinking budget tokens, preventing compaction failures. ([#797](https://github.com/badlogic/pi-mono/pull/797) by [@pjtf93](https://github.com/pjtf93))
1164
+ - Fixed Claude Code tool name normalization to match the Claude Code tool list case-insensitively and remove invalid mappings.
1165
+
1166
+ ## [0.48.0] - 2026-01-16
1167
+
1168
+ ### Fixed
1169
+
1170
+ - Fixed OpenAI-compatible provider feature detection to use `model.provider` in addition to URL, allowing custom base URLs (e.g., proxies) to work correctly with provider-specific settings ([#774](https://github.com/badlogic/pi-mono/issues/774))
1171
+ - 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
1172
+ - Fixed string numbers in tool arguments not being coerced to numbers during validation ([#786](https://github.com/badlogic/pi-mono/pull/786) by [@dannote](https://github.com/dannote))
1173
+ - Fixed Bedrock tool call IDs to use only alphanumeric characters, avoiding API errors from invalid characters ([#781](https://github.com/badlogic/pi-mono/pull/781) by [@pjtf93](https://github.com/pjtf93))
1174
+ - Fixed empty error assistant messages (from 429/500 errors) breaking the tool_use to tool_result chain by filtering them in `transformMessages`
1175
+
1176
+ ## [0.47.0] - 2026-01-16
1177
+
1178
+ ### Fixed
1179
+
1180
+ - Fixed OpenCode provider's `/v1` endpoint to use `system` role instead of `developer` role, fixing `400 Incorrect role information` error for models using `openai-completions` API ([#755](https://github.com/badlogic/pi-mono/pull/755) by [@melihmucuk](https://github.com/melihmucuk))
1181
+ - Added retry logic to OpenAI Codex provider for transient errors (429, 5xx, connection failures). Uses exponential backoff with up to 3 retries. ([#733](https://github.com/badlogic/pi-mono/issues/733))
1182
+
1183
+ ## [0.46.0] - 2026-01-15
1184
+
1185
+ ### Added
1186
+
1187
+ - Added MiniMax China (`minimax-cn`) provider support ([#725](https://github.com/badlogic/pi-mono/pull/725) by [@tallshort](https://github.com/tallshort))
1188
+ - Added `gpt-5.2-codex` models for GitHub Copilot and OpenCode Zen providers ([#734](https://github.com/badlogic/pi-mono/pull/734) by [@aadishv](https://github.com/aadishv))
1189
+
1190
+ ### Fixed
1191
+
1192
+ - Avoid unsigned Gemini 3 tool calls ([#741](https://github.com/badlogic/pi-mono/pull/741) by [@roshanasingh4](https://github.com/roshanasingh4))
1193
+ - Fixed signature support for non-Anthropic models in Amazon Bedrock provider ([#727](https://github.com/badlogic/pi-mono/pull/727) by [@unexge](https://github.com/unexge))
1194
+
1195
+ ## [0.45.7] - 2026-01-13
1196
+
1197
+ ### Fixed
1198
+
1199
+ - Fixed OpenAI Responses timeout option handling ([#706](https://github.com/badlogic/pi-mono/pull/706) by [@markusylisiurunen](https://github.com/markusylisiurunen))
1200
+ - Fixed Bedrock tool call conversion to apply message transforms ([#707](https://github.com/badlogic/pi-mono/pull/707) by [@pjtf93](https://github.com/pjtf93))
1201
+
1202
+ ## [0.45.6] - 2026-01-13
1203
+
1204
+ ### Fixed
1205
+
1206
+ - Export `parseStreamingJson` from main package for tsx dev mode compatibility
1207
+
1208
+ ## [0.45.5] - 2026-01-13
1209
+
1210
+ ## [0.45.4] - 2026-01-13
1211
+
1212
+ ### Added
1213
+
1214
+ - Added Vercel AI Gateway provider with model discovery and `AI_GATEWAY_API_KEY` env support ([#689](https://github.com/badlogic/pi-mono/pull/689) by [@timolins](https://github.com/timolins))
1215
+
1216
+ ### Fixed
1217
+
1218
+ - Fixed z.ai thinking/reasoning: z.ai uses `thinking: { type: "enabled" }` instead of OpenAI's `reasoning_effort`. Added `thinkingFormat` compat flag to handle this. ([#688](https://github.com/badlogic/pi-mono/issues/688))
1219
+
1220
+ ## [0.45.3] - 2026-01-13
1221
+
1222
+ ## [0.45.2] - 2026-01-13
1223
+
1224
+ ## [0.45.1] - 2026-01-13
1225
+
1226
+ ## [0.45.0] - 2026-01-13
1227
+
1228
+ ### Added
1229
+
1230
+ - MiniMax provider support with M2 and M2.1 models via Anthropic-compatible API ([#656](https://github.com/badlogic/pi-mono/pull/656) by [@dannote](https://github.com/dannote))
1231
+ - Add Amazon Bedrock provider with prompt caching for Claude models (experimental, tested with Anthropic Claude models only) ([#494](https://github.com/badlogic/pi-mono/pull/494) by [@unexge](https://github.com/unexge))
1232
+ - Added `serviceTier` option for OpenAI Responses requests ([#672](https://github.com/badlogic/pi-mono/pull/672) by [@markusylisiurunen](https://github.com/markusylisiurunen))
1233
+ - **Anthropic caching on OpenRouter**: Interactions with Anthropic models via OpenRouter now set a 5-minute cache point using Anthropic-style `cache_control` breakpoints on the last assistant or user message. ([#584](https://github.com/badlogic/pi-mono/pull/584) by [@nathyong](https://github.com/nathyong))
1234
+ - **Google Gemini CLI provider improvements**: Added Antigravity endpoint fallback (tries daily sandbox then prod when `baseUrl` is unset), header-based retry delay parsing (`Retry-After`, `x-ratelimit-reset`, `x-ratelimit-reset-after`), stable `sessionId` derivation from first user message for cache affinity, empty SSE stream retry with backoff, and `anthropic-beta` header for Claude thinking models ([#670](https://github.com/badlogic/pi-mono/pull/670) by [@kim0](https://github.com/kim0))
1235
+
1236
+ ## [0.44.0] - 2026-01-12
1237
+
1238
+ ## [0.43.0] - 2026-01-11
1239
+
1240
+ ### Fixed
1241
+
1242
+ - Fixed Google provider thinking detection: `isThinkingPart()` now only checks `thought === true`, not `thoughtSignature`. Per Google docs, `thoughtSignature` is for context replay and can appear on any part type. Also removed `id` field from `functionCall`/`functionResponse` (rejected by Vertex AI and Cloud Code Assist), and added `textSignature` round-trip for multi-turn reasoning context. ([#631](https://github.com/badlogic/pi-mono/pull/631) by [@theBucky](https://github.com/theBucky))
1243
+
1244
+ ## [0.42.5] - 2026-01-11
1245
+
1246
+ ## [0.42.4] - 2026-01-10
1247
+
1248
+ ## [0.42.3] - 2026-01-10
1249
+
1250
+ ### Changed
1251
+
1252
+ - OpenAI Codex: switched to bundled system prompt matching opencode, changed originator to "pi", simplified prompt handling
1253
+
1254
+ ## [0.42.2] - 2026-01-10
1255
+
1256
+ ### Added
1257
+
1258
+ - Added `GOOGLE_APPLICATION_CREDENTIALS` env var support for Vertex AI credential detection (standard for CI/production).
1259
+ - Added `supportsUsageInStreaming` compatibility flag for OpenAI-compatible providers that reject `stream_options: { include_usage: true }`. Defaults to `true`. Set to `false` in model config for providers like gatewayz.ai. ([#596](https://github.com/badlogic/pi-mono/pull/596) by [@XesGaDeus](https://github.com/XesGaDeus))
1260
+ - Improved Google model pricing info ([#588](https://github.com/badlogic/pi-mono/pull/588) by [@aadishv](https://github.com/aadishv))
1261
+
1262
+ ### Fixed
1263
+
1264
+ - Fixed `os.homedir()` calls at module load time; now resolved lazily when needed.
1265
+ - Fixed OpenAI Responses tool strict flag to use a boolean for LM Studio compatibility ([#598](https://github.com/badlogic/pi-mono/pull/598) by [@gnattu](https://github.com/gnattu))
1266
+ - Fixed Google Cloud Code Assist OAuth for paid subscriptions: properly handles long-running operations for project provisioning, supports `GOOGLE_CLOUD_PROJECT` / `GOOGLE_CLOUD_PROJECT_ID` env vars for paid tiers, and handles VPC-SC affected users ([#582](https://github.com/badlogic/pi-mono/pull/582) by [@cmf](https://github.com/cmf))
1267
+
1268
+ ## [0.42.1] - 2026-01-09
1269
+
1270
+ ## [0.42.0] - 2026-01-09
1271
+
1272
+ ### Added
1273
+
1274
+ - Added OpenCode Zen provider support with 26 models (Claude, GPT, Gemini, Grok, Kimi, GLM, Qwen, etc.). Set `OPENCODE_API_KEY` env var to use.
1275
+
1276
+ ## [0.41.0] - 2026-01-09
1277
+
1278
+ ## [0.40.1] - 2026-01-09
1279
+
1280
+ ## [0.40.0] - 2026-01-08
1281
+
1282
+ ## [0.39.1] - 2026-01-08
1283
+
1284
+ ## [0.39.0] - 2026-01-08
1285
+
1286
+ ### Fixed
1287
+
1288
+ - Fixed Gemini CLI abort handling: detect native `AbortError` in retry catch block, cancel SSE reader when abort signal fires ([#568](https://github.com/badlogic/pi-mono/pull/568) by [@tmustier](https://github.com/tmustier))
1289
+ - Fixed Antigravity provider 429 errors by aligning request payload with CLIProxyAPI v6.6.89: inject Antigravity system instruction with `role: "user"`, set `requestType: "agent"`, and use `antigravity` userAgent. Added bridge prompt to override Antigravity behavior (identity, paths, web dev guidelines) with Pi defaults. ([#571](https://github.com/badlogic/pi-mono/pull/571) by [@ben-vargas](https://github.com/ben-vargas))
1290
+ - 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](https://github.com/badlogic/pi-mono/issues/561))
1291
+
1292
+ ## [0.38.0] - 2026-01-08
1293
+
1294
+ ### Added
1295
+
1296
+ - `thinkingBudgets` option in `SimpleStreamOptions` for customizing token budgets per thinking level on token-based providers ([#529](https://github.com/badlogic/pi-mono/pull/529) by [@melihmucuk](https://github.com/melihmucuk))
1297
+
1298
+ ### Breaking Changes
1299
+
1300
+ - 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](https://github.com/badlogic/pi-mono/pull/536) by [@ghoulr](https://github.com/ghoulr))
1301
+
1302
+ ### Fixed
1303
+
1304
+ - Fixed OpenAI Codex context window from 400,000 to 272,000 tokens to match Codex CLI defaults and prevent 400 errors. ([#536](https://github.com/badlogic/pi-mono/pull/536) by [@ghoulr](https://github.com/ghoulr))
1305
+ - Fixed Codex SSE error events to surface message, code, and status. ([#551](https://github.com/badlogic/pi-mono/pull/551) by [@tmustier](https://github.com/tmustier))
1306
+ - Fixed context overflow detection for `context_length_exceeded` error codes.
1307
+
1308
+ ## [0.37.8] - 2026-01-07
1309
+
1310
+ ## [0.37.7] - 2026-01-07
1311
+
1312
+ ## [0.37.6] - 2026-01-06
1313
+
1314
+ ### Added
1315
+
1316
+ - Exported OpenAI Codex utilities: `CacheMetadata`, `getCodexInstructions`, `getModelFamily`, `ModelFamily`, `buildCodexPiBridge`, `buildCodexSystemPrompt`, `CodexSystemPrompt` ([#510](https://github.com/badlogic/pi-mono/pull/510) by [@mitsuhiko](https://github.com/mitsuhiko))
1317
+
1318
+ ## [0.37.5] - 2026-01-06
1319
+
1320
+ ## [0.37.4] - 2026-01-06
1321
+
1322
+ ## [0.37.3] - 2026-01-06
1323
+
1324
+ ### Added
1325
+
1326
+ - `sessionId` option in `StreamOptions` for providers that support session-based caching. OpenAI Codex provider uses this to set `prompt_cache_key` and routing headers.
1327
+
1328
+ ## [0.37.2] - 2026-01-05
1329
+
1330
+ ### Fixed
1331
+
1332
+ - Codex provider now always includes `reasoning.encrypted_content` even when custom `include` options are passed ([#484](https://github.com/badlogic/pi-mono/pull/484) by [@kim0](https://github.com/kim0))
1333
+
1334
+ ## [0.37.1] - 2026-01-05
1335
+
1336
+ ## [0.37.0] - 2026-01-05
1337
+
1338
+ ### Breaking Changes
1339
+
1340
+ - 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](https://github.com/ben-vargas) in [#472](https://github.com/badlogic/pi-mono/pull/472))
1341
+
1342
+ ### Added
1343
+
1344
+ - Headless OAuth support for all callback-server providers (Google Gemini CLI, Antigravity, OpenAI Codex): paste redirect URL when browser callback is unreachable ([#428](https://github.com/badlogic/pi-mono/pull/428) by [@ben-vargas](https://github.com/ben-vargas), [#468](https://github.com/badlogic/pi-mono/pull/468) by [@crcatala](https://github.com/crcatala))
1345
+ - Cancellable GitHub Copilot device code polling via AbortSignal
1346
+
1347
+ ### Fixed
1348
+
1349
+ - Codex requests now omit the `reasoning` field entirely when thinking is off, letting the backend use its default instead of forcing a value. ([#472](https://github.com/badlogic/pi-mono/pull/472))
1350
+
1351
+ ## [0.36.0] - 2026-01-05
1352
+
1353
+ ### Added
1354
+
1355
+ - OpenAI Codex OAuth provider with Responses API streaming support: `openai-codex-responses` streaming provider with SSE parsing, tool-call handling, usage/cost tracking, and PKCE OAuth flow ([#451](https://github.com/badlogic/pi-mono/pull/451) by [@kim0](https://github.com/kim0))
1356
+
1357
+ ### Fixed
1358
+
1359
+ - Vertex AI dummy value for `getEnvApiKey()`: Returns `"<authenticated>"` when Application Default Credentials are configured (`~/.config/gcloud/application_default_credentials.json` exists) and both `GOOGLE_CLOUD_PROJECT` (or `GCLOUD_PROJECT`) and `GOOGLE_CLOUD_LOCATION` are set. This allows `streamSimple()` to work with Vertex AI without explicit `apiKey` option. The ADC credentials file existence check is cached per-process to avoid repeated filesystem access.
1360
+
1361
+ ## [0.35.0] - 2026-01-05
1362
+
1363
+ ## [0.34.2] - 2026-01-04
1364
+
1365
+ ## [0.34.1] - 2026-01-04
1366
+
1367
+ ## [0.34.0] - 2026-01-04
1368
+
1369
+ ## [0.33.0] - 2026-01-04
1370
+
1371
+ ## [0.32.3] - 2026-01-03
1372
+
1373
+ ### Fixed
1374
+
1375
+ - Google Vertex AI models no longer appear in available models list without explicit authentication. Previously, `getEnvApiKey()` returned a dummy value for `google-vertex`, causing models to show up even when Google Cloud ADC was not configured.
1376
+
1377
+ ## [0.32.2] - 2026-01-03
1378
+
1379
+ ## [0.32.1] - 2026-01-03
1380
+
1381
+ ## [0.32.0] - 2026-01-03
1382
+
1383
+ ### Added
1384
+
1385
+ - Vertex AI provider with ADC (Application Default Credentials) support. Authenticate with `gcloud auth application-default login`, set `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION`, and access Gemini models via Vertex AI. ([#300](https://github.com/badlogic/pi-mono/pull/300) by [@default-anton](https://github.com/default-anton))
1386
+
1387
+ ### Fixed
1388
+
1389
+ - **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](https://github.com/badlogic/pi-mono/issues/370))
1390
+
1391
+ ## [0.31.1] - 2026-01-02
1392
+
1393
+ ## [0.31.0] - 2026-01-02
1394
+
1395
+ ### Breaking Changes
1396
+
1397
+ - **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`.
1398
+
1399
+ ### Added
1400
+
1401
+ - **`GoogleThinkingLevel` type**: Exported type that mirrors Google's `ThinkingLevel` enum values (`"THINKING_LEVEL_UNSPECIFIED" | "MINIMAL" | "LOW" | "MEDIUM" | "HIGH"`). Allows configuring Gemini thinking levels without importing from `@google/genai`.
1402
+ - **`ANTHROPIC_OAUTH_TOKEN` env var**: Now checked before `ANTHROPIC_API_KEY` in `getEnvApiKey()`, allowing OAuth tokens to take precedence.
1403
+ - **`event-stream.js` export**: `AssistantMessageEventStream` utility now exported from package index.
1404
+
1405
+ ### Changed
1406
+
1407
+ - **OAuth uses Web Crypto API**: PKCE generation and OAuth flows now use Web Crypto API (`crypto.subtle`) instead of Node.js `crypto` module. This improves browser compatibility while still working in Node.js 20+.
1408
+ - **Deterministic model generation**: `generate-models.ts` now sorts providers and models alphabetically for consistent output across runs. ([#332](https://github.com/badlogic/pi-mono/pull/332) by [@mrexodia](https://github.com/mrexodia))
1409
+
1410
+ ### Fixed
1411
+
1412
+ - **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](https://github.com/badlogic/pi-mono/pull/344) by [@default-anton](https://github.com/default-anton))
1413
+ - **Thinking token duplication**: Fixed thinking content duplication with chutes.ai provider. The provider was returning thinking content in both `reasoning_content` and `reasoning` fields, causing each chunk to be processed twice. Now only the first non-empty reasoning field is used.
1414
+ - **zAi provider API mapping**: Fixed zAi models to use `openai-completions` API with correct base URL (`https://api.z.ai/api/coding/paas/v4`) instead of incorrect Anthropic API mapping. ([#344](https://github.com/badlogic/pi-mono/pull/344), [#358](https://github.com/badlogic/pi-mono/pull/358) by [@default-anton](https://github.com/default-anton))
1415
+
1416
+ ## [0.28.0] - 2025-12-25
1417
+
1418
+ ### Breaking Changes
1419
+
1420
+ - **OAuth storage removed** ([#296](https://github.com/badlogic/pi-mono/issues/296)): All storage functions (`loadOAuthCredentials`, `saveOAuthCredentials`, `setOAuthStorage`, etc.) removed. Callers are responsible for storing credentials.
1421
+ - **OAuth login functions**: `loginAnthropic`, `loginGitHubCopilot`, `loginGeminiCli`, `loginAntigravity` now return `OAuthCredentials` instead of saving to disk.
1422
+ - **refreshOAuthToken**: Now takes `(provider, credentials)` and returns new `OAuthCredentials` instead of saving.
1423
+ - **getOAuthApiKey**: Now takes `(provider, credentials)` and returns `{ newCredentials, apiKey }` or null.
1424
+ - **OAuthCredentials type**: No longer includes `type: "oauth"` discriminator. Callers add discriminator when storing.
1425
+ - **setApiKey, resolveApiKey**: Removed. Callers must manage their own API key storage/resolution.
1426
+ - **getApiKey**: Renamed to `getEnvApiKey`. Only checks environment variables for known providers.
1427
+
1428
+ ## [0.27.7] - 2025-12-24
1429
+
1430
+ ### Fixed
1431
+
1432
+ - **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](https://github.com/badlogic/pi-mono/pull/302) by [@nicobailon](https://github.com/nicobailon))
1433
+
1434
+ ## [0.25.1] - 2025-12-21
1435
+
1436
+ ### Added
1437
+
1438
+ - **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](https://github.com/badlogic/pi-mono/pull/236) by [@theBucky](https://github.com/theBucky))
1439
+
1440
+ ### Fixed
1441
+
1442
+ - **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.parts` per the [docs](https://ai.google.dev/gemini-api/docs/function-calling#multimodal). For older models (which don't support multimodal function responses), images are sent in a separate user message.
1443
+
1444
+ - **Queued message steering**: When `getQueuedMessages` is 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).
1445
+
1446
+ - **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](https://github.com/badlogic/pi-mono/pull/251) by [@shellfyred](https://github.com/shellfyred))
1447
+
1448
+ - **Anthropic SDK retries disabled**: Re-enabled SDK-level retries (default 2) for transient HTTP failures. ([#252](https://github.com/badlogic/pi-mono/issues/252))
1449
+
1450
+ ## [0.23.5] - 2025-12-19
1451
+
1452
+ ### Added
1453
+
1454
+ - **Gemini 3 Flash thinking support**: Extended thinking level support for Gemini 3 Flash models (MINIMAL, LOW, MEDIUM, HIGH) to match Pro models' capabilities. ([#212](https://github.com/badlogic/pi-mono/pull/212) by [@markusylisiurunen](https://github.com/markusylisiurunen))
1455
+
1456
+ - **GitHub Copilot thinking models**: Added thinking support for additional Copilot models (o3-mini, o1-mini, o1-preview). ([#234](https://github.com/badlogic/pi-mono/pull/234) by [@aadishv](https://github.com/aadishv))
1457
+
1458
+ ### Fixed
1459
+
1460
+ - **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 removing `as any` casts. ([#213](https://github.com/badlogic/pi-mono/issues/213), [#220](https://github.com/badlogic/pi-mono/pull/220))
1461
+
1462
+ - **Google baseUrl configuration**: Google provider now respects `baseUrl` configuration for custom endpoints or API proxies. ([#216](https://github.com/badlogic/pi-mono/issues/216), [#221](https://github.com/badlogic/pi-mono/pull/221) by [@theBucky](https://github.com/theBucky))
1463
+
1464
+ - **GitHub Copilot vision requests**: Added `Copilot-Vision-Request` header when sending images to GitHub Copilot models. ([#222](https://github.com/badlogic/pi-mono/issues/222))
1465
+
1466
+ - **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](https://github.com/badlogic/pi-mono/issues/209))
1467
+
1468
+ ## [0.22.3] - 2025-12-16
1469
+
1470
+ ### Added
1471
+
1472
+ - **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](https://github.com/badlogic/pi-mono/pull/120))
1473
+
1474
+ - **Tool result streaming**: Added `tool_execution_update` event and optional `onUpdate` callback to `AgentTool.execute()` for streaming tool output during execution. Tools can now emit partial results (e.g., bash stdout) that are forwarded to subscribers. ([#44](https://github.com/badlogic/pi-mono/issues/44))
1475
+
1476
+ - **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](https://github.com/badlogic/pi-mono/pull/200) by [@kim0](https://github.com/kim0))
1477
+
1478
+ ### Changed
1479
+
1480
+ - **Normalized tool_execution_end result**: `tool_execution_end` event now always contains `AgentToolResult` (no longer `AgentToolResult | string`). Errors are wrapped in the standard result format.
1481
+
1482
+ ### Fixed
1483
+
1484
+ - **Reasoning disabled by default**: When `reasoning` option 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](https://github.com/badlogic/pi-mono/pull/180) by [@markusylisiurunen](https://github.com/markusylisiurunen))
1485
+
1486
+ ## [0.22.2] - 2025-12-15
1487
+
1488
+ ### Added
1489
+
1490
+ - **Interleaved thinking for Anthropic**: Added `interleavedThinking` option to `AnthropicOptions`. 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). Set `interleavedThinking: false` to disable.
1491
+
1492
+ ## [0.22.1] - 2025-12-15
1493
+
1494
+ _Dedicated to Peter's shoulder ([@steipete](https://twitter.com/steipete))_
1495
+
1496
+ ### Added
1497
+
1498
+ - **Interleaved thinking for Anthropic**: Enabled interleaved thinking in the Anthropic provider, allowing Claude models to output thinking blocks interspersed with text responses.
1499
+
1500
+ ## [0.22.0] - 2025-12-15
1501
+
1502
+ ### Added
1503
+
1504
+ - **GitHub Copilot provider**: Added `github-copilot` as a known provider with models sourced from models.dev. Includes Claude, GPT, Gemini, Grok, and other models available through GitHub Copilot. ([#191](https://github.com/badlogic/pi-mono/pull/191) by [@cau1k](https://github.com/cau1k))
1505
+
1506
+ ### Fixed
1507
+
1508
+ - **GitHub Copilot gpt-5 models**: Fixed API selection for gpt-5 models to use `openai-responses` instead of `openai-completions` (gpt-5 models are not accessible via completions endpoint)
1509
+
1510
+ - **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](https://github.com/badlogic/pi-mono/issues/198))
1511
+
1512
+ - **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](https://github.com/badlogic/pi-mono/pull/176) by [@markusylisiurunen](https://github.com/markusylisiurunen))
1513
+
1514
+ ## [0.18.2] - 2025-12-11
1515
+
1516
+ ### Changed
1517
+
1518
+ - **Anthropic SDK retries disabled**: Set `maxRetries: 0` on Anthropic client to allow application-level retry handling. The SDK's built-in retries were interfering with coding-agent's retry logic. ([#157](https://github.com/badlogic/pi-mono/issues/157))
1519
+
1520
+ ## [0.18.1] - 2025-12-10
1521
+
1522
+ ### Added
1523
+
1524
+ - **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_KEY` environment variable to use.
1525
+
1526
+ ### Fixed
1527
+
1528
+ - Fixed Mistral 400 errors after aborted assistant messages by skipping empty assistant messages (no content, no tool calls) ([#165](https://github.com/badlogic/pi-mono/issues/165))
1529
+
1530
+ - Removed synthetic assistant bridge message after tool results for Mistral (no longer required as of Dec 2025) ([#165](https://github.com/badlogic/pi-mono/issues/165))
1531
+
1532
+ - Fixed bug where `ANTHROPIC_API_KEY` environment variable was deleted globally after first OAuth token usage, causing subsequent prompts to fail ([#164](https://github.com/badlogic/pi-mono/pull/164))
1533
+
1534
+ ## [0.17.0] - 2025-12-09
1535
+
1536
+ ### Added
1537
+
1538
+ - **`agentLoopContinue` function**: Continue an agent loop from existing context without adding a new user message. Validates that the last message is `user` or `toolResult`. Useful for retry after context overflow or resuming from manually-added tool results.
1539
+
1540
+ ### Breaking Changes
1541
+
1542
+ - Removed provider-level tool argument validation. Validation now happens in `agentLoop` via `executeToolCalls`, allowing models to retry on validation errors. For manual tool execution, use `validateToolCall(tools, toolCall)` or `validateToolArguments(tool, toolCall)`.
1543
+
1544
+ ### Added
1545
+
1546
+ - Added `validateToolCall(tools, toolCall)` helper that finds the tool by name and validates arguments.
1547
+
1548
+ - **OpenAI compatibility overrides**: Added `compat` field to `Model` for `openai-completions` API, 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](https://github.com/badlogic/pi-mono/issues/133), thanks @fink-andreas for the initial idea and PR)
1549
+
1550
+ - **xhigh reasoning level**: Added `xhigh` to `ReasoningEffort` type for OpenAI codex-max models. For non-OpenAI providers (Anthropic, Google), `xhigh` is automatically mapped to `high`. ([#143](https://github.com/badlogic/pi-mono/issues/143))
1551
+
1552
+ ### Changed
1553
+
1554
+ - **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
1555
+
1556
+ ## [0.13.0] - 2025-12-06
1557
+
1558
+ ### Breaking Changes
1559
+
1560
+ - **Added `totalTokens` field to `Usage` type**: All code that constructs `Usage` objects must now include the `totalTokens` field. 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 as `input + output + cacheRead + cacheWrite`.
1561
+
1562
+ ## [0.12.10] - 2025-12-04
1563
+
1564
+ ### Added
1565
+
1566
+ - Added `gpt-5.1-codex-max` model support
1567
+
1568
+ ### Fixed
1569
+
1570
+ - **OpenAI Token Counting**: Fixed `usage.input` to exclude cached tokens for OpenAI providers. Previously, `input` included cached tokens, causing double-counting when calculating total context size via `input + cacheRead`. Now `input` represents non-cached input tokens across all providers, making `input + output + cacheRead + cacheWrite` the correct formula for total context size.
1571
+
1572
+ - **Fixed Claude Opus 4.5 cache pricing** (was 3x too expensive)
1573
+ - Corrected cache_read: $1.50 → $0.50 per MTok
1574
+ - Corrected cache_write: $18.75 → $6.25 per MTok
1575
+ - Added manual override in `scripts/generate-models.ts` until upstream fix is merged
1576
+ - Submitted PR to models.dev: <https://github.com/sst/models.dev/pull/439>
1577
+
1578
+ ## [0.9.4] - 2025-11-26
1579
+
1580
+ Initial release with multi-provider LLM support.