mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-21 23:33:07 +00:00
fix(agent-service): fallback to effectiveModel when requestedModel is undefined
This commit is contained in:
@@ -389,14 +389,16 @@ export class AgentService {
|
|||||||
|
|
||||||
// Get provider for this model (with prefix)
|
// Get provider for this model (with prefix)
|
||||||
// When using custom provider (GLM, MiniMax), requestedModel routes to Claude provider
|
// When using custom provider (GLM, MiniMax), requestedModel routes to Claude provider
|
||||||
const modelForProvider = claudeCompatibleProvider ? requestedModel : effectiveModel;
|
const modelForProvider = claudeCompatibleProvider
|
||||||
|
? (requestedModel ?? effectiveModel)
|
||||||
|
: effectiveModel;
|
||||||
const provider = ProviderFactory.getProviderForModel(modelForProvider);
|
const provider = ProviderFactory.getProviderForModel(modelForProvider);
|
||||||
|
|
||||||
// Strip provider prefix - providers should receive bare model IDs
|
// Strip provider prefix - providers should receive bare model IDs
|
||||||
// CRITICAL: For custom providers (GLM, MiniMax), pass the provider's model ID (e.g. "GLM-4.7")
|
// CRITICAL: For custom providers (GLM, MiniMax), pass the provider's model ID (e.g. "GLM-4.7")
|
||||||
// to the API, NOT the resolved Claude model - otherwise we get "model not found"
|
// to the API, NOT the resolved Claude model - otherwise we get "model not found"
|
||||||
const bareModel = claudeCompatibleProvider
|
const bareModel: string = claudeCompatibleProvider
|
||||||
? requestedModel
|
? (requestedModel ?? effectiveModel)
|
||||||
: stripProviderPrefix(effectiveModel);
|
: stripProviderPrefix(effectiveModel);
|
||||||
|
|
||||||
// Build options for provider
|
// Build options for provider
|
||||||
|
|||||||
Reference in New Issue
Block a user