Repository navigation
fix(core): route fallback Copilot Claude models to Anthropic Messages - #53362
Closed
opencode-agent[bot] wants to merge 1 commit into
Closed
opencode-agent[bot] wants to merge 1 commit into
opencode-agent[bot] wants to merge 1 commit into
Conversation
|
Hey, when are you guys able to merge and release it? Blocking me from working with opencode |
Contributor
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
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.
When Copilot's
/modelscall fails (for example, a corporate proxy blocks it), the plugin falls back to the models.dev catalog and moves every model onto the bundled Copilot SDK. The language hook then picks Responses or chat completions from the model ID. Claude has no rule there, so it ends up on chat completions. With thinking on, each tool turn emits anotherreasoning_opaque, and the Copilot chat model rejects the second one (#51466).When the live list loads, Claude goes to
/v1/messagesbecause Copilot advertises that endpoint. This change gives the fallback the same route: models whose ID starts withclaude-now use the native Anthropic package with<copilot base URL>/v1, the same setupCopilotModels.builduses for Messages models.The catalog's variants for these models were written for chat completions (
reasoningEffort), and Messages ignores that setting. So the Claude fallback rebuilds them with the Anthropic Messages variant protocol, using the same effort values. Variants that don't usereasoningEffortare left alone.The other fallback routes stay as they are: GPT-5+ (except gpt-5-mini), Grok, Gemini and MAI Code use Responses, and everything else uses chat completions.
Testing:
bun test test/plugin/provider-github-copilot.test.ts(the new test fails without the fix)bun run typecheckinpackages/coreRequested by: @rekram1-node (Aiden Cline via Slack)