You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keep configured model id for custom providers instead of forcing the default (#199)
* fix: keep configured model id for custom providers instead of forcing the default
createModelId() looked up the configured/returned model id in Codex's
listModels() catalog and, when it was absent, substituted
availableModels.find(m => m.isDefault). Custom providers (self-hosted or
third-party endpoints) expose model ids that the catalog does not enumerate,
so this silently replaced the user's configured model with the built-in
default. That default id was then pinned onto every runTurn, making requests
to the custom endpoint fail with "unknown model '<default>'".
The Codex CLI handles the same case by keeping the configured model id and
warning "Model metadata not found. Defaulting to fallback metadata." This
change mirrors that behavior: keep the requested model id when it is not in
the catalog, and only fall back to isDefault when no model id was provided
at all. Downstream session state already degrades gracefully for unknown
models (supportedReasoningEfforts ?? [], inputModalities ?? ["text","image"]).
Adds unit tests covering an uncatalogued model id with and without an
explicit reasoning effort.
* Handle uncataloged current models in config
---------
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
0 commit comments