From e7136005ebc06e635d609f144df4f903b9076735 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Wed, 10 Jun 2026 23:33:57 +0900 Subject: [PATCH] fix(types): narrow provider auth metadata --- src/llm/providers/anthropic.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/llm/providers/anthropic.ts b/src/llm/providers/anthropic.ts index 4f6fb964210b..23b4a03106b2 100644 --- a/src/llm/providers/anthropic.ts +++ b/src/llm/providers/anthropic.ts @@ -945,7 +945,11 @@ function createClient( return { client, isOAuthToken: false }; } - if (model.provider === "microsoft-foundry" && model.authHeader === true) { + const foundryAuthHeader = + model.provider === "microsoft-foundry" + ? (model as Model<"anthropic-messages"> & { authHeader?: unknown }).authHeader + : undefined; + if (foundryAuthHeader === true) { const client = new Anthropic({ apiKey: null, authToken: apiKey,