claude: accept custom Messages-API MS in managed-config validation - #348
Open
andy-xu-db wants to merge 2 commits into
Open
claude: accept custom Messages-API MS in managed-config validation#348andy-xu-db wants to merge 2 commits into
andy-xu-db wants to merge 2 commits into
Conversation
Add discover_anthropic_messages_models (mirroring discover_codex_models) for anthropic/v1/messages endpoints, wire it into _known_models so validate_manifest accepts them, and extend _with_claude_inventory so `ucode apply` re-fetches them for a hand-edited manifest. Custom Model Serving exposing the Messages API is now validated without the custom_models escape hatch. Co-authored-by: Isaac
Remove the discover_anthropic_messages_models docstring and collapse multi-line signatures to satisfy ruff format (CI failure on #348). Co-authored-by: Isaac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes
ucode's managed-config validation accept custom Model Serving endpoints that expose the Anthropic Messages API (anthropic/v1/messages), without requiring the admin to hand-type them intocustom_models.Why
Today, Claude discovery in ucode is name-based:
discover_claude_modelshits/ai-gateway/anthropic/v1/models, keeping ids matchingdatabricks-claude-<family>-*.discover_model_serviceslists UCsystem.ai.claude-*ids.A custom Model Serving endpoint whose name carries neither substring falls through both. When an admin pins such an endpoint in a managed config,
validate_manifestrejects it as "not available on this workspace" — unless they manually add it tocustom_models. Codex/Gemini already solve this with API-type-based discovery (discover_endpoints_with_api_type); this adds the Claude analog.What changed
databricks.py:discover_anthropic_messages_models()— a one-line wrapper around the existingdiscover_endpoints_with_api_type(..., "anthropic/v1/messages"), mirroringdiscover_codex_models(openai/v1/responses).managed_setup.py:_known_models()now readsstate["anthropic_messages_models"]sovalidate_manifesttreats those ids as known/routable.managed_wizard.py:_with_claude_inventory()(theucode applyvalidation path) best-effort fetchesdiscover_anthropic_messages_modelsand stashes it onstate, so a hand-edited manifest pinning a custom MS validates instead of being rejected.Testing
test_databricks.py:discover_anthropic_messages_modelsreturns onlyanthropic/v1/messagesendpoints (filters outopenai/v1/responses).test_managed_setup.py: a custom MS id is accepted whenstate["anthropic_messages_models"]carries it.test_managed_wizard.py:applypublishes a manifest pinning a custom MS (re-fetch surfaces it).test_agent_claude,test_managed_setup,test_managed_wizard,test_databricks,test_cli) passes.This pull request and its description were written by Isaac.