Skip to content

Automatically enable Claude model discovery for providers - #710

Merged
lilly-luo merged 4 commits into
mainfrom
andy/auto-claude-model-discovery
Sep 18, 2026
Merged

lilly-luo merged 4 commits into
mainfrom
andy/auto-claude-model-discovery

Conversation

@andy-xu-db

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

Copy link
Copy Markdown
Collaborator

🥞 Stacked PR

Use this link to review incremental changes.


Summary

  • Automatically enable Claude Code gateway model discovery when a user launches with --provider.
  • Preserve the existing automatic behavior for --model-location and the explicit hidden opt-in.
  • Add CLI regression coverage for provider launches.

Testing

  • uv run pytest tests/test_cli.py tests/test_agent_claude.py — 530 passed
  • uv run --frozen ruff check src/ucode/cli.py tests/test_cli.py — passed
  • uv run --frozen ruff format --check src/ucode/cli.py tests/test_cli.py — passed
  • uv run --frozen pytest -q — 2,386 passed, 41 skipped, 2 environment-dependent failures in tests/test_e2e_user_agent.py: the installed Claude binary rejected the fixture model before sending a request, and the installed Codex binary used ambient machine-wide configuration instead of the capture server
Screenshot 2026-09-17 at 5 07 31 PM
Screen.Recording.2026-09-17.at.5.07.56.PM.mov

@lilly-luo
lilly-luo enabled auto-merge (squash) September 17, 2026 23:34
@lilly-luo
lilly-luo merged commit 7e3a4b3 into main Sep 18, 2026
20 checks passed
@lilly-luo
lilly-luo deleted the andy/auto-claude-model-discovery branch September 18, 2026 13:47
andy-xu-db added a commit that referenced this pull request Sep 18, 2026
## 🥞 Stacked PR
Use this
[link](https://github.com/databricks/unity-gateway/pull/714/files/91df94411cb76842cfd1f957a165c023eafdd1ae..6b3d9ec7ef7957be48186bda1534c10fdecefcc9)
to review incremental changes.
-
[auto-claude-model-discovery](#710)
[[Files
changed](https://github.com/databricks/unity-gateway/pull/710/files)]
-
[**stack/andy/managed-config-cli-guard**](#714)
[[Files
changed](https://github.com/databricks/unity-gateway/pull/714/files/91df94411cb76842cfd1f957a165c023eafdd1ae..6b3d9ec7ef7957be48186bda1534c10fdecefcc9)]
← _this PR_
-
[stack/andy/managed-config-claude-discovery](#715)
[[Files
changed](https://github.com/databricks/unity-gateway/pull/715/files/6b3d9ec7ef7957be48186bda1534c10fdecefcc9..85b1f7eae704dacf19d56fb4808b928f96013fbb)]
-
[stack/andy/managed-config-codex-discovery](#716)
[[Files
changed](https://github.com/databricks/unity-gateway/pull/716/files/85b1f7eae704dacf19d56fb4808b928f96013fbb..80104ddb42eb1cc8b8d2274f97fa42e16719bb9d)]

---------
## Summary

- Reject explicit `--provider` and `--model-location` launch options
whenever the workspace returns a managed config, including an empty
config.
- Keep the existing first-launch/bootstrap path unchanged.
- Keep saved provider choices valid; only explicit command-line source
flags are rejected.

## Stack

Built directly on #710. Claude behavior is isolated in #715 and Codex
behavior in #716.

## Testing

- `uv run pytest -q --ignore=tests/test_e2e_user_agent.py`: 2,406
passed, 41 skipped at the stack tip
- `uv run pytest tests/test_cli.py -q`: 369 passed on this branch
- Ruff check and format check pass for all changed Python files
- `git diff --check`

---------

Co-authored-by: andy-xu-db <310751426+andy-xu-db@users.noreply.github.com>
Co-authored-by: lilly-luo <lilly.luo@databricks.com>
andy-xu-db added a commit that referenced this pull request Sep 18, 2026
## 🥞 Stacked PR
Use this
[link](https://github.com/databricks/unity-gateway/pull/716/files/ef21ce538e90530db5f55393ba03e0823607be56..d323731a0611b024c7dce5208b7d52a2dde5b964)
to review incremental changes.
-
[auto-claude-model-discovery](#710)
[[Files
changed](https://github.com/databricks/unity-gateway/pull/710/files)]
[MERGED]
-
[stack/andy/managed-config-cli-guard](#714)
[[Files
changed](https://github.com/databricks/unity-gateway/pull/714/files)]
-
[stack/andy/managed-config-claude-discovery](#715)
[[Files
changed](https://github.com/databricks/unity-gateway/pull/715/files/9b8ec21377a667876e9224618662e72c3c0f005b..ef21ce538e90530db5f55393ba03e0823607be56)]
-
[**stack/andy/managed-config-codex-discovery**](#716)
[[Files
changed](https://github.com/databricks/unity-gateway/pull/716/files/ef21ce538e90530db5f55393ba03e0823607be56..d323731a0611b024c7dce5208b7d52a2dde5b964)]
← _this PR_

---------
## Summary

- Extend the same managed MPS/Unity Catalog source precedence to Codex.
- Pass the effective source into Codex configuration and reuse its
existing automatic, source-scoped model catalog discovery at launch.
- Make a launch-scoped managed Unity Catalog parent suppress a
developer-saved provider without rewriting developer state.
- Support both generic configure and `configure --agent codex` without
requiring globally discovered models.
- Keep Claude discovery environment behavior out of the Codex path.
- Add one focused managed-MPS integration journey: bare fresh-home
launch and a nonempty scoped discovery catalog.

## Stack

Stacked on #715, #714, and #710. Merge from the bottom.

## Testing

- `uv run pytest -q --ignore=tests/test_e2e_user_agent.py`: 2,406
passed, 41 skipped at the stack tip before the integration-test-only
update
- Focused Claude/Codex/CLI and integration-contract suites after the
update: 717 passed
- Managed Claude/Codex CI lane collection verified locally
- Ruff check and format check pass for `tests/` and
`scripts/run_integration.py`
- `python3.12 scripts/run_integration.py --help`
- `git diff --check`
- Live managed integration is left to the managed CI lane because local
managed-workspace credentials were not used

Tested with MPS in Managed Config:
<img width="1346" height="565" alt="Screenshot 2026-09-18 at 9 31 22 AM"
src="https://github.com/user-attachments/assets/537ffefe-1aa2-4acf-a9dc-940239c13e54"
/>


https://github.com/user-attachments/assets/90211b36-b894-46a7-8900-93ae1685cc24

Tested with Unity Catalog Location in Managed Config:
<img width="1344" height="372" alt="Screenshot 2026-09-18 at 9 34 27 AM"
src="https://github.com/user-attachments/assets/ccdc5dc4-6e65-4ea3-9587-d7db3e5ff6aa"
/>


https://github.com/user-attachments/assets/e66e660c-ba47-4946-a082-b25f229ba052
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.

3 participants