Merge pull request #4278 from MoerAI/fix/log-agent-skip-on-missing-model
fix(agents): log warning when a builtin agent is silently skipped due to model availability (fixes #4150)
This commit is contained in:
@@ -3,6 +3,7 @@ import type { AgentOverrides } from "../types"
|
|||||||
import type { CategoriesConfig, CategoryConfig } from "../../config/schema"
|
import type { CategoriesConfig, CategoryConfig } from "../../config/schema"
|
||||||
import type { AvailableAgent, AvailableSkill } from "../dynamic-agent-prompt-builder"
|
import type { AvailableAgent, AvailableSkill } from "../dynamic-agent-prompt-builder"
|
||||||
import { AGENT_MODEL_REQUIREMENTS } from "../../shared"
|
import { AGENT_MODEL_REQUIREMENTS } from "../../shared"
|
||||||
|
import { log } from "../../shared/logger"
|
||||||
import { applyOverrides } from "./agent-overrides"
|
import { applyOverrides } from "./agent-overrides"
|
||||||
import { applyModelResolution } from "./model-resolution"
|
import { applyModelResolution } from "./model-resolution"
|
||||||
import { createAtlasAgent } from "../atlas"
|
import { createAtlasAgent } from "../atlas"
|
||||||
@@ -52,7 +53,13 @@ export function maybeCreateAtlasConfig(input: {
|
|||||||
atlasResolution = { model: orchestratorOverride.model, provenance: "override" as const }
|
atlasResolution = { model: orchestratorOverride.model, provenance: "override" as const }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!atlasResolution) return undefined
|
if (!atlasResolution) {
|
||||||
|
log("[agent-registration] Agent skipped: model resolution returned no result", {
|
||||||
|
agent: "atlas",
|
||||||
|
configuredModel: orchestratorOverride?.model,
|
||||||
|
})
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
const { model: atlasModel, variant: atlasResolvedVariant } = atlasResolution
|
const { model: atlasModel, variant: atlasResolvedVariant } = atlasResolution
|
||||||
|
|
||||||
let orchestratorConfig = createAtlasAgent({
|
let orchestratorConfig = createAtlasAgent({
|
||||||
|
|||||||
@@ -66,6 +66,10 @@ export function collectPendingBuiltinAgents(input: {
|
|||||||
// Check if agent requires a specific model
|
// Check if agent requires a specific model
|
||||||
if (requirement?.requiresModel && availableModels) {
|
if (requirement?.requiresModel && availableModels) {
|
||||||
if (!isModelAvailable(requirement.requiresModel, availableModels)) {
|
if (!isModelAvailable(requirement.requiresModel, availableModels)) {
|
||||||
|
log("[agent-registration] Agent skipped: required model not available", {
|
||||||
|
agent: agentName,
|
||||||
|
requiredModel: requirement.requiresModel,
|
||||||
|
})
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -92,7 +96,13 @@ export function collectPendingBuiltinAgents(input: {
|
|||||||
resolution = getFirstFallbackModel(requirement)
|
resolution = getFirstFallbackModel(requirement)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!resolution) continue
|
if (!resolution) {
|
||||||
|
log("[agent-registration] Agent skipped: model resolution returned no result", {
|
||||||
|
agent: agentName,
|
||||||
|
configuredModel: override?.model,
|
||||||
|
})
|
||||||
|
continue
|
||||||
|
}
|
||||||
const { model, variant: resolvedVariant } = resolution
|
const { model, variant: resolvedVariant } = resolution
|
||||||
|
|
||||||
let config = buildAgent(source, model, mergedCategories)
|
let config = buildAgent(source, model, mergedCategories)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import type { AgentOverrides } from "../types"
|
|||||||
import type { CategoryConfig } from "../../config/schema"
|
import type { CategoryConfig } from "../../config/schema"
|
||||||
import type { AvailableAgent, AvailableCategory, AvailableSkill } from "../dynamic-agent-prompt-builder"
|
import type { AvailableAgent, AvailableCategory, AvailableSkill } from "../dynamic-agent-prompt-builder"
|
||||||
import { AGENT_MODEL_REQUIREMENTS, isAnyProviderConnected } from "../../shared"
|
import { AGENT_MODEL_REQUIREMENTS, isAnyProviderConnected } from "../../shared"
|
||||||
|
import { log } from "../../shared/logger"
|
||||||
import { createHephaestusAgent } from "../hephaestus"
|
import { createHephaestusAgent } from "../hephaestus"
|
||||||
import { applyEnvironmentContext } from "./environment-context"
|
import { applyEnvironmentContext } from "./environment-context"
|
||||||
import { applyCategoryOverride, mergeAgentConfig } from "./agent-overrides"
|
import { applyCategoryOverride, mergeAgentConfig } from "./agent-overrides"
|
||||||
@@ -51,7 +52,13 @@ export function maybeCreateHephaestusConfig(input: {
|
|||||||
isFirstRunNoCache ||
|
isFirstRunNoCache ||
|
||||||
isAnyProviderConnected(hephaestusRequirement.requiresProvider, availableModels)
|
isAnyProviderConnected(hephaestusRequirement.requiresProvider, availableModels)
|
||||||
|
|
||||||
if (!hasRequiredProvider) return undefined
|
if (!hasRequiredProvider) {
|
||||||
|
log("[agent-registration] Agent skipped: required provider not connected", {
|
||||||
|
agent: "hephaestus",
|
||||||
|
requiredProvider: hephaestusRequirement?.requiresProvider,
|
||||||
|
})
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
|
||||||
let hephaestusResolution = applyModelResolution({
|
let hephaestusResolution = applyModelResolution({
|
||||||
userModel: hephaestusOverride?.model,
|
userModel: hephaestusOverride?.model,
|
||||||
@@ -64,7 +71,13 @@ export function maybeCreateHephaestusConfig(input: {
|
|||||||
hephaestusResolution = getFirstFallbackModel(hephaestusRequirement)
|
hephaestusResolution = getFirstFallbackModel(hephaestusRequirement)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hephaestusResolution) return undefined
|
if (!hephaestusResolution) {
|
||||||
|
log("[agent-registration] Agent skipped: model resolution returned no result", {
|
||||||
|
agent: "hephaestus",
|
||||||
|
configuredModel: hephaestusOverride?.model,
|
||||||
|
})
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
const { model: hephaestusModel, variant: hephaestusResolvedVariant } = hephaestusResolution
|
const { model: hephaestusModel, variant: hephaestusResolvedVariant } = hephaestusResolution
|
||||||
|
|
||||||
let hephaestusConfig = createHephaestusAgent(
|
let hephaestusConfig = createHephaestusAgent(
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import type { AgentOverrides } from "../types"
|
|||||||
import type { CategoriesConfig, CategoryConfig } from "../../config/schema"
|
import type { CategoriesConfig, CategoryConfig } from "../../config/schema"
|
||||||
import type { AvailableAgent, AvailableCategory, AvailableSkill } from "../dynamic-agent-prompt-builder"
|
import type { AvailableAgent, AvailableCategory, AvailableSkill } from "../dynamic-agent-prompt-builder"
|
||||||
import { AGENT_MODEL_REQUIREMENTS, isAnyFallbackModelAvailable } from "../../shared"
|
import { AGENT_MODEL_REQUIREMENTS, isAnyFallbackModelAvailable } from "../../shared"
|
||||||
|
import { log } from "../../shared/logger"
|
||||||
import { applyEnvironmentContext } from "./environment-context"
|
import { applyEnvironmentContext } from "./environment-context"
|
||||||
import { applyOverrides } from "./agent-overrides"
|
import { applyOverrides } from "./agent-overrides"
|
||||||
import { applyModelResolution, getFirstFallbackModel } from "./model-resolution"
|
import { applyModelResolution, getFirstFallbackModel } from "./model-resolution"
|
||||||
@@ -51,6 +52,11 @@ export function maybeCreateSisyphusConfig(input: {
|
|||||||
isFirstRunNoCache ||
|
isFirstRunNoCache ||
|
||||||
isAnyFallbackModelAvailable(sisyphusRequirement.fallbackChain, availableModels)
|
isAnyFallbackModelAvailable(sisyphusRequirement.fallbackChain, availableModels)
|
||||||
|
|
||||||
|
if (!disabledAgents.includes("sisyphus") && !meetsSisyphusAnyModelRequirement) {
|
||||||
|
log("[agent-registration] Agent skipped: no model in fallback chain is available", {
|
||||||
|
agent: "sisyphus",
|
||||||
|
})
|
||||||
|
}
|
||||||
if (disabledAgents.includes("sisyphus") || !meetsSisyphusAnyModelRequirement) return undefined
|
if (disabledAgents.includes("sisyphus") || !meetsSisyphusAnyModelRequirement) return undefined
|
||||||
|
|
||||||
let sisyphusResolution = applyModelResolution({
|
let sisyphusResolution = applyModelResolution({
|
||||||
@@ -65,7 +71,13 @@ export function maybeCreateSisyphusConfig(input: {
|
|||||||
sisyphusResolution = getFirstFallbackModel(sisyphusRequirement)
|
sisyphusResolution = getFirstFallbackModel(sisyphusRequirement)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sisyphusResolution) return undefined
|
if (!sisyphusResolution) {
|
||||||
|
log("[agent-registration] Agent skipped: model resolution returned no result", {
|
||||||
|
agent: "sisyphus",
|
||||||
|
configuredModel: sisyphusOverride?.model,
|
||||||
|
})
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
const { model: sisyphusModel, variant: sisyphusResolvedVariant } = sisyphusResolution
|
const { model: sisyphusModel, variant: sisyphusResolvedVariant } = sisyphusResolution
|
||||||
|
|
||||||
let sisyphusConfig = createSisyphusAgent(
|
let sisyphusConfig = createSisyphusAgent(
|
||||||
|
|||||||
Reference in New Issue
Block a user