fix(ai): stop defaulting max token request caps

closes #4675
This commit is contained in:
Mario Zechner
2026-05-19 11:49:44 +02:00
parent 5e8f0cf45e
commit 2787b601d7
6 changed files with 51 additions and 20 deletions

View File

@@ -314,8 +314,10 @@ export const streamSimpleBedrock: StreamFunction<"bedrock-converse-stream", Simp
} satisfies BedrockOptions);
}
// Undefined means the caller did not request an output cap; let the helper use the model cap.
// Do not coerce to 0 here, or the thinking budget would become the entire maxTokens value.
const adjusted = adjustMaxTokensForThinking(
base.maxTokens || 0,
base.maxTokens,
model.maxTokens,
options.reasoning,
options.thinkingBudgets,