Skip to content

ug claude can't find any LLMs when model services live outside system.ai #569

Description

@mpkrass7

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

Image

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:

  1. 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.
  2. 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

  1. Create Claude model services in a catalog/schema other than system.ai (mine are in il_model_service.default).
  2. Have no foundation-model endpoints in the workspace.
  3. Run ug claude.
  4. 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:

  1. 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).
  2. Make the catalog/schema configurable (e.g. an env var like UCODE_MODEL_SERVICE_SCHEMA). Cheapest, keeps the fast single-page query.
  3. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions