feat(ai/providers): dropped auto tool choice for reasoning models
- Add `shouldDropAutoToolChoiceForReasoning` helper to handle compatibility constraints for models where tool choice disables reasoning. - Update OpenAI completions and responses parameter building to drop automatic tool choices when reasoning options are active.
This commit is contained in:
@@ -108,7 +108,7 @@ export {
|
||||
|
||||
import { ModelsConfigFile, type ProviderValidationModel, validateProviderConfiguration } from "./models-config";
|
||||
import type { ModelOverride, ModelsConfig, ProviderAuthMode } from "./models-config-schema";
|
||||
import { settings, type Settings } from "./settings";
|
||||
import { type Settings, settings } from "./settings";
|
||||
|
||||
// DeviceCheck attestation (`x-oai-attestation`) for ChatGPT-OAuth Codex
|
||||
// requests; the pi-ai provider resolves it just-in-time per request.
|
||||
|
||||
@@ -1251,9 +1251,13 @@ async function createAgentSessionScoped(options: CreateAgentSessionOptions): Pro
|
||||
// / session would silently miss credential_disabled events.
|
||||
const modelRegistry =
|
||||
options.modelRegistry ??
|
||||
new ModelRegistry(options.authStorage ?? (await logger.time("discoverModels", discoverAuthStorage, agentDir)), undefined, {
|
||||
settings,
|
||||
});
|
||||
new ModelRegistry(
|
||||
options.authStorage ?? (await logger.time("discoverModels", discoverAuthStorage, agentDir)),
|
||||
undefined,
|
||||
{
|
||||
settings,
|
||||
},
|
||||
);
|
||||
// Track whether we internally created the authStorage so we can close it
|
||||
// if construction fails before the session takes ownership.
|
||||
const ownsAuthStorage = !options.authStorage && !options.modelRegistry;
|
||||
|
||||
Reference in New Issue
Block a user