Skip to content

use codex custom catalog for smart routing if exists - #580

Open
lilly-luo wants to merge 10 commits into
mainfrom
lilly/custom-catalog-codex
Open

use codex custom catalog for smart routing if exists #580
lilly-luo wants to merge 10 commits into
mainfrom
lilly/custom-catalog-codex

Conversation

@lilly-luo

@lilly-luo lilly-luo commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

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:select and confirmed glm-5-3-flash was not sent.

@david-siqi-liu david-siqi-liu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my high level comment is that a lot of function that seems o

Comment thread src/ucode/codex_config.py
profile_path: Path,
) -> tuple[Path, ...]:
"""Return Codex config paths in managed, profile, then user precedence."""
config_home = os.environ.get("CODEX_HOME")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just checking, this is OS specific right? I.e., different path for Windows

Comment thread src/ucode/codex_config.py
return tuple(path for path in (managed_config, cli_config, default_config) if path is not None)


def custom_catalog_models() -> list[str] | None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a similar function in https://github.com/openai/codex ? i'm guessing they also do some kind of parsing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants