From d1241b96c63ec7747d9e32bdd17ebb7f167dbe78 Mon Sep 17 00:00:00 2001 From: Tony Casey Date: Mon, 16 Feb 2026 09:20:47 +0000 Subject: [PATCH] fix(hook): pass LLM config from .git-mem.yaml to DI container (GIT-122) The hook command loaded .git-mem.yaml but never forwarded the llm config to createContainer(), so provider selection always fell back to env-var auto-detection. With both ANTHROPIC_API_KEY and OPENAI_API_KEY present, Anthropic was always chosen, causing enrichment to time out at 8s on slower responses. Co-Authored-By: Claude Opus 4.6 AI-Agent: Claude-Code/2.1.42 AI-Model: claude-opus-4-6 AI-Gotcha: The hook command must explicitly pass LLM configuration from .git-mem.yaml to the DI container, otherwise provider selection falls back to environment variable auto-detection. AI-Confidence: verified AI-Tags: hook, dependency-injection, llm-config, git-mem-yaml, anthropic, openai, environment-variables, provider-selection, timeout, enrichment, performance, create-container AI-Lifecycle: project AI-Memory-Id: 1026229e AI-Source: llm-enrichment --- src/commands/hook.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/hook.ts b/src/commands/hook.ts index a3ec3e93..47f6e152 100644 --- a/src/commands/hook.ts +++ b/src/commands/hook.ts @@ -161,7 +161,7 @@ export async function hookCommand(eventName: string, _logger?: ILogger): Promise return; } - const container = createContainer({ scope: `hook:${eventName}` }); + const container = createContainer({ scope: `hook:${eventName}`, llm: config.llm }); const { eventBus } = container.cradle; const event = buildEvent(eventType, normalizedInput);