co-mono/packages/ai/src
Mario Zechner 8df22faedf fix(ai): ensure maxTokens > thinkingBudget for Claude thinking models
Claude requires max_tokens > thinking.budget_tokens. When caller specifies
a small maxTokens (e.g. compaction with ~13k tokens) and reasoning is enabled
with high budget (16k tokens), the constraint was violated.

Fix: In mapOptionsForApi, add thinkingBudget on top of caller's maxTokens
(capped at model.maxTokens). If still not enough room, reduce thinkingBudget
to leave space for output.

Applied to both anthropic-messages and google-gemini-cli APIs.

Also adds test utilities for OAuth credential resolution and tests for
compaction with thinking models.

fixes #413
2026-01-03 02:45:30 +01:00
..
providers Fix google-vertex build 2026-01-03 01:11:03 +01:00
utils Use dynamic import for http module in OAuth files 2025-12-30 22:42:21 +01:00
cli.ts WIP: Add CLI for OAuth login, update README 2025-12-25 01:09:27 +01:00
index.ts Add Vertex AI provider with ADC support 2026-01-03 01:11:03 +01:00
models.generated.ts Fix google-vertex build 2026-01-03 01:11:03 +01:00
models.ts fix: use consistent model comparison including provider 2025-12-25 22:10:08 +01:00
stream.ts fix(ai): ensure maxTokens > thinkingBudget for Claude thinking models 2026-01-03 02:45:30 +01:00
types.ts Add Vertex AI provider with ADC support 2026-01-03 01:11:03 +01:00