From e92acf6095f5445865257dc016bd9c20da66122b Mon Sep 17 00:00:00 2001 From: dd373156 <106299115+dd373156@users.noreply.github.com> Date: Fri, 17 Apr 2026 15:28:29 +0800 Subject: [PATCH] fix(models): make pro tier include dynamically merged cloud models ALL_MODEL_KEYS is a module-load-time snapshot. Models added later via mergeCloudModels (e.g. the opus-4-7 family) never make it into the snapshot, so getTierModels('pro') returns a stale list and the chat preflight returns 403 model_not_entitled for every cloud-added model. Replace the frozen-array reference with a getter so every call re-enumerates the live MODELS dictionary. --- src/models.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models.js b/src/models.js index aa0c4a1e..271ada25 100644 --- a/src/models.js +++ b/src/models.js @@ -201,7 +201,7 @@ const ALL_MODEL_KEYS = Object.keys(MODELS); const FREE_TIER_MODELS = ['gpt-4o-mini', 'gemini-2.5-flash']; export const MODEL_TIER_ACCESS = { - pro: ALL_MODEL_KEYS, + get pro() { return Object.keys(MODELS); }, free: FREE_TIER_MODELS, unknown: FREE_TIER_MODELS, expired: [],