diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab1ff017..26aa9f7d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Bumped AI SDK and associated packages version. [#1126](https://github.com/sourcebot-dev/sourcebot/pull/1126) +### Fixed +- Fixed issue where claude-opus-4-7 was returning "error occurred "thinking.type.enabled" is not supported for this model". [#1123](https://github.com/sourcebot-dev/sourcebot/issues/1123) + ## [4.16.9] - 2026-04-15 ### Added diff --git a/packages/web/src/features/chat/utils.server.ts b/packages/web/src/features/chat/utils.server.ts index 4e7af7983..9d00459f4 100644 --- a/packages/web/src/features/chat/utils.server.ts +++ b/packages/web/src/features/chat/utils.server.ts @@ -210,11 +210,17 @@ export const getAISDKLanguageModelAndOptions = async (config: LanguageModel): Pr : undefined, }); + const isAdaptiveThinkingSupported = + modelId.startsWith('claude-opus-4-7'); + return { model: anthropic(modelId), providerOptions: { anthropic: { - thinking: { + thinking: isAdaptiveThinkingSupported ? { + type: "adaptive", + display: "summarized" + } : { type: "enabled", budgetTokens: env.ANTHROPIC_THINKING_BUDGET_TOKENS, }