Skip to content

[AIGTWY-4565] Use the MPS model catalog in Codex - #549

Open
andy-xu-db wants to merge 4 commits into
mainfrom
aigtwy-4565-codex-mps-discovery
Open

[AIGTWY-4565] Use the MPS model catalog in Codex#549
andy-xu-db wants to merge 4 commits into
mainfrom
aigtwy-4565-codex-mps-discovery

Conversation

@andy-xu-db

@andy-xu-db andy-xu-db commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fetch the selected MPS catalog from /ai-gateway/codex/v1/models before launch.
  • Send the provider header only in the launch config; persistent and managed Codex config stays MPS-neutral.
  • Pass a workspace/provider-scoped atomic catalog through model_catalog_json, replacing bundled defaults in /model.
  • Use the active standard or custom OAuth token for discovery and runtime.
  • Fail clearly for invalid, empty, unwritable, or administrator-overridden catalogs.

Server counterpart: https://github.com/databricks-eng/universe/pull/2586683

Usage

Codex does not use an enable-model-discovery flag:

uv run ug codex \
  --provider <catalog>.<schema>.<model-provider-service>

Testing

  • Focused: 599 passed
  • Full suite: 2196 passed, 37 skipped; 2 unrelated installed-binary E2E failures
  • Ruff and diff checks passed
  • LiteSwap /model: exactly o4-mini, o3, and o1 for the explicit test MPS
  • Allow-all /model: exactly 31 compatible models, with no bundled or unsupported extras
  • Selected o3 and o4-mini; both returned the expected E2E response through LiteSwap
Codex /model showing only MPS models

@andy-xu-db
andy-xu-db force-pushed the aigtwy-4565-codex-mps-discovery branch from d6af689 to 865aba6 Compare September 10, 2026 15:44
@andy-xu-db
andy-xu-db marked this pull request as ready for review September 10, 2026 20:18
Comment thread src/ucode/cli.py
Comment on lines +2219 to +2220
elif tool == "codex" and provider:
state["_codex_launch_provider"] = provider

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.

why do we need this for codex and not for cc

Comment thread src/ucode/agents/codex.py Outdated
Comment on lines +523 to +524
token = get_databricks_token(workspace, state.get("profile"))
os.environ["OAUTH_TOKEN"] = token

@lilly-luo lilly-luo Sep 10, 2026

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 this change necessary?

Comment thread src/ucode/agents/codex.py Outdated
)
if workspace and token and provider:
catalog = fetch_codex_mps_model_catalog(workspace, token, provider)
write_json_file(CODEX_MPS_MODEL_CATALOG_PATH, catalog)

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.

nice i need to use this too

@lilly-luo lilly-luo 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.

can you include a snippet of what the catalog looks like? and also test against bedrock w gpt model?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants