Conversation
`ug codex --provider <MPS>` wrote the MPS's models into Codex's picker (model_catalog_json) but left the active model to Codex's bundled default (e.g. gpt-5.6-sol), which an MPS allowlist doesn't route -- so the first request 403'd. When discovery succeeds, pin `model` to the MPS's primary (first) target unless the user passed -m/--model or a managed default applies. Co-authored-by: Isaac <no-reply@databricks.com>
lilly-luo
reviewed
Sep 15, 2026
Comment on lines
+89
to
+91
| def _catalog_slugs(path: Path) -> list[str]: | ||
| """Extract deduplicated model slugs from a Codex custom catalog JSON file.""" | ||
| return catalog_slugs(read_json_safe(path)) |
Collaborator
There was a problem hiding this comment.
private func call a public func?
custom_catalog_models now calls the public catalog_slugs() on the JSON it reads, so no private helper delegates to a public one. Co-authored-by: Isaac <no-reply@databricks.com>
lilly-luo
reviewed
Sep 15, 2026
| # which an MPS's allowlist doesn't route, so the first request 403s. Pin | ||
| # the MPS's primary (first) target unless the user chose a model or a | ||
| # managed default already applies. | ||
| if not profile_doc.get("model") and not _tool_args_select_model(tool_args): |
Collaborator
There was a problem hiding this comment.
where is this custom catalog coming from that has the models?
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.
Summary
ug codex --provider <MPS>writes the MPS's models into Codex's picker (model_catalog_json) but left the active model to Codex's own bundled default (e.g.gpt-5.6-sol). An MPS allowlist doesn't route that slug, so the first request returned403 PERMISSION_DENIED: Model '...' is not in the allowed models list.When MPS model discovery succeeds, pin the active
modelto the MPS's primary (first) catalog target — unless the user passed-m/--modelor a managed default already applies. Orthogonal to #611: only the discovery-success branch changes; the 404 fallback path stays untouched.Changes
agents/codex.py: pinmodelfrom the fetched catalog inlaunch(); add_tool_args_select_model()so an explicit-m/--modelstill wins.codex_config.py: extractcatalog_slugs(catalog), shared by the file reader and the launch path.-m/--model; keeps a managed default; existing catalog test asserts the pin.Testing
uv run --frozen pytest tests/test_agent_codex.py tests/test_codex_config.py tests/test_databricks.py tests/test_lint.py— 365 passeduv run ruff format --check src/ tests/anduv run ruff check src/ tests/— cleanThis pull request and its description were written by Isaac.