From 40535a53477d7bd76fbb307ccac8aa3893251de7 Mon Sep 17 00:00:00 2001 From: NeilJo-GY <43027886+NeilJo-GY@users.noreply.github.com> Date: Fri, 4 Sep 2026 15:52:28 +0800 Subject: [PATCH] fix(settings): hide OpenRouter ~vendor SKUs from the CN official shelf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Catalog rows like ~openai/gpt-latest were passing the openai/ prefix check, so Official ยท OpenRouter showed GPT/Claude/Gemini on a CN Host. Co-authored-by: Cursor --- packages/agent-chat/src/ranch-shell/officialV0.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/agent-chat/src/ranch-shell/officialV0.ts b/packages/agent-chat/src/ranch-shell/officialV0.ts index b30f6c8..c311812 100644 --- a/packages/agent-chat/src/ranch-shell/officialV0.ts +++ b/packages/agent-chat/src/ranch-shell/officialV0.ts @@ -20,7 +20,7 @@ export function officialShelfAllows( modelId: string | null | undefined, keyGeo: string | null | undefined, ): boolean { - const id = (modelId || "").trim().toLowerCase(); + const id = (modelId || "").trim().toLowerCase().replace(/^~+/, ""); if (!id || !officialV0SupportsModel(id)) return false; if ((keyGeo || "").trim().toLowerCase() !== "cn") return true; return !CN_KEY_BLOCKED_PREFIXES.some((prefix) => id.startsWith(prefix));