Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/ucode/databricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,14 @@ def build_auth_shell_command(workspace: str, profile: str | None = None) -> str:
)


# Model ids the AI Gateway advertises but currently rejects at launch with
# "The provided model identifier is invalid." Filter them out at discovery so
# agent harnesses don't try to boot with them.
_CLAUDE_MODEL_DISCOVERY_DENYLIST = {
"databricks-claude-opus-4-8",
}


def discover_claude_models(workspace: str, token: str) -> tuple[dict[str, str], str | None]:
"""Discover Claude families on this workspace's AI Gateway.

Expand All @@ -820,7 +828,9 @@ def discover_claude_models(workspace: str, token: str) -> tuple[dict[str, str],
raw_ids = [
m["id"]
for m in data.get("data", [])
if isinstance(m.get("id"), str) and not m["id"].endswith("-anthropic")
if isinstance(m.get("id"), str)
and not m["id"].endswith("-anthropic")
and m["id"] not in _CLAUDE_MODEL_DISCOVERY_DENYLIST
]

result: dict[str, str] = {}
Expand Down
13 changes: 1 addition & 12 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,8 @@ def _run_gemini_gateway_smoke(workspace: str, model: str, token: str) -> str:
return data.get("candidates", [{}])[0].get("content", {}).get("parts", [{}])[0].get("text", "")


E2E_EXCLUDED_MODEL_IDS = {
# Listed by AI Gateway model discovery, but currently rejected at launch
# with "The provided model identifier is invalid."
"databricks-claude-opus-4-8",
}


def _launchable_model_items(models: dict) -> list[tuple[str, str]]:
return [
(family, model_id)
for family, model_id in models.items()
if model_id and model_id not in E2E_EXCLUDED_MODEL_IDS
]
return [(family, model_id) for family, model_id in models.items() if model_id]


# ---------------------------------------------------------------------------
Expand Down
Loading