Commit Graph

302 Commits

Author SHA1 Message Date
Vegard Stikbakke 45f1a2cd00 fix(ai): set session id headers for all OpenAI compatible responses (#3264) 2026-04-16 22:38:40 +02:00
Mario Zechner acbf8eca06 feat(ai): add thinkingDisplay option for Anthropic and Bedrock Claude
Exposes the new ThinkingConfig.display field on Anthropic and Bedrock
Claude providers. Defaults to 'summarized' so Claude Opus 4.7 and Mythos
Preview keep returning thinking text despite Anthropic's silent default
change to 'omitted'. Set to 'omitted' explicitly to skip thinking
streaming for faster time-to-first-text-token.
2026-04-16 22:12:06 +02:00
Mario Zechner a5f9f47d13 fix(ai): restore changelog and sdk type compatibility 2026-04-16 20:32:23 +02:00
Mario Zechner d131fcd4ba feat(coding-agent): add after_provider_response hook closes #3128 2026-04-16 20:28:08 +02:00
Markus Ylisiurunen d1c6cb1e0f fix(ai): Fix a configuration bug with Opus 4.7 adaptive thinking (#3286) 2026-04-16 19:57:19 +02:00
Mario Zechner 1c016cb018 fix(ai): cache Anthropic tools separately from transcript closes #3260 2026-04-16 11:31:58 +02:00
Mario Zechner b920622110 refactor(ai): extract synthetic tool result helper 2026-04-15 20:53:21 +02:00
deepkilo 3a13fa80c8 fix(ai): treat gcp vertex marker as ADC auth (#3221) 2026-04-15 16:20:45 +02:00
Mario Zechner 018b40c30c fix: align OpenAI cache affinity and use uuidv7 session ids 2026-04-14 23:20:13 +02:00
Armin Ronacher e2b40dfc81 fix(ai): strip partialJson from responses tool calls
Mutate persisted tool-call blocks in place on function_call completion,
remove partialJson, and emit the same reference on toolcall_end.
Add regression coverage for persisted block cleanup and event identity.

fixes #3078
2026-04-14 18:56:53 +02:00
Markus Ylisiurunen f829f80885 fix(ai): support service tier in codex responses (#2996) 2026-04-13 11:04:11 +02:00
Aadish Verma 4f7fc9de7e fix: bump antigravity User-Agent header version (#2901)
resolves #2815

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-09 03:10:05 +02:00
Aadish Verma ee2483cd34 fix: update google provider to handle gemma 4 thinking levels and route between MINIMAL and HIGH (#2903)
resolves #2812

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-09 03:08:00 +02:00
Jason b48d802930 fix(ai): correct thinking budget for 2.5-flash-lite models (#2861)
The 2.5-flash-lite model was incorrectly matching the 2.5-flash
case, setting minimal budget to 128. Per Google's docs, flash-lite's
minimum thinking budget is 512, not 128. This caused the error:

  The thinking budget 128 is invalid. Please choose a value between
  512 and 24576.

Add a dedicated 2.5-flash-lite case before the 2.5-flash case so
the more specific match takes priority.

Fixes #2838

Co-authored-by: JasonOA888 <JasonOA888@users.noreply.github.com>
2026-04-09 03:03:45 +02:00
Mario Zechner 6044cabb15 fix(ai): preserve cache_write_tokens in completions stream usage closes #2802 2026-04-04 21:39:11 +02:00
Mario Zechner 2f8019b610 fix(ai): emit missing responses toolcall delta closes #2745 2026-04-02 01:39:32 +02:00
Kao Félix 758ede4da0 Enable tool streaming for newer Z.ai models (#2732) 2026-03-31 14:28:24 +02:00
xu0o0 a3bf1eb399 fix(ai): fix bedrock throttling misidentification (#2699)
- Add NON_OVERFLOW_PATTERNS to explicitly exclude known non-overflow errors
- Consolidate Cerebras 400/413 no-body check into OVERFLOW_PATTERNS
- Format Bedrock errors as ${error.name}: ${error.message} for pattern matching
2026-03-30 17:26:03 +02:00
Mario Zechner ef6af5ebbd feat(ai,coding-agent): add faux provider and ModelRegistry factories 2026-03-29 21:08:50 +02:00
Mario Zechner 76f6f8cb8b fix(coding-agent,ai): restore main syntax and apply biome formatting 2026-03-26 00:12:26 +01:00
sparkleMing 6d744f02ef fix: subtract cached tokens from input in Google and Vertex cost calculation (#2588)
Google's promptTokenCount includes cachedContentTokenCount, so using it
directly as the input token count causes double-counting when calculateCost
multiplies input by the input rate AND cacheRead by the cacheRead rate.

The google-gemini-cli provider already handles this correctly (subtracting
cachedContentTokenCount from promptTokenCount), but google.ts and
google-vertex.ts were using the raw promptTokenCount.

This fix aligns both providers with the google-gemini-cli behavior.
2026-03-25 22:02:28 +01:00
Mario Zechner bab58f821d fix(ai): omit copilot responses reasoning default closes #2567 2026-03-24 20:39:11 +01:00
Mario Zechner d1613e3f53 fix(ai): handle explicit thinking off across providers closes #2490 2026-03-22 20:27:44 +01:00
Mario Zechner 6129971c04 fix(ai): explicitly disable Anthropic thinking when off closes #2022 2026-03-22 19:38:54 +01:00
wjonaskr 3bcbae490c feat(ai): add requestMetadata support to BedrockOptions for cost allocation tagging (#2511)
Add an optional requestMetadata field to BedrockOptions that forwards
key-value pairs to the Bedrock Converse API ConverseStreamCommand. Tags
appear in AWS Cost Explorer split cost allocation data, enabling callers
to attribute inference costs to specific applications or contexts.

Changes:
- Add requestMetadata?: Record<string, string> to BedrockOptions with
  JSDoc documenting AWS constraints (max 50 pairs, key 64 chars, value
  256 chars, no aws: prefix)
- Pass requestMetadata to commandInput via conditional spread to avoid
  sending undefined when omitted
- Export BedrockOptions from package root (consistent with other
  provider option types)
- Add E2E tests: metadata forwarded to SDK payload, and omitted when
  not provided

closes #2510
2026-03-22 19:05:55 +01:00
Mario Zechner b21b42d032 fix(ai): hash foreign responses tool item ids 2026-03-22 05:40:26 +01:00
Cheng-Zi-Qing 7e2689ac18 packages/ai: ignore null chunks in openai-completions streams (#2466) 2026-03-20 20:01:28 +01:00
Mario Zechner ff1ea12324 fix(ai): ignore placeholder vertex api keys closes #2335 2026-03-18 22:51:14 +01:00
PriNova f704ee7255 fix(ai): use OpenRouter reasoning payload (#2298)
* fix(ai): use OpenRouter reasoning payload

* fix(coding-agent): stop updating packages on startup closes #1963

* fix(ai): add openrouter thinkingFormat compat

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-03-18 11:23:27 +01:00
xu0o0 31d59f8513 fix(ai): support prompt caching for Bedrock application inference profiles (#2346)
Add AWS_BEDROCK_FORCE_CACHE=1 environment variable support. When the
model ID doesn't contain a recognizable Claude model name, users can
set this variable to force cache point injection.
2026-03-18 11:21:10 +01:00
Mario Zechner b2548ce489 fix(ai): normalize replayed responses tool call ids closes #2328 2026-03-18 03:37:40 +01:00
Mario Zechner 453b22397d fix(ai): keep image tool results inline for gemini 3+ and antigravity closes #2052 2026-03-18 02:17:44 +01:00
Mario Zechner 8dc2bb969c fix(coding-agent,ai): restore Bun binary lazy provider loading closes #2314 2026-03-17 23:30:18 +01:00
Mario Zechner d914d1c199 fix(coding-agent): handle z.ai network_error closes #2313 2026-03-17 22:34:49 +01:00
Mario Zechner a7559f01e9 feat(ai): lazy-load provider modules for faster startup fixes #2297 2026-03-17 18:03:24 +01:00
Mario Zechner dd53eb56ee fix(ai): expose provider response ids on assistant messages fixes #2245 2026-03-17 17:11:38 +01:00
Mario Zechner 635bda80d4 Merge commit 0acb65fe from PR #2058 2026-03-17 13:31:00 +01:00
Mario Zechner ad48b52de4 fix(ai): align codex websocket headers and terminate SSE closes #1961 2026-03-14 12:23:17 +01:00
Mario Zechner 1a4d153d7a fix(ai): limit Bedrock prompt caching to Claude models\n\ncloses #2053 2026-03-14 05:20:41 +01:00
Mario Zechner 03ad7ecee7 fix(ai): add qwen-chat-template compat mode closes #2020 2026-03-14 05:20:27 +01:00
Mario Zechner c961cda2cd fix(ai): harden Bedrock unsigned thinking replay closes #2063 2026-03-14 05:06:14 +01:00
Mario Zechner a79ca41190 fix(ai): handle unknown finish_reason in openai-completions gracefully
Map unknown finish_reason values (e.g. "end" from Ollama/LM Studio) to
"stop" instead of throwing, since assistant content is already produced.

fixes #2142
2026-03-14 04:01:22 +01:00
Mario Zechner 933348593c fix(ai): send tool result images in function_call_output closes #2104 2026-03-14 00:49:40 +01:00
Mario Zechner 92882dc4cc fix(ai): improve anthropic oauth flow fixes #2119 2026-03-13 22:38:34 +01:00
sallyom 0acb65fe1c feat: allow injecting pre-built Anthropic client
Add optional `client` field to AnthropicOptions so callers can pass
alternative SDK clients (e.g. AnthropicVertex) that
share the same messages.stream() API. When omitted, behavior is unchanged.

Signed-off-by: sallyom <somalley@redhat.com>
2026-03-11 11:58:29 -04:00
Mario Zechner 4535415300 fix(ai): capture usage from choice.usage for non-standard OpenAI-compatible providers
Some OpenAI-compatible providers (e.g., Moonshot/Kimi) return usage
data in chunk.choices[0].usage instead of the standard chunk.usage.
Extract usage parsing into a helper and check choice.usage as fallback.

closes #2017
2026-03-10 16:28:39 +01:00
Geraldo Dutra Neto 23109b113d fix: send assistant content as string in openai-completions provider (#2008)
The OpenAI Chat Completions API standard format for assistant message
content is a plain string. Sending it as an array of
{type:"text", text:"..."} objects causes some models (notably DeepSeek
V3.2 via NVIDIA NIM) to mirror the content-block structure literally
in their output. This produces recursive nesting where each turn wraps
the previous content blocks deeper:

  [{'type':'text','text':'[{\'type\':\'text\',\'text\':...}]'}]

The fix unifies the assistant content serialization to always use a
joined string — the same approach already used for the github-copilot
provider — for all openai-completions backends.

Affected models observed: deepseek-ai/deepseek-v3.2 (nvidia provider).
Models like GLM-5, GPT-4, Claude were unaffected as they tolerate
array content, but sending a standard string is safer for all.

Co-authored-by: geraldoaax <geraldoaax@users.noreply.github.com>
2026-03-10 16:04:11 +01:00
Gordon Hui 01f7faae9c fix(ai): support GOOGLE_CLOUD_API_KEY for google-vertex (#1948) (#1976) 2026-03-09 13:30:22 +01:00
Drew Brown d9cfa115be fix(ai): improve error details in response.failed handler (#1956) 2026-03-08 21:34:01 +01:00
Mario Zechner a3f05423d9 feat(coding-agent): add provider payload hook 2026-03-07 14:34:28 +01:00