From cca769d89f7ebd44a04858807511adb637d61dea Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 20 Oct 2026 17:18:17 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=A0=80=EC=9E=A5:=20?= =?UTF-8?q?=EB=B9=88=20API=20=ED=82=A4/=ED=86=A0=ED=81=B0=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=EC=B9=B8=EC=9D=B4=20=EA=B8=B0=EC=A1=B4=20vault=20?= =?UTF-8?q?=EC=B0=B8=EC=A1=B0=EB=A5=BC=20=EB=8D=AE=EC=96=B4=EC=93=B0?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D(=EC=A0=84=EC=B2=B4=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=20=ED=9B=84=20'Anthropic=20API=20key=20not?= =?UTF-8?q?=20configured'=20=EB=B0=A9=EC=A7=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- src/gateway/routes/settings.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gateway/routes/settings.ts b/src/gateway/routes/settings.ts index b25be4e..5824b1e 100644 --- a/src/gateway/routes/settings.ts +++ b/src/gateway/routes/settings.ts @@ -310,8 +310,11 @@ export function registerSettingsRoutes(app: Express): void { for (const [provId, provConf] of Object.entries((llm.providers || {}) as Record)) { const existing: Record = storedProviders[provId] || {}; const merged: Record = { ...existing, ...provConf }; - if ((provConf as any)?.api_key === '••••••••' && existing.api_key) merged.api_key = existing.api_key; - if ((provConf as any)?.token === '••••••••' && existing.token) merged.token = existing.token; + // 마스크('••••••••')뿐 아니라 빈 값도 "바꾸지 않음"으로 본다 — 전체 저장 때 화면이 비어 있는 키 입력칸을 그대로 보내 + // vault 참조(vault:anthropic.api_key)를 ''로 덮어 쓰면 서버가 "API key not configured"로 멎는다(2026-10-20). + const keepSecret = (v: any) => v === '••••••••' || v === '' || v === undefined || v === null; + if (keepSecret((provConf as any)?.api_key) && existing.api_key) merged.api_key = existing.api_key; + if (keepSecret((provConf as any)?.token) && existing.token) merged.token = existing.token; if (!(provConf as any)?.model && existing.model) merged.model = existing.model; if (!(provConf as any)?.endpoint && existing.endpoint) merged.endpoint = existing.endpoint; mergedProviders[provId] = merged;