mirror of
https://github.com/wu736139669/hapi.git
synced 2026-12-04 06:57:55 +00:00
A Claude session could launch a model id its endpoint no longer serves (503 "无可用渠道"). Three lists disagreed: the hand-kept hub `customClaudeModels`, each device's remembered pick, and the machine's live CLI probe. The code let the first two win, and a remembered Claude model was never validated, so renaming a gateway model required editing every list or it kept being spawned. - The machine's CLI catalog now wins whenever discovery returns rows; the hand-kept list is only a fallback when discovery is unavailable. - The probe also asks the gateway's `GET /v1/models` (5s, best-effort) and drops rows whose resolved model it does not serve, so aliases for families the gateway lacks (e.g. `fable`) stop being offered. A failed lookup filters nothing, so a stock Anthropic login is unaffected. - Responses carry `endpointFiltered`; only then does a remembered model that is missing from the catalog fall back to Default. On a stock login an unlisted id may still work, so it stays selectable (upstream behavior). - `ClaudeModelSummary` now exposes `resolvedModel`, which is what makes the gateway check possible. Web (new session + composer) and iOS (new session) both follow the same rule. via [HAPI](https://hapi.run) Co-Authored-By: HAPI <noreply@hapi.run> Co-Authored-By: Claude Code <noreply@anthropic.com>