Skip to content

Fix Claude --model without a managed catalog - #1037

Merged
andy-xu-db merged 4 commits into
mainfrom
codex/fix-claude-explicit-model
Oct 8, 2026
Merged

andy-xu-db merged 4 commits into
mainfrom
codex/fix-claude-explicit-model

Conversation

@andy-xu-db

@andy-xu-db andy-xu-db commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fix ug claude --model <id> without a managed catalog by forwarding the exact ID to Claude's native --model. Remove #1004's catalog-gated alias fallback, which could resolve to the OS-managed Opus default instead. Keep selection launch-scoped and preserve family defaults, model restrictions, and #1004's URL fixes.

Merged current main and trimmed duplicate catalog permutations and documentation. Production diff: 4 additions / 46 deletions. Regression coverage retains Claude/GPT IDs, both flag spellings, saved settings, managed restrictions, and native argument precedence. The existing live journey now covers both sides of UG's separator and checks JSON modelUsage.

Verification

  • Focused Claude launch, CLI, smart-routing, managed lifecycle/resolution, and integration-contract suites: 965 passed, one existing forkpty warning.
  • The four CLI-to-launcher regression cases previously failed on baseline 7deeaf7a; all four pass with the fix.
  • Ruff lint/format on src/ tests/, ty check src/, runner help, and git diff --check: passed.
  • Integration collection: 103 selected cases, including all four explicit-model variants. Live inference not run locally.
  • Extended Ruff check on the unchanged scripts/run_integration.py reports two existing TID251 violations (lines 212 and 242), reproduced on current main. Left out of scope.
Screen.Recording.2026-10-08.at.10.56.19.AM.mov

@andy-xu-db
andy-xu-db requested a review from JTSIV1 October 8, 2026 14:57

@JTSIV1 JTSIV1 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.

this makes sense to me. thanks!

@andy-xu-db
andy-xu-db enabled auto-merge October 8, 2026 15:14
@andy-xu-db
andy-xu-db added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit de4b119 Oct 8, 2026
115 of 127 checks passed
@andy-xu-db
andy-xu-db deleted the codex/fix-claude-explicit-model branch October 8, 2026 17:46
GirishS2093 pushed a commit to GirishS2093/unity-gateway that referenced this pull request Oct 11, 2026
…atabricks#930)

## Summary

Add fresh-launch journeys and dedicated CUJ7 model discovery/inference
coverage. Tracks AIGTWY-4882.

- Keep fresh `--workspace` file tasks and `--provider` launch checks in
the Full agent suites. Provider cases consume existing services and do
not perform inference.
- Add five CUJ7 journeys / eight collected cases: configured Claude
picker discovery, configured Codex app-server discovery, fresh scoped
file tasks for both agents, and preservation of preexisting Claude
OS-managed family defaults during explicit model selection.
- Exercise Claude's UG-owned `--model` before `--` and native argument
forwarding after it. Codex covers model flags before the separator and
within native `exec`. Require completed file answers and model
attribution, not just startup or routing banners.
- Rebase onto databricks#1040 and reuse its shared bearer, cleanup,
served-response checks, and absolute-path Claude prompts.
`test_cuj7_model_discovery.py` defines `CUJ_NAME`, so automatic CI
discovery runs it as `E2E CUJs · CUJ 7 · Unmanaged model discovery`
without workflow changes.
- Keep CUJ7 sessions function-scoped for fresh-launch coverage; the
shared class fixture requires a published config, while this workspace
must remain unmanaged. Preserve existing test names. No production
changes, fixture provisioning, or remote configuration mutations.

## Workspace prerequisites

CUJ7 is pinned to `https://dbc-14e376e8-6541.cloud.databricks.com`
(workspace `7474651332480761`). It must publish no CodingAgentConfig,
expose discoverable `system.ai` models, and retain
`ug_e2e.models.claude_haiku`, `ug_e2e.models.claude_sonnet`, and
`ug_e2e.models.gpt_luna`.

The shared `UG_CUJ_SP_CLIENT_ID` / `UG_CUJ_SP_CLIENT_SECRET` identity
needs workspace access, read access to config/model discovery, and use
access to those services. Only a short-lived bearer reaches agent
processes. Each case checks that the workspace remains unmanaged. The
preservation cases seed distinct Sonnet and other-family defaults on a
clean disposable runner, assert Sonnet inference and unchanged defaults,
then remove that local input.

## Regression verification: before and after databricks#1037

Ran the **same post-fix component test files** (`tests/test_cli.py`,
`tests/test_agent_claude.py`, and `tests/test_agent_codex.py`) against
isolated source snapshots of the merged databricks#1037 fix and its immediate
parent. Confirmed imports came from the intended snapshot in each run.

| Source revision | Identical updated component suite |
| --- | --- |
| Before fix: `abf85db12d39c6c78a30b503cc0c7632d26245c6` | **957 passed,
6 failed** |
| After fix (databricks#1037): `de4b119d9e8678131b0e6bd15addeb136164d72f` | **963
passed** |

All four `test_unmanaged_claude_model_reaches_native_launcher`
regressions (Claude/GPT IDs × separate/equals spellings) fail before the
fix specifically because the native command omits `--model MODEL`; all
four pass after it. The pre-fix revision's original component suite
passes **959 tests**, demonstrating that the previous assertions missed
this boundary.

The older live explicit-model test only placed `--model` after `--`,
bypassing UG's model-selection path. Coverage now includes the normal
UG-owned option before the separator as well as supplemental native
forwarding. **The before/after comparison is component evidence, not a
live CUJ or real-inference comparison.**

## Current validation

- After rebasing onto databricks#1040 and migrating helpers: **1,192
component/helper/contract tests passed**.
- All **eight CUJ7 cases** collect; the CI discovery contract recognizes
the file and its unique shard name.
- Repository-wide Ruff checks and formatting, source type checks, and
`git diff --check`: passed.
- Live inference was **not run locally**: this host has
`/etc/claude-code/managed-settings.json`, which can override isolated
agent settings and model selection. The suite requires a clean
disposable runner; CI must validate live inference and SP permissions.

---------

Co-authored-by: Isaac <no-reply@databricks.com>
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