Commit Graph

637 Commits

Author SHA1 Message Date
Markus Ylisiurunen
2cdac7382a fix(ai): trust requested Codex service tier (#3307) 2026-04-17 01:50:04 +02:00
Armin Ronacher
b789900570 fix(ai): type bedrock bearer auth middleware 2026-04-16 23:50:29 +02:00
wirjo
22085a9a17 feat(bedrock): support Bearer token auth for Converse API (#3125)
Adds bearer token authentication for the Bedrock Converse API, enabling
users to authenticate with an API key instead of SigV4/IAM credentials.

When a bearer token is available (via `options.bearerToken` or the
`AWS_BEARER_TOKEN_BEDROCK` env var), the provider:
1. Sets dummy credentials to prevent SDK credential resolution errors
2. Injects middleware after SigV4 signing that replaces the Authorization
   header with `Bearer <token>` and removes SigV4-specific headers

This uses the official `bedrock:CallWithBearerToken` IAM action, which
is a documented AWS feature for API key auth on Bedrock endpoints.

Use case: users who receive a Bedrock API key (bearer token) from the
AWS console or their admin, without having IAM access keys or instance
roles. Similar to how ANTHROPIC_API_KEY works for direct Anthropic API.

Required IAM permission on the token's identity:
  bedrock:CallWithBearerToken

Tested: Bearer token successfully authenticates against Bedrock Converse
API (returns correct 403 for missing IAM permission, not auth format error).
SigV4 path is unchanged when no bearer token is set.
2026-04-16 23:34:18 +02:00
Mario Zechner
5476b56e41 Add [Unreleased] section for next cycle 2026-04-16 23:26:44 +02:00
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
Armin Ronacher
aa78fa91fe Add [Unreleased] section for next cycle 2026-04-16 20:06:43 +02:00
Armin Ronacher
54bbaece5c fix(ai): rebuild models 2026-04-16 19:58:40 +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
Armin Ronacher
a91978cf19 fix(ai): add temporary Anthropic Opus 4.7 model override 2026-04-16 17:06:23 +02:00
Mario Zechner
eb1cf80b10 fix(ai,coding-agent): replace deprecated kimi k2p5 model closes #3242 2026-04-16 12:06:24 +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
e0918a627b Add [Unreleased] section for next cycle 2026-04-15 23:41:16 +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
94f24f2102 Add [Unreleased] section for next cycle 2026-04-14 23:42:08 +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
Mario Zechner
852efe9596 Add [Unreleased] section for next cycle 2026-04-14 00:23:18 +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
Zeremonienmeister Berber Aab
f05f4e8a5f Add all OpenRouter provider routing fields to OpenRouterRouting (#2904)
The OpenRouterRouting interface only had only and order, but the runtime
passes the entire object as-is to the OpenRouter API's provider field.
This means all other fields worked at runtime but had no TypeScript
type-checking, no autocomplete, and no config validation.

This adds all fields from the OpenRouter provider selection API
(https://openrouter.ai/docs/guides/routing/provider-selection):
allow_fallbacks, require_parameters, data_collection, zdr,
enforce_distillable_text, ignore, quantizations, sort, max_price,
preferred_min_throughput, preferred_max_latency.

Also fixes the models.md documentation which had an invalid fallbacks
field in the example (not part of the OpenRouter API), replaces it with
a comprehensive example showing all available fields, and clarifies that
openRouterRouting is sent as-is in the provider field.
2026-04-09 03:08:45 +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
2cf2a8528e Add [Unreleased] section for next cycle 2026-04-09 01:01:16 +02:00
Mario Zechner
da6e9ea473 chore(ai): update generated model catalog 2026-04-08 18:54:56 +02:00
Mario Zechner
377eca9684 fix(ai,coding-agent): use node:readline import prefix for Deno compatibility
closes #2885
2026-04-08 01:59:34 +02:00
Mario Zechner
78d4625a48 Add [Unreleased] section for next cycle 2026-04-06 00:26:57 +02:00
Vladyslav Tkachenko
a9bd8045d6 fix: update zai processing logic (#2855)
* feat: add new models and update zai processing logic

* chore(ai): removed overrides, simplify provider pick

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-05 23:44:17 +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
84d134061f Add [Unreleased] section for next cycle 2026-04-03 20:32:11 +02:00
Mario Zechner
9f9277ccdd refactor(coding-agent): replace AgentSessionRuntimeHost with closure-based AgentSessionRuntime
- Replace AgentSessionRuntimeHost and bootstrap abstractions with AgentSessionRuntime
- Runtime creation is now closure-based via CreateAgentSessionRuntimeFactory
- Factory closes over process-global fixed inputs, recreates cwd-bound services per effective cwd
- Session config (model, thinking, tools, scoped models) re-resolved per target cwd
- CLI resource paths resolved once at startup as absolute paths
- Swap lifecycle: teardown old, create next, apply next (hard fail on creation error)
- Unified diagnostics model (info/warning/error) for args, services, session resolution, resources
- No logging or process exits inside creation/parsing logic
- Removed session_directory support
- Removed session_switch and session_fork extension events (use session_start with reason)
- Moved package/config CLI to package-manager-cli.ts
- Fixed theme init for --resume session picker
- Fixed flaky reftable footer test (content-based polling)
- Fixed silent drop of unknown single-dash CLI flags
- Added error diagnostics for missing explicit CLI resource paths
- Updated SDK docs, examples, plans, exports, tests, changelog

fixes #2753
2026-04-03 20:14:12 +02:00
Mario Zechner
2f8019b610 fix(ai): emit missing responses toolcall delta closes #2745 2026-04-02 01:39:32 +02:00
Mario Zechner
39b1bf7b62 fix(ai): detect anthropic request_too_large overflow closes #2734 2026-04-01 23:51:27 +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
cbe1a8b732 fix(agent): simplify state API and update consumers fixes #2633 2026-03-30 12:43:34 +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
567249e8b4 Add [Unreleased] section for next cycle 2026-03-29 13:14:04 +02:00
Mario Zechner
bc8eb74b82 fix(ai): detect Ollama overflow errors closes #2626 2026-03-27 02:50:22 +01:00
Gordon Hui
17625cc8a2 feat(ai): add google-vertex gemini-3.1-pro-preview-customtools (#2610) 2026-03-27 02:45:58 +01:00
Mario Zechner
e24a61ef01 Add [Unreleased] section for next cycle 2026-03-27 02:31:10 +01:00
Mario Zechner
10a02d461b chore(ai): update generated models 2026-03-27 00:47:40 +01:00
Mario Zechner
76f6f8cb8b fix(coding-agent,ai): restore main syntax and apply biome formatting 2026-03-26 00:12:26 +01:00
Mario Zechner
6dc43d6dd1 fix(ai): prune deprecated direct minimax models 2026-03-25 22:44:32 +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
05c17cfbfe Add [Unreleased] section for next cycle 2026-03-23 02:50:43 +01:00