SIGN IN SIGN UP

fix: fresh account no longer 403s every model before probe completes

QQ-group complaint 2026-04-30: "获取不到模型, 添加模型后也不能调用".

Reproduced via tmp/probe-race.mjs: a freshly-added account had
account.tier='unknown' until probe finished, and MODEL_TIER_ACCESS.unknown
was just [gemini-2.5-flash]. Result: 110/111 catalog models hit the
chat.js anyEligible preflight and 403'd with "model_not_entitled" until
the background probe completed (10-30s later).

Fix:
1. MODEL_TIER_ACCESS.unknown is now optimistic — returns the full pro
   catalog instead of [gemini-2.5-flash]. A fresh account can use any
   model immediately. If the user is actually free/expired, upstream LS
   rejects with a real entitlement error (more accurate than the
   misleading proxy-level 403).
2. chat.js anyEligible branch detects the case where ineligibility comes
   from un-probed accounts and surfaces a clearer error message
   ("账号刚添加还未完成 tier 检测,请稍候 10-30 秒后重试") with a new
   error type `probe_pending` instead of generic `model_not_entitled`.
   Note: with the unknown→pro change, this branch should rarely fire for
   un-probed accounts now, but the better message is kept as a safety net
   for any account state that genuinely lacks the model.

Verified: tmp/probe-race.mjs shows 0/111 models 403d for fresh accounts
(was 110/111). 5 new regression tests in test/tier-unknown-optimistic.test.js
covering: unknown == pro size, free still restrictive, expired still empty,
fresh account allows common pro models, catalog/unknown drift detection.
D
dwgx committed
161259d771525460adc4d35ed29e22b5c92468f9
Parent: 1cd6236