use codex custom catalog for smart routing if exists - #580
Open
lilly-luo wants to merge 10 commits into
Open
Conversation
david-siqi-liu
approved these changes
Sep 12, 2026
david-siqi-liu
left a comment
Collaborator
There was a problem hiding this comment.
my high level comment is that a lot of function that seems o
| profile_path: Path, | ||
| ) -> tuple[Path, ...]: | ||
| """Return Codex config paths in managed, profile, then user precedence.""" | ||
| config_home = os.environ.get("CODEX_HOME") |
Collaborator
There was a problem hiding this comment.
just checking, this is OS specific right? I.e., different path for Windows
| return tuple(path for path in (managed_config, cli_config, default_config) if path is not None) | ||
|
|
||
|
|
||
| def custom_catalog_models() -> list[str] | None: |
Collaborator
There was a problem hiding this comment.
is there a similar function in https://github.com/openai/codex ? i'm guessing they also do some kind of parsing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR does the following:
1/ makes it so that for smart routing, IF a custom catalog for codex is defined, we use the slugs in the catalog and send those models to smart routing instead of automatic model discovery.
2/ consolidates the hierarchy of config files (managed -> cli -> personal) into 1 place
i also confirmed that if a custom catalog is defined, then codex doesn't poll codex/v1/models. - refresh strategy is not used for the raw catalog.
to test:
https://github.com/user-attachments/assets/9427e919-82f1-4d4f-aea1-2aecedb5b0dd
i intentionally dropped glm-5-3-flash from the catalog. then i peeked at the payload we sent to the smart router
routes:selectand confirmed glm-5-3-flash was not sent.