fix(core): strip thinkingConfig for models without thinking feature

This commit is contained in:
Sehoon Shon
2026-04-01 01:49:39 -04:00
parent de128bc172
commit 2df15df871
@@ -488,6 +488,14 @@ export class ModelConfigService {
);
}
// Automatically strip thinkingConfig if the model does not support thinking.
const modelDefinition = this.getModelDefinition(resolved.model);
if (modelDefinition && modelDefinition.features?.thinking === false) {
if (resolved.generateContentConfig.thinkingConfig) {
delete resolved.generateContentConfig.thinkingConfig;
}
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
return {
model: resolved.model,