From d32298cbd81619e6c2f8d9725c82898f9e4284cd Mon Sep 17 00:00:00 2001 From: SudeepMalipeddi Date: Tue, 24 Feb 2026 19:39:16 +0530 Subject: [PATCH] fix: slug-generator uses effective model instead of agent-primary resolveAgentModelPrimary() only checks the agent-level model config and does not fall back to the system-wide default. When users configure a non-Anthropic provider (e.g. Gemini, Minimax) as their global default without setting it at the agent level, the slug-generator falls through to DEFAULT_PROVIDER (anthropic) and fails with a missing API key error. Switch to resolveAgentEffectiveModelPrimary() which correctly respects the full model resolution chain including global defaults. Fixes #25365 --- src/hooks/llm-slug-generator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/llm-slug-generator.ts b/src/hooks/llm-slug-generator.ts index 33c69dcf5..eb355fc32 100644 --- a/src/hooks/llm-slug-generator.ts +++ b/src/hooks/llm-slug-generator.ts @@ -9,7 +9,7 @@ import { resolveDefaultAgentId, resolveAgentWorkspaceDir, resolveAgentDir, - resolveAgentModelPrimary, + resolveAgentEffectiveModelPrimary, } from "../agents/agent-scope.js"; import { DEFAULT_PROVIDER, DEFAULT_MODEL } from "../agents/defaults.js"; import { parseModelRef } from "../agents/model-selection.js"; @@ -45,7 +45,7 @@ ${params.sessionContent.slice(0, 2000)} Reply with ONLY the slug, nothing else. Examples: "vendor-pitch", "api-design", "bug-fix"`; // Resolve model from agent config instead of using hardcoded defaults - const modelRef = resolveAgentModelPrimary(params.cfg, agentId); + const modelRef = resolveAgentEffectiveModelPrimary(params.cfg, agentId); const parsed = modelRef ? parseModelRef(modelRef, DEFAULT_PROVIDER) : null; const provider = parsed?.provider ?? DEFAULT_PROVIDER; const model = parsed?.model ?? DEFAULT_MODEL;