Changes
PR #2207 by scottidler and ksylvan: fix(anthropic): adaptive thinking on Claude 5 + add --maxTokens flag
- Added a
--maxTokensCLI flag that caps model output tokens, wiring the existingChatOptions.MaxTokensfield through to the provider; a value of0preserves the vendor default, so existing behavior is unchanged. - Fixed Anthropic thinking support on Claude 5 models (
claude-sonnet-5,claude-opus-5,claude-fable-5), which rejected the legacythinking.type=enabledplusbudget_tokensshape and returned HTTP 400 for every--thinkingvalue exceptoff. - Reworked
parseThinkingto select the correct request shape per model:thinking.type=disabledforoff, adaptive thinking withoutput_config.effortfor Claude 5, and the legacy enabled/budget shape for older models. - Preserved numeric thinking budgets on adaptive models by bucketing them onto the nearest effort level using the same thresholds as the named levels, so
--thinking=2048and--thinking=mediumbehave consistently. - Added
--maxTokensshell completion support for Bash, Zsh, and Fish, treating it as an option that requires an argument.