Merge pull request #2594 from MoerAI/fix/subagent-fallback-model-v2
fix(agent-registration): always attempt fallback when model resolution fails (fixes #2427, supersedes #2517)
This commit is contained in:
@@ -8,6 +8,7 @@ import { buildAgent, isFactory } from "../agent-builder"
|
|||||||
import { applyOverrides } from "./agent-overrides"
|
import { applyOverrides } from "./agent-overrides"
|
||||||
import { applyEnvironmentContext } from "./environment-context"
|
import { applyEnvironmentContext } from "./environment-context"
|
||||||
import { applyModelResolution, getFirstFallbackModel } from "./model-resolution"
|
import { applyModelResolution, getFirstFallbackModel } from "./model-resolution"
|
||||||
|
import { log } from "../../shared/logger"
|
||||||
|
|
||||||
export function collectPendingBuiltinAgents(input: {
|
export function collectPendingBuiltinAgents(input: {
|
||||||
agentSources: Record<BuiltinAgentName, import("../agent-builder").AgentSource>
|
agentSources: Record<BuiltinAgentName, import("../agent-builder").AgentSource>
|
||||||
@@ -75,7 +76,13 @@ export function collectPendingBuiltinAgents(input: {
|
|||||||
availableModels,
|
availableModels,
|
||||||
systemDefaultModel,
|
systemDefaultModel,
|
||||||
})
|
})
|
||||||
if (!resolution && isFirstRunNoCache && !override?.model) {
|
if (!resolution) {
|
||||||
|
if (override?.model) {
|
||||||
|
log("[agent-registration] User-configured model could not be resolved, falling back", {
|
||||||
|
agent: agentName,
|
||||||
|
configuredModel: override.model,
|
||||||
|
})
|
||||||
|
}
|
||||||
resolution = getFirstFallbackModel(requirement)
|
resolution = getFirstFallbackModel(requirement)
|
||||||
}
|
}
|
||||||
if (!resolution) continue
|
if (!resolution) continue
|
||||||
|
|||||||
Reference in New Issue
Block a user