diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index fe4bb356e..0461e0645 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -12,6 +12,7 @@ - Fixed OpenCode Go Claude Haiku 5.5 failing with a 400 (`Invalid signature in thinking block ... bound to a different conversation`) after the tool list, system prompt, or earlier history changed, which left the session failing on every retry. OpenCode Go and Zen Claude 5.5 models, Opus 5, and Fable 5.1 now use per-message effort and send `thinking.block_binding: drop_block`, like the Anthropic provider ([#10954](https://github.com/earendil-works/pi/issues/10954)) - Fixed Anthropic non-strict tool schemas dropping root `$defs` and `definitions`, which left property `$ref`s pointing at nothing. Claude then produced wrong arguments for such tools (common in MCP servers), for example a JSON string instead of an object, and some Anthropic-compatible gateways rejected the request outright ([#9557](https://github.com/earendil-works/pi/issues/9557)) - Fixed OpenRouter rejecting requests with a 400 (`This endpoint's maximum context length is ...`) for models whose output limit is close to the context window, such as DeepSeek flash. OpenRouter counts the input with its own tokenizer, which can be several percent higher than the provider's count, and pi left only 4,096 tokens spare. pi then treated the 400 as a context overflow and compacted the session, even at around 20% of the window. The default output limit now leaves 15% of the estimated input unused, and near a full window at most 32,768 output tokens are requested ([#10497](https://github.com/earendil-works/pi/issues/10497)) +- Fixed Azure GPT-6 Astra, Luna, Sol, GPT-6.1 Sol, and GPT-6.1 Terra using a 272K context window instead of the 1,050,000 tokens Azure Foundry deploys them with ([#11742](https://github.com/earendil-works/pi/issues/11742)) ## [1.5.0] - 2026-11-02 diff --git a/packages/ai/catalog/providers/azure.ts b/packages/ai/catalog/providers/azure.ts index 94bd77a65..8f66f7756 100644 --- a/packages/ai/catalog/providers/azure.ts +++ b/packages/ai/catalog/providers/azure.ts @@ -10,6 +10,11 @@ const CONTEXT_WINDOW_OVERRIDES: Record = { "gpt-5.6-luna": 1050000, "gpt-5.6-sol": 1050000, "gpt-5.6-terra": 1050000, + "gpt-6-astra": 1050000, + "gpt-6-luna": 1050000, + "gpt-6-sol": 1050000, + "gpt-6.1-sol": 1050000, + "gpt-6.1-terra": 1050000, }; // Azure resells DeepSeek at its own rates. US data zone, checked 2026-09-16. diff --git a/packages/ai/test/supports-xhigh.test.ts b/packages/ai/test/supports-xhigh.test.ts index 91f5c72f0..3e2d339ea 100644 --- a/packages/ai/test/supports-xhigh.test.ts +++ b/packages/ai/test/supports-xhigh.test.ts @@ -169,6 +169,13 @@ describe("getSupportedThinkingLevels", () => { } }); + it.each(["gpt-6-astra", "gpt-6-luna", "gpt-6-sol", "gpt-6.1-sol", "gpt-6.1-terra"] as const)( + "uses the Azure Foundry 1.05M context window for %s", + (modelId) => { + expect(getModel("azure", modelId)?.contextWindow).toBe(1050000); + }, + ); + it("includes only medium/high/xhigh for OpenAI GPT-5.5 Pro", () => { const model = getModel("openai", "gpt-5.5-pro"); expect(model).toBeDefined();