Files
hapi/shared
2700a46d35 fix(claude): trust the machine catalog and the gateway's real model list
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>
2026-12-02 18:50:06 +08:00
..
2026-11-20 13:06:05 +08:00
2026-11-20 13:33:58 +08:00
2026-01-03 14:43:59 +08:00