Commit Graph

926 Commits

Author SHA1 Message Date
Vegard Stikbakke 0ac3cfe09b feat(ai): use zstd compression for codex sse transport 2026-07-01 08:42:46 +02:00
Vegard Stikbakke a3cc169d97 fix(ai): avoid codex user-agent race
The Codex provider previously loaded node:os asynchronously during module evaluation. A fresh process that imports the provider and immediately starts an SSE request can build headers before that promise callback runs, so the first request reports User-Agent: pi (browser) in Node/Bun.

Reproduced against parent fd6659dd with a stubbed-fetch harness: 50/50 immediate first requests reported pi (browser) in both Node and Bun. The same harness on this fix reports the OS-specific user agent 50/50 in both runtimes.

Use process.getBuiltinModule("node:os") behind the existing Node/Bun runtime guard so OS metadata is available synchronously while still avoiding top-level runtime Node builtin imports that break browser/Vite builds.
2026-07-01 08:41:38 +02:00
Mario Zechner 5c1a2977bc fix(ai): update generated model catalogue 2026-06-30 22:12:48 +02:00
Vegard Stikbakke 3d6acb37b9 fix(ai): regenerate model catalog
Includes updated Xiaomi MiMo pricing from models.dev. Closes #6138
2026-06-30 08:33:18 +02:00
Mario Zechner 6fbeba51af Merge pull request #5832 from stephanmck/fix/provider-error-body-passthrough-5763
fix(ai): surface provider HTTP error body instead of opaque SDK message
2026-06-29 16:58:24 +02:00
Vegard Stikbakke b91bdd5a3e fix(ai): preserve Z.AI thinking content
closes #6083
2026-06-29 08:40:20 +02:00
Armin Ronacher 54113731b2 fix(ai): use HTTP timeout for Codex SSE headers
Refs #4945
2026-06-28 19:57:47 +02:00
Mario Zechner 09f1059575 fix(ai): clamp streamSimple max tokens
Clamps streamSimple max-token defaults against estimated context, addressing #5595.

closes #6061
2026-06-25 14:10:28 +02:00
Mario Zechner f78b163713 fix(ai): revert minimax max token clamp 2026-06-25 13:36:04 +02:00
Stephan Schneider 62fad94f1a fix(ai): surface provider HTTP error body instead of opaque SDK message
Add a shared normalizeProviderError helper in packages/ai/src/utils/error-body.ts
and route the 8 body-blind / status-only providers through it (amazon-bedrock,
azure-openai-responses, google, google-vertex, images/openrouter,
openai-codex-responses, openai-completions, openai-responses). Non-schema 4xx/5xx
responses from proxies / gateways now show the real reason carried in the response
body alongside the HTTP status, instead of "403 status code (no body)" or
"Unknown: UnknownError".

The helper probes status (statusCode, status, $metadata.httpStatusCode,
$response.statusCode) and body (body, parsed error object, $response.body) across
the Mistral, OpenAI, Google, and Bedrock SDK shapes, truncates the body at a 4000
char cap, and preserves error.message when the SDK already folded the body in
(Anthropic / Google happy path). mistral.ts and anthropic.ts are left untouched.
Provider prefixes and the OpenRouter metadata.raw append are preserved.

closes #5763
2026-06-25 12:07:51 +02:00
Mario Zechner b940c52e7e fix(ai): clamp MiniMax shared budget max tokens
closes #6061
2026-06-25 12:00:37 +02:00
Mario Zechner 8c9dbffa36 fix(ai): preserve responses reasoning for out-of-order items
closes #6009
2026-06-25 11:57:52 +02:00
Mario Zechner 9cd2c81ada fix(ai): regenerate model catalogues 2026-06-25 11:56:33 +02:00
Mario Zechner d7868b0998 feat(ai): add reasoning token counts to Usage
Add optional reasoning?: number to Usage as a subset of output. Populate
for Anthropic (output_tokens_details.thinking_tokens), OpenAI
Responses/Codex/Azure (output_tokens_details.reasoning_tokens), OpenAI
Completions (completion_tokens_details.reasoning_tokens), and Google
Generative AI / Vertex (thoughtsTokenCount). Bedrock Converse and Mistral
do not return a reasoning breakdown, so they stay unset.

closes #6057
2026-06-25 10:35:02 +02:00
Armin Ronacher 371adcf371 fix(coding-agent): retry explicit provider retry errors
closes #6019
2026-06-24 18:14:06 +02:00
Mario Zechner a2e3e9d8b2 Merge pull request #6004 from gukoff/support-azure-foundry-endpoints
feat: Normalize modern Microsoft Foundry Responses API endpoints
2026-06-24 10:38:57 +02:00
Armin Ronacher 0201806adf Release v0.80.2 2026-06-23 23:45:36 +02:00
Mario Zechner e1a2dc04f4 fix(ai): restore detectCompat runtime fallback in openai-completions
refs #6020
2026-06-23 23:29:44 +02:00
Mario Zechner ef231c4910 fix(ai): resolve request-scoped auth before provider calls
closes #6021
2026-06-23 23:27:00 +02:00
Mario Zechner 04fce8099f Merge remote-tracking branch 'origin/main' 2026-06-23 22:30:15 +02:00
Mario Zechner 49fbe6834f fix(ai): align api key credentials with auth json 2026-06-23 22:29:46 +02:00
Armin Ronacher 386d079afa fix(ai): restore legacy compat stream aliases
closes #6016
2026-06-23 22:20:20 +02:00
Mario Zechner 6184307c39 fix(ai): require explicit anthropic compat metadata 2026-06-23 21:04:59 +02:00
Armin Ronacher 1c4a9ba7c8 Release v0.80.1 2026-06-23 20:04:09 +02:00
Armin Ronacher 828493b37c fix(ai): unblock release provider tests 2026-06-23 19:57:29 +02:00
Armin Ronacher f08e968c83 Release v0.80.0 2026-06-23 19:30:32 +02:00
Mario Zechner cd95c2749f fix(ai): require OpenAI Responses terminal events 2026-06-23 16:35:45 +02:00
Konstantin Gukov e3dcb244f8 Support modern Microsoft Foundry Responses API endpoints:
- support *.ai.azure.com endpoints
- normalize away the /responses postfix in the query path which by
  default is added on Microsoft Foundry UI
2026-06-23 15:38:43 +02:00
Mario Zechner 129eb460cd feat(ai): complete models runtime migration 2026-06-23 15:29:46 +02:00
Mario Zechner 6a4813a7ca Merge remote-tracking branch 'origin/main'
# Conflicts:
#	packages/ai/CHANGELOG.md
2026-06-23 13:52:09 +02:00
Mario Zechner 8eeaa2bcba fix(ai): honor scoped env in compat API key injection 2026-06-23 13:45:26 +02:00
Mario Zechner 2cbce395fb feat(ai): pass provider-resolved env to APIs 2026-06-23 13:42:25 +02:00
Mario Zechner 5a8ea0bc81 fix(ai): honor scoped AWS profile in Bedrock endpoint resolution 2026-06-23 13:36:44 +02:00
Armin Ronacher d0e0b84cb9 fix(ai): reconnect Codex websocket on connection limit
closes #5973
2026-06-23 00:17:37 +02:00
Mario Zechner 732bb1617b Merge model-registry into main 2026-06-22 14:53:24 +02:00
Mario Zechner abbd911693 Merge main into model-registry 2026-06-22 14:00:18 +02:00
Armin Ronacher 71ca9b2b92 fix(ai): expose OpenCode Go GLM-5.2 xhigh effort
closes #5967
2026-06-22 13:45:44 +02:00
Mario Zechner 717a8f958a fix(ai): revert selective pi-ai base entrypoints 2026-06-22 12:54:32 +02:00
Armin Ronacher 8e1900666f Release v0.79.10 2026-06-22 11:14:43 +02:00
Vegard Stikbakke 7d0497fdb7 fix(ai): preserve early reasoning details
closes #5114
2026-06-22 10:14:59 +02:00
Armin Ronacher 615bf2f874 Release v0.79.9 2026-06-20 22:15:37 +02:00
Armin Ronacher 500b568b04 fix(ai): use OpenAI endpoint for Fireworks GLM-5.2
closes #5923
2026-06-20 21:32:02 +02:00
Armin Ronacher 8597ebafd9 fix(ai): expose OpenRouter GLM-5.2 xhigh effort
closes #5770
2026-06-20 18:47:42 +02:00
Armin Ronacher 8b97e75c6b feat(ai): add chat-template thinking compat
closes #5673
2026-06-19 23:34:17 +02:00
Vegard Stikbakke 6e6ce70caf fix(ai): filter Copilot models by account availability
closes #5897
2026-06-19 13:17:13 +02:00
Armin Ronacher 8eb9704b3e Release v0.79.8 2026-06-19 09:53:43 +02:00
Fred K. Schott 0d89a33373 feat(packages): Add selective pi-ai base entrypoints (#5348) 2026-06-19 00:41:49 +02:00
Armin Ronacher 651d10d90b feat(ai): enable Mistral prompt caching 2026-06-18 23:47:25 +02:00
Armin Ronacher c4ab61dcbf Release v0.79.7 2026-06-18 18:22:07 +02:00
Vegard Stikbakke 58dd2f5996 feat(ai): add GLM-5.2 to OpenCode Go model catalog
closes #5860
2026-06-18 10:06:23 +02:00