From 0c1efec1c9615d964dc6a19897e2ca82e61c17cd Mon Sep 17 00:00:00 2001 From: haxudev Date: Thu, 19 Mar 2026 16:52:32 +0800 Subject: [PATCH] Microsoft Foundry: use active model hint at runtime Prefer the currently selected model hint during runtime auth refresh so switching Foundry deployments cannot reuse stale onboarding metadata and route requests to the wrong GPT-5 or non-GPT-5 endpoint. --- extensions/microsoft-foundry/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/microsoft-foundry/index.ts b/extensions/microsoft-foundry/index.ts index df0f86b27e5..f271c8e71e0 100644 --- a/extensions/microsoft-foundry/index.ts +++ b/extensions/microsoft-foundry/index.ts @@ -1079,7 +1079,12 @@ export default definePluginEntry({ : typeof metadata?.modelId === "string" && metadata.modelId.trim().length > 0 ? metadata.modelId.trim() : ctx.modelId; - const modelNameHint = resolveConfiguredModelNameHint(modelId, metadata?.modelName ?? ctx.model.name); + const activeModelNameHint = + ctx.modelId === metadata?.modelId ? metadata?.modelName : undefined; + const modelNameHint = resolveConfiguredModelNameHint( + modelId, + ctx.model.name ?? activeModelNameHint, + ); const endpoint = typeof metadata?.endpoint === "string" && metadata.endpoint.trim().length > 0 ? metadata.endpoint.trim()