fix: Increase max_output_tokens for gpt-5 and gpt-5.1 (#161)

This commit is contained in:
Kevin Lin
2025-12-06 14:01:28 -08:00
committed by GitHub
parent cf5c738eb9
commit 5dd96c9c8b
2 changed files with 23 additions and 8 deletions

View File

@@ -43,6 +43,13 @@ function buildModelSettings(
| "high",
};
}
// If a max_output_tokens override is provided in the model's updateArgs,
// propagate it into the OpenAI model settings so the backend can raise
// the generation cap (prevents premature ResponseIncompleteEvent with
// reason='max_output_tokens').
if (typeof updateArgs?.max_output_tokens === "number") {
openaiSettings.max_output_tokens = updateArgs.max_output_tokens as number;
}
return openaiSettings;
}