Repository navigation
copilot: VS Code models from a Model Provider Service or model location, Claude on Anthropic Messages - #1358
Conversation
… and Claude on Anthropic Messages ug configure --agents vscode takes --provider <catalog.schema.name> or --model-location <catalog.schema>, picking the models the way ug copilot does. The extension sends a provider's header, uses the gateway's OpenAI route for its OpenAI models, and calls every Claude model through Anthropic Messages with prompt-cache points. Co-authored-by: Isaac <no-reply@databricks.com>
Polly AI ReviewBlocking issues
Security vulnerabilitiesNo additional concrete vulnerabilities found by static inspection. The completion-validation issue above affects the intended fail-closed tool boundary. Non-blocking notes
ApproachThe shared Copilot catalog, provider validation, and model-limit helpers fit the outcome. One concrete simplification: share Claude release-suffix normalization instead of duplicating its regex in SummaryDiff size (computed): 12 files; +689 / -114 lines (803 changed text lines); 0 binary files.
Shares use additions + deletions, including generated text and lockfiles. Binary files have no line count. Tests include fixtures/helpers under test paths and colocated test/spec files; categories are path-based, not coverage measurements. ChangesVS Code configuration gains provider-service and model-location sources, explicit model families, and provider-aware routing. Claude requests move to Anthropic Messages, including request translation and streamed completion handling. Python and TypeScript tests, extension documentation, and the bundled JavaScript accompany those changes; no dependencies change. The size is proportionate to adding both configuration and transport behavior. Shared release-suffix normalization is a concrete opportunity to reduce duplication without removing functionality. Added or modified source comments are brief; no conciseness issue was found. TestsTest-by-test assessmentAssessment is static; tests were not run. The PR reports automated and manual checks, but their execution was not independently verified. The table accounts for changed tests and support edits, including renamed cases and parameterized inputs.
Existing coverage protects default-discovery failures, reinstall/revert, authentication variants, shared catalog failures, Copilot’s external Claude limits, token renewal, and common tool-argument validation. Those assertions do not need duplicate E2E tests. The remaining concrete additions are the completion-validation regression and configuration transition noted above. Split-result merging is a useful translator boundary case, though its occurrence in Copilot input remains unverified. VS Code’s no-Claude Bedrock rejection has indirect protection through shared resolver coverage. After fixes, verify the malformed stream emits no tools and that provider → location → flagless reconfiguration clears provider routing. Run focused Python and extension checks in a credential-free checkout with dependencies already installed. ScopeAll changed files support the stated configuration and Anthropic-routing outcome; no clearly unrelated changes were found. Managed VS Code configuration remains the declared follow-up. No linked issue narrows that outcome, and the truncated description does not establish additional scope exclusions. Automated review by Polly · workflow run |
…s, retry a refused output limit A model's real output limit can be below the one ug configures, which Anthropic Messages rejects; the gateway names the limit it allows, so retry once with it. --provider and --model-location now refuse any other model agent in the same run, and the per-model api picks its route through a lookup. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…ond set of names Co-authored-by: Isaac <no-reply@databricks.com>
A service's targets are the provider's ids, which is what its users know it by, and its regional variants differ only by a prefix a readable label drops. Co-authored-by: Isaac <no-reply@databricks.com>
A system-role input item is refused outright by Microsoft Foundry, which made every turn through a Foundry service fail; OpenAI and Azure OpenAI accept the prompt either way. Co-authored-by: Isaac <no-reply@databricks.com>
Azure names a regional deployment `eu/gpt-5.6-luna`, which no longer hid the model behind its region: such a model was classified for Chat Completions, which also switched off image input, and its family reached Copilot Chat unrecognisable. Co-authored-by: Isaac <no-reply@databricks.com>
🥞 Stacked PR
Use this link to review incremental changes.
Summary
ug configure --agents vscodecan now give Copilot Chat in VS Code the models of a Model Provider Service or of a Unity Catalog model location, not only the workspace'ssystem.aimodels. Every Claude model now goes through the Anthropic Messages API.Choosing the models
--provider <catalog>.<schema>.<name>uses the models of a Model Provider Service, chosen the wayug copilot --providerchooses them:--model-location <catalog>.<schema>uses the model services in that schema, asug copilot --model-locationlists them.--agents vscode. Running configure without either flag goes back tosystem.ai.ug-config.json, and nothing else reads it.Routing
Databricks-Model-Provider-Serviceheader./ai-gateway/openai/v1. The gateway doesn't serve Model Provider Services on/ai-gateway/mlflow/v1.Anthropic Messages for Claude
system.aiones, now calls/ai-gateway/anthropic/v1/messages, the route Claude Code and Copilot CLI use.tool_result.end_turn,tool_useandstop_sequencefinish normally;max_tokensreports the output limit, andrefusalreads like a content-filter stop;message_stop, so a cut-off stream runs no tool.Changes to the config and shared code
ug-config.jsongains a top-levelproviderand a per-modelfamily. Withoutfamily, the extension would derive the model's name from the text after the last dot, which turnsgpt-5.5into5.provider_service_catalogtakes atoolargument, and VS Code is added to the provider types the gateway listing accepts.catalog_model_limits, which Copilot CLI and VS Code share.Managed config for VS Code is a follow-up.
Testing
copilot_viewImageand wrote its colour ("red").system.aimodel:end_turn,tool_use,max_tokens);max_tokensof 128K was accepted;tool_result;mlflow/v1for Model Provider Services;openai/v1for OpenAI-type services;anthropic/v1/messagesfor Anthropic and Bedrock services.This pull request and its description were written by Isaac.