From 84bf2e70164064edf81b46e8a0481a5e21dfe282 Mon Sep 17 00:00:00 2001 From: kim Date: Sat, 31 Oct 2026 11:17:36 +0900 Subject: [PATCH] =?UTF-8?q?anthropic=20testConnection:=20=ED=86=A0?= =?UTF-8?q?=ED=81=B0=EC=9D=B4=20=EB=93=9C=EB=8A=94=20=EB=A9=94=EC=8B=9C?= =?UTF-8?q?=EC=A7=80=20=ED=98=B8=EC=B6=9C=20=EB=8C=80=EC=8B=A0=20=EB=AA=A8?= =?UTF-8?q?=EB=8D=B8=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /api/status가 주기적으로 부르는데 매번 haiku에 실제 메시지를 보내고 있었다. GET /v1/models?limit=1(과금 없음, 8초 제한)로 키와 네트워크만 확인한다. Co-Authored-By: Claude Sonnet 5.5 --- src/providers/anthropic-adapter.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/providers/anthropic-adapter.ts b/src/providers/anthropic-adapter.ts index a720975..ddc0ee3 100644 --- a/src/providers/anthropic-adapter.ts +++ b/src/providers/anthropic-adapter.ts @@ -125,13 +125,13 @@ export class AnthropicAdapter implements LLMProvider { } async testConnection(): Promise { + // /api/status가 주기적으로 부르므로 토큰이 드는 메시지 호출 대신 모델 목록 조회(과금 없음)로 키·네트워크만 확인한다 try { - await this.post('/v1/messages', { - model: 'claude-haiku-5-5', - max_tokens: 1, - messages: [{ role: 'user', content: 'hi' }], + const response = await fetch(`${this.endpoint}/v1/models?limit=1`, { + headers: { 'x-api-key': this.apiKey, 'anthropic-version': '2023-06-01' }, + signal: AbortSignal.timeout(8_000), }); - return true; + return response.ok; } catch { return false; }