diff --git a/src/providers/factory.ts b/src/providers/factory.ts index 5b13cc6..b1a7107 100644 --- a/src/providers/factory.ts +++ b/src/providers/factory.ts @@ -178,7 +178,7 @@ function buildProvider(id: ProviderID, providers: any): LLMProvider { case 'openai': { const cfg = providers.openai || {}; - const apiKey = resolveEnvKey(cfg.api_key); + const apiKey = resolveEnvKey(getConfig().resolveSecret(cfg.api_key)); // vault: 참조도 풀어야 한다(google과 동일) if (!apiKey) throw new Error('OpenAI API key not configured. Add it in Settings -> Models.'); return new OpenAICompatAdapter({ endpoint: 'https://api.openai.com', @@ -209,7 +209,8 @@ function buildProvider(id: ProviderID, providers: any): LLMProvider { case 'anthropic': { const cfg = providers.anthropic || {}; - const apiKey = resolveEnvKey(cfg.api_key); + // vault:anthropic.api_key 같은 참조는 resolveEnvKey만으로는 풀리지 않아 키가 있어도 "not configured"가 됐다(2026-10-17) + const apiKey = resolveEnvKey(getConfig().resolveSecret(cfg.api_key)); if (!apiKey) throw new Error('Anthropic API key not configured. Add it in Settings -> Models.'); return new AnthropicAdapter(apiKey, cfg.endpoint); }