Commit graph

1763 commits

Author SHA1 Message Date
Michael Yu
2f8b4b42fe
fix(ai): expose low reasoning effort for native DeepSeek V4 Flash (#7807) 2026-08-11 11:15:11 +02:00
Maximo Guk
230029078d
feat(ai): AI Gateway transport over the Cloudflare AI binding (#7901)
Add createGatewayBindingFetch: a FetchFunction factory that intercepts
requests bound for an AI Gateway HTTPS endpoint and re-issues them
through the Workers AI binding's universal endpoint
(env.AI.gateway(id).run()). Binding calls are pre-authenticated
in-account, so Workers running inside the gateway's account need no
cf-aig-authorization API token.

The shim is transport-only: it composes with the existing gateway
passthrough base URLs and every API implementation that honors
StreamOptions.fetch, preserving each provider's native wire format
(verified: workers-ai v1/chat/completions OpenAI-compat SSE streams
incrementally; anthropic v1/messages and openai responses route
end-to-end; cf-aig-log-id is present and readable via gateway getLog).

Binding types are structural, so no @cloudflare/workers-types
dependency and no impact on browser bundling.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 11:09:30 +02:00
初心Yearth
b647d18793
fix(ai): detect DeepSeek base URLs case-insensitively (#7933) 2026-08-11 10:49:19 +02:00
muyiyr
75c7fd6623
fix(ai): declare Cloudflare Responses strict tools (#7934)
Fixes #7896
2026-08-11 09:07:12 +02:00
muyiyr
98145a6c06
fix(ai): sanitize empty Bedrock tool argument keys (#7882)
* fix(ai): sanitize empty Bedrock tool argument keys

fixes #7782

* fix(ai): preserve Bedrock tool argument semantics
2026-08-10 21:46:42 +02:00
David Brailovsky
afae6a1a99 fix(ai): update stale Gemini test model 2026-08-10 15:22:18 +02:00
David Brailovsky
c185d41238 fix(ai): send max_tokens to DeepSeek APIs
Auto-detect DeepSeek in generated and runtime compatibility metadata so built-in and custom models use the supported token limit field.
2026-08-08 18:42:07 +02:00
Mario Zechner
9dd90a4971 fix(ai): replace Mistral SDK with native transport 2026-08-08 09:32:49 +02:00
Armin Ronacher
e47b8e37a6 feat(ai): use additional_tools for deferred tools
closes #7709
2026-08-07 23:05:23 +02:00
Armin Ronacher
02bd2d1c62 fix(ai): preserve Responses tool-call namespaces
closes #7709
2026-08-07 23:05:23 +02:00
David Brailovsky
c3e7bc60a1
feat(ai): preserve Codex end_turn for debugging (#7766) 2026-08-07 18:03:12 +02:00
Mario Zechner
fe10558eb3 fix(ai): retry upstream request buffer failures 2026-08-07 14:16:50 +02:00
Mario Zechner
f0feecd752 fix(ai): update OpenCode completions fixture 2026-08-07 11:56:59 +02:00
Armin Ronacher
310411ba46 Add [Unreleased] section for next cycle 2026-08-07 07:48:13 +02:00
Armin Ronacher
53fa77ccd8 Release v0.84.1 2026-08-07 07:48:13 +02:00
Armin Ronacher
6ba4d23e7c docs: audit changelogs since v0.84.0 2026-08-07 07:47:42 +02:00
Mehmet Aras
c03d78bdce
feat(ai): add Qwen Token Plan Individual provider (#7659) 2026-08-06 17:18:02 +02:00
Armin Ronacher
38e8f28113 Add [Unreleased] section for next cycle 2026-08-06 12:33:01 +02:00
Armin Ronacher
a5f43bf8af Release v0.84.0 2026-08-06 12:32:57 +02:00
David Brailovsky
b9497c8c1f fix(ai): correct Fireworks GLM prompt caching, closes #7676 2026-08-06 11:30:30 +02:00
Vegard Stikbakke
c0947e6448 fix(ai): remove stale adaptive thinking model expectation
models.dev was updated and no longer includes the Vercel AI Gateway claude-opus-5-fast model.
2026-08-06 08:17:18 +02:00
Armin Ronacher
b0bd0ff9d5 fix(coding-agent): only label known subscriptions in footer 2026-08-06 07:47:35 +02:00
Mario Zechner
6b461b75b3 feat: extract telemetry package 2026-08-05 23:23:12 +02:00
Armin Ronacher
db48124e9d docs: audit unreleased changelogs 2026-08-05 23:11:21 +02:00
Armin Ronacher
639a4664a5 fix(ai): update Anthropic abort test model 2026-08-05 23:03:00 +02:00
Ben
d07889da0e
feat(ai): support thinking_token_budget on openai-completions (#7638)
vLLM caps the reasoning phase with a top-level thinking_token_budget. On
OpenAI-compatible endpoints reasoning and the answer share max_tokens, so a
reasoning-heavy turn can consume the entire response ceiling and return no
answer and no tool call — the agent loop then sees a message without tool
calls and ends the run as if it had finished.

thinkingBudgets from #529 already carries per-level budgets, but only the
Anthropic and Google paths read it. This wires it into openai-completions
behind a new opt-in compat flag, and clamps the budget so at least
MIN_ANSWER_TOKENS remain for the answer.

The flag is independent of thinkingFormat because one vLLM server can serve
zai, qwen and chat-template models.

Co-authored-by: Ben Shaharizad <ben.shaharizad@taboola.com>
2026-08-05 22:27:51 +02:00
QuintinShaw
2f7f75a20e
fix(ai): replace qwen3.8-max-preview with qwen3.8-max on token plan (#7670)
GA qwen3.8-max is on models.dev for alibaba-token-plan[-cn]. Point the
Qwen3.8 effort map at the GA id and exclude the retired preview so
regenerate does not revive it.
2026-08-05 22:16:20 +02:00
muyiyr
14cc26e86d
fix(ai): restore Copilot models from account policy (#7672)
* fix(ai): fall back to Copilot model policy

fixes #7634

* fix(ai): scope Copilot policy fallback
2026-08-05 22:15:51 +02:00
Mario Zechner
04d6447f7c feat: add typed telemetry contracts 2026-08-05 22:03:33 +02:00
Armin Ronacher
71f6c25c36 fix(ai): update Groq Qwen reasoning override 2026-08-04 21:24:56 +02:00
Vegard Stikbakke
d3da2e968a fix(ai): test composite OAuth refresh cancellation 2026-08-04 13:01:11 +02:00
Mario Zechner
686f193e51 fix(ai): separate deferred request options 2026-08-04 12:45:00 +02:00
Vegard Stikbakke
720f0e8eeb fix(ai): route Copilot Grok 4.5 through Responses, closes #7560 2026-08-04 12:42:01 +02:00
Vegard Stikbakke
b784c80961 fix(ai): remove OAuth refresh lock test 2026-08-04 12:19:19 +02:00
Vegard Stikbakke
acbdc0d25e fix(ai): bound OAuth refresh duration
closes #7508
2026-08-04 12:12:32 +02:00
David Brailovsky
382aa641cc
DRAFT: add openai background mode responses (#7339)
* initial attempt at implementing openai background responses api

* feat(ai): align deferred responses with harness spec

* fix: reject deferred messages in protocol v1
2026-08-04 11:27:47 +02:00
Duncan Ogilvie
25a2c8dcfe
Add support for generic sampling parameters (#7568) 2026-08-04 00:05:29 +02:00
Mario Zechner
fed6009cc9 fix(coding-agent): make model refresh cancellation caller-owned
Add generation-safe catalog publication, cancellable auth and storage operations, locally consistent credential mutations, and cache-first interactive model flows.
2026-08-04 00:03:52 +02:00
David Brailovsky
32850ef7c5
fix(coding-agent): resume after context-limited length stops (#7540)
* fix(coding-agent): resume after context-limited length stops

Treat length stops as context overflow when prompt usage is within 1% of
Pi's configured context window. Include cache-write tokens in that usage
and allow non-zero output because OpenAI may emit reasoning tokens before
returning an incomplete response.

After compaction, remove any retryable error or truncated-length assistant
message restored from persisted session history so the interrupted agent
turn can continue.

This is specifically for handling this case for openai models:
https://developers.openai.com/api/docs/guides/reasoning

> If the generated tokens reach the context window limit or the max_output_tokens value you’ve set, you’ll receive a response with a status of incomplete and incomplete_details with reason set to max_output_tokens. This might occur before any visible output tokens are produced, meaning you could incur costs for input and reasoning tokens without receiving a visible response.

This detection currently assumes the reported prompt usage is within 1% of
the context window configured in Pi. Its reliability therefore depends on
Pi's model contextWindow metadata matching the provider's effective limit.

Maybe we should consider treating OpenAI incomplete responses as requiring compaction
regardless of the local context-window estimate?

fixes #7020

* fix(coding-agent): recover truncated responses after compaction

Classify length stops by comparing provider-reported output usage with the model's intended output limit. Compact and retry once when generation ends below that limit, avoiding unreliable context-window estimates while preserving genuine max-output stops.

Normalize OpenAI Responses incomplete reasons so only max_output_tokens is treated as a length stop. Preserve qualified provider reasons for diagnostics, surface other reasons as errors, and use neutral truncation wording in the TUI.
2026-08-03 18:07:53 +02:00
Armin Ronacher
e563301dd3 fix(ai): avoid stale Copilot model in overflow test 2026-08-03 17:20:49 +02:00
David Brailovsky
c1019d9202 feat(ai): add Baseten provider
Closes #7405
2026-08-03 14:33:21 +02:00
Cristina Poncela Cubeiro
2e95584dab
fix: validateToolArguments() coerces nullable union (#7373)
* fix: validateToolArguments() coerces values that already match a nullable union

* changeloggg
2026-08-03 13:58:51 +02:00
muyiyr
cbaca60389
fix(ai): preserve Gemini 3 tool call IDs (#7494)
fixes #7047
2026-08-03 13:45:01 +02:00
Jadugar
b9d360a2c7
fix(ai): retry transient provider errors in Google adapters (#7471)
The google-vertex and google-generative-ai adapters called
client.models.generateContentStream bare, so a transient 429/5xx before
the first token became a terminal errored assistant message instead of
being retried like in the Anthropic, OpenAI, Azure, and OpenRouter
adapters. Wrap the initial request in the shared retryProviderRequest
via a new retryGoogleRequest helper that also normalizes @google/genai's
ApiError, which has a status property but no headers property, so
retryProviderRequest's provider-error guard recognizes it.

Opt-in via the existing maxRetries stream option; default behavior is
unchanged.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-03 12:45:45 +02:00
Christian Klotz
0c611753d9
fix(ai): update Z.AI model test references 2026-07-31 22:48:17 +03:00
Christian Klotz
784653468c
Merge pull request #7364 from earendil-works/fix/codex-account-websocket
fix(ai): scope Codex sockets to accounts
2026-07-31 14:43:08 +03:00
David Brailovsky
a688e257c5 fix(ai): route Fireworks Kimi K3 through OpenAI compatibility
closes #7199

Co-authored-by: Fedir Skitsko <fedya@skitsko.com>
2026-07-31 12:47:07 +02:00
Christian Klotz
cfe6b6a058
fix(ai): scope Codex sockets to accounts
Fixes #7284

Co-authored-by: vince <vincelwt@users.noreply.github.com>
2026-07-31 12:58:56 +03:00
David Brailovsky
59ad3dead3
fix(ai): preserve Anthropic initial stream block content (#7358)
fixes #7283
2026-07-31 10:39:38 +02:00
jingtao
6138f5a079
fix(ai): keep signed empty text/thinking blocks in google history (#7362)
Gemini can attach thoughtSignature to a part whose visible text is
empty and requires it echoed back; convertMessages dropped such blocks
together with the signature, breaking the reasoning chain. With the
chain broken, gemini flash models intermittently end a mid-task turn
with a thought-only STOP and no tool call. Empty blocks are now dropped
only when they are unsigned, mirroring the anthropic converter.

Co-authored-by: Jingtao Xu <jingtaozf@gmail.com>
2026-07-31 10:30:38 +02:00