Note: I wrote this with AI but I read through it and everything looks clear. TL/DR if you disable access to system catalog llms (many clients do this) and enable them as model services, ug/ucode won't be able to find them and fail on startup
Summary
ug claude reports "AI Gateway returned no Claude model ids" and "No coding agents are available on this workspace" even when the workspace has Claude model services available. In my Hershey sandbox I have three Claude model services (il-claude-haiku-4-5, il-claude-opus-5, il-claude-sonnet-5) and none of them are discovered.
Root cause
Model-services discovery is hardcoded to the system.ai schema in two places, so any Claude model service living in a different UC catalog/schema is invisible. My three models live in il_model_service.default, not system.ai.
The two hardcoded constants in src/ucode/databricks.py:
Both locks apply:
list_model_services() sends parent=schemas/system.ai, so the API only returns services in system.ai. The il_model_service.default services never come back.
- Even if they did,
_model_service_id() drops any name that doesn't start with system.ai..
Family bucketing itself is fine (il-claude-opus-5 contains claude-opus-), the ids just never reach it.
Why the fallback doesn't cover it
For Claude, when model-services comes back empty, cli.py falls back to discover_claude_models(), which hits the AI Gateway's Anthropic foundation-models endpoint. This workspace has no foundation models, so that returns nothing too. Both paths assume the models are either in system.ai or exposed as foundation-model endpoints. These are neither, they are UC model services in a custom catalog.
Worth noting: model_service_exists() already scopes to arbitrary schemas via parent=schemas/{catalog}.{schema}, so the codebase already knows model services can live outside system.ai. The main discovery walk just doesn't.
Steps to reproduce
- Create Claude model services in a catalog/schema other than
system.ai (mine are in il_model_service.default).
- Have no foundation-model endpoints in the workspace.
- Run
ug claude.
- Auth and gateway connect succeed, then:
ERROR No coding agents are available on this workspace / Claude models ...: AI Gateway returned no Claude model ids.
Suggested fix
A few options, trading speed vs completeness:
- Broaden the walk and relax the
system.ai. prefix requirement, bucketing purely by the claude-<family>- substring. Most robust, but an unscoped metastore walk can be slow on busy workspaces (the existing code comment notes ~50s).
- Make the catalog/schema configurable (e.g. an env var like
UCODE_MODEL_SERVICE_SCHEMA). Cheapest, keeps the fast single-page query.
system.ai first, then widen: keep the fast system.ai query, and only if it (and the foundation-model fallback) come up empty, do the broader walk. Keeps the common fast path and self-heals for custom-catalog workspaces.
Option 3 seems like the best balance.
Environment
- CLI:
ug / ucode
- Workspace: Azure Databricks (Hershey sandbox)
- Repo at commit
03aefdc
Note: I wrote this with AI but I read through it and everything looks clear. TL/DR if you disable access to system catalog llms (many clients do this) and enable them as model services, ug/ucode won't be able to find them and fail on startup
Summary
ug claudereports "AI Gateway returned no Claude model ids" and "No coding agents are available on this workspace" even when the workspace has Claude model services available. In my Hershey sandbox I have three Claude model services (il-claude-haiku-4-5,il-claude-opus-5,il-claude-sonnet-5) and none of them are discovered.Root cause
Model-services discovery is hardcoded to the
system.aischema in two places, so any Claude model service living in a different UC catalog/schema is invisible. My three models live inil_model_service.default, notsystem.ai.The two hardcoded constants in
src/ucode/databricks.py:_MODEL_SERVICE_REQUIRED_PREFIX = "system.ai."(client-side name filter)_MODEL_SERVICE_PARENT_SCHEMA = "schemas/system.ai"(server-side query scope)Both locks apply:
list_model_services()sendsparent=schemas/system.ai, so the API only returns services insystem.ai. Theil_model_service.defaultservices never come back._model_service_id()drops any name that doesn't start withsystem.ai..Family bucketing itself is fine (
il-claude-opus-5containsclaude-opus-), the ids just never reach it.Why the fallback doesn't cover it
For Claude, when model-services comes back empty,
cli.pyfalls back todiscover_claude_models(), which hits the AI Gateway's Anthropic foundation-models endpoint. This workspace has no foundation models, so that returns nothing too. Both paths assume the models are either insystem.aior exposed as foundation-model endpoints. These are neither, they are UC model services in a custom catalog.Worth noting:
model_service_exists()already scopes to arbitrary schemas viaparent=schemas/{catalog}.{schema}, so the codebase already knows model services can live outsidesystem.ai. The main discovery walk just doesn't.Steps to reproduce
system.ai(mine are inil_model_service.default).ug claude.ERROR No coding agents are available on this workspace/Claude models ...: AI Gateway returned no Claude model ids.Suggested fix
A few options, trading speed vs completeness:
system.ai.prefix requirement, bucketing purely by theclaude-<family>-substring. Most robust, but an unscoped metastore walk can be slow on busy workspaces (the existing code comment notes ~50s).UCODE_MODEL_SERVICE_SCHEMA). Cheapest, keeps the fast single-page query.system.aifirst, then widen: keep the fastsystem.aiquery, and only if it (and the foundation-model fallback) come up empty, do the broader walk. Keeps the common fast path and self-heals for custom-catalog workspaces.Option 3 seems like the best balance.
Environment
ug/ucode03aefdc