1667 Commits

Author SHA1 Message Date
David Brailovsky 6731a0ba9e fix: send anthropic thinking blocks also when thinking text is empty (#6457)
fixes: #6376
2026-07-09 23:25:22 +02:00
Armin Ronacher 3664806f2f fix(ai): add GPT-5.4 and GPT-5.5 long-context pricing 2026-07-09 23:13:58 +02:00
Armin Ronacher a9ecf301fb feat(ai): add input-based pricing tiers 2026-07-09 22:44:29 +02:00
Armin Ronacher 6c735db060 fix(ai): exclude nonexistent GPT-5.6 alias 2026-07-09 22:44:08 +02:00
Mario Zechner fbdd46389c feat(ai): add max thinking level 2026-07-09 22:30:53 +02:00
Mario Zechner 8973ae28ab fix(ai): ignore stale usage after compaction
closes #6464
2026-07-09 21:44:53 +02:00
Armin Ronacher e3513193bf Add [Unreleased] section for next cycle 2026-07-09 21:04:09 +02:00
Armin Ronacher cc62baa442 Release v0.80.5 2026-07-09 21:04:06 +02:00
Armin Ronacher ef793a983b Add [Unreleased] section for next cycle 2026-07-09 20:53:01 +02:00
Armin Ronacher 912d0953f6 Release v0.80.4 2026-07-09 20:52:57 +02:00
Armin Ronacher bf75b8aa39 docs: audit unreleased changelogs 2026-07-09 20:45:28 +02:00
Armin Ronacher 7df2a94e0f feat(ai): add GPT-5.6 model metadata 2026-07-09 20:32:29 +02:00
David Brailovsky 57d96d72ed add ResourceExhausted as a retryable error (#6449)
fixes #6364
2026-07-09 13:58:32 +02:00
Mario Zechner 4285712bae fix(ai): retry Bun socket drops
closes #6431
2026-07-09 11:03:58 +02:00
Mario Zechner 72d77b53de fix(ai): update model catalogues 2026-07-09 11:03:58 +02:00
Mario Zechner 9eedaf8cf3 fix(ai): update GitHub Copilot extended context windows to 1M
Updates GitHub Copilot built-in model metadata so models with GitHub's extended 1M capability use contextWindow 1000000 in Pi, preventing early compaction and under-budgeting for Claude Opus 4.7/4.8 and GPT-5.3 Codex/5.4/5.5.

Verified against raw docs markdown extended-capabilities table and live /models reports.

closes #6439
2026-07-09 10:39:27 +02:00
Vegard Stikbakke cc2db98002 fix(ai): refresh Xiaomi token plan model catalogs
Use the new provider-specific Xiaomi Token Plan catalogs from models.dev instead of cloning the API-billing Xiaomi catalog into every token-plan region. This removes API-billing-only models such as mimo-v2-omni from xiaomi-token-plan-{cn,ams,sgp}.
2026-07-08 10:17:48 +02:00
Samwise Wang 279f53b098 fix(ai): use "(no tool output)" placeholder for empty tool results without images (#6290)
OpenAI Completions and Responses providers unconditionally replaced empty
tool result text with "(see attached image)", even when the result had no
image content. This caused the model to hallucinate image attachments for
commands that produce no output (e.g. curl -s with SSL errors, grep with
no matches, true/false).

Now matches the Google provider behavior: "(see attached image)" is only
used when images are actually present; empty results get "(no tool output)".

Co-authored-by: tzwm <tzwm@users.noreply.github.com>
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-07-06 21:42:56 +02:00
Armin Ronacher 8c0ccd14b3 fix(ai,agent,coding-agent): normalize null message content at ingestion boundaries (#6343)
The Message types require content to always be present, but untyped JS
extension tools, hand-built histories, and old or hand-edited session
files can violate that contract, crashing rendering, compaction, and
provider request conversion with 'content is not iterable'.

Normalize null/missing content to an empty array at the ingestion
boundaries instead of guarding every consumer:

- transformMessages (choke point before every provider request)
- createToolResultMessage in the agent loop
- session entry loading (message and custom_message entries)
- extension custom messages (sendCustomMessage, before_agent_start)
- message_end extension replacements

fixes #6259, fixes #6276
2026-07-06 20:47:08 +02:00
Armin Ronacher 2e4ad6a094 fix(ai): clamp OpenAI Responses max output token floor
closes #6265
2026-07-06 02:21:15 +02:00
Armin Ronacher 478301342b test: use quiet dot reporters and show output only for failing tests
Switch vitest packages (ai, agent, coding-agent) to the dot reporter
with silent: passed-only so passing tests stay quiet while failing
tests still print their console output and full diffs. Add the
github-actions reporter on CI for inline annotations. Switch the tui
node:test runner to the dot reporter as well.
2026-07-05 23:17:17 +02:00
Armin Ronacher 035ea9c856 fix: remove redundant record guards 2026-07-05 18:55:09 +02:00
Vegard Stikbakke ee24a9ec54 feat(ai): refresh generated model catalogs
closes #6256
2026-07-04 06:27:58 +02:00
Vegard Stikbakke d53b567601 fix(ai): retry Cloudflare 524 timeouts
closes #6239
2026-07-03 23:03:35 +02:00
Vegard Stikbakke 8133c94db9 fix(ai): honor server-provided slow_down interval in device-code polling
GitHub's device flow documents slow_down as a rate limit: a poll that
arrives inside the throttle window is answered with slow_down instead of
the token, and the response's interval field reports the new required
minimum ("adds 5 seconds to the last interval"). A client that only
tracks its own +5s increment can stay behind the server's ratcheting
requirement when its timers fire early - common with WSL/VM clock drift
(microsoft/WSL#10006) - so every subsequent poll keeps hitting the rate
limit and login appears to hang forever even after the browser reports
the device as authorized.

Adopt the server-provided interval when a slow_down poll result carries
one, falling back to the RFC 8628 section 3.5 +5s increment otherwise.
GitHub Copilot passes the interval field through.

This restores part of the #1994 mitigations that were lost in the #4788
device-code refactor.

refs #6187
2026-07-03 22:26:12 +02:00
Vegard Stikbakke 23d1462611 fix(ai): rotate stale Codex websocket sessions
closes #6268
2026-07-03 15:30:41 +02:00
Vegard Stikbakke 21cb3807e7 fix(ai): detect DS4 context overflow errors
closes #6262
2026-07-02 20:39:49 +02:00
Vegard Stikbakke 114bacf349 fix(ai): enable Bedrock prompt caching for Claude 5
closes #6235
2026-07-02 11:00:20 +02:00
Vegard Stikbakke e285e90fdb fix(ai): remove Copilot Sonnet 5 fallback in generate-models 2026-07-01 23:01:33 +02:00
Vegard Stikbakke e2ccdc8509 fix(ai): delay Copilot device-code token polling
closes #6187
2026-07-01 13:48:11 +02:00
Vegard Stikbakke 8c9436407c fix(ai): remove stale model metadata fallbacks 2026-07-01 10:53:09 +02:00
Vegard Stikbakke 1da1cdb2fb chore(ai): regenerate models
Picked up upstream models.dev/OpenCode catalog drift while
regenerating for the Fireworks GLM 5.2 Fast fix: Cloudflare AI Gateway
and OpenCode gain Claude Sonnet 5; OpenCode gains Kimi K2.7 Code and
MiniMax-M3; MiniMax model name formatting normalized to MiniMax-Mx.x.
2026-07-01 10:35:38 +02:00
Vegard Stikbakke 844d175eaf fix(ai): align Fireworks GLM 5.2 Fast with GLM 5.2
Broaden the Fireworks GLM 5.2 special-case in generate-models.ts from
an exact id match to a glm-5p2 substring match, so the router variant
accounts/fireworks/routers/glm-5p2-fast also uses the OpenAI-compatible
endpoint and thinkingLevelMap instead of falling back to the default
Anthropic Messages config.

closes #6195
2026-07-01 10:34:46 +02:00
Vegard Stikbakke 1d061b3f45 fix(ai): remove stale model metadata fallbacks 2026-07-01 10:03:26 +02:00
Vegard Stikbakke 4206376410 feat(ai): add Copilot Claude Sonnet 5
closes #6200
2026-07-01 09:57:04 +02:00
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 dd87c02cbf Add [Unreleased] section for next cycle 2026-06-30 22:29:44 +02:00
Mario Zechner a23abe4a69 Release v0.80.3 2026-06-30 22:29:41 +02:00
Mario Zechner f98a154d87 docs: audit changelog entries 2026-06-30 22:24:42 +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