fix(shared): guard maxOutputTokens <= 0 in model settings compatibility (#3305)
When model metadata reports maxOutputTokens as 0 or negative, the clamp logic would set maxTokens to 0 and break generation. Added a positive-value guard so invalid metadata is ignored and the user-requested maxTokens is preserved. 🤖 Generated with OhMyOpenCode assistance https://github.com/code-yeongyu/oh-my-opencode
This commit is contained in:
@@ -165,6 +165,7 @@ export function resolveCompatibleModelSettings(
|
||||
if (
|
||||
maxTokens !== undefined &&
|
||||
input.capabilities?.maxOutputTokens !== undefined &&
|
||||
input.capabilities.maxOutputTokens > 0 &&
|
||||
maxTokens > input.capabilities.maxOutputTokens
|
||||
) {
|
||||
changes.push({
|
||||
|
||||
Reference in New Issue
Block a user