Skip to content

Commit e59af53

Browse files
authored
Update src/shared/api.ts
1 parent 8556b61 commit e59af53

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/shared/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const getModelMaxOutputTokens = ({
135135
// Models that expose a configurable max-output slider (e.g. Z.ai GLM) honor the user's
136136
// explicit override instead of the default 20% context-window clamp, capped at the model's
137137
// own ceiling. This keeps the runtime budget consistent with the value sent to the provider.
138-
if (model.supportsMaxTokens && settings?.modelMaxTokens) {
138+
if (model.supportsMaxTokens && settings?.modelMaxTokens != null && settings.modelMaxTokens > 0) {
139139
return model.maxTokens ? Math.min(settings.modelMaxTokens, model.maxTokens) : settings.modelMaxTokens
140140
}
141141

0 commit comments

Comments
 (0)