Skip to content

fix(core): route fallback Copilot Claude models to Anthropic Messages - #53362

Closed
opencode-agent[bot] wants to merge 1 commit into
devfrom
copilot-fallback-endpoints
Closed

opencode-agent[bot] wants to merge 1 commit into
devfrom
copilot-fallback-endpoints

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

When Copilot's /models call 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 another reasoning_opaque, and the Copilot chat model rejects the second one (#51466).

When the live list loads, Claude goes to /v1/messages because Copilot advertises that endpoint. This change gives the fallback the same route: models whose ID starts with claude- now use the native Anthropic package with <copilot base URL>/v1, the same setup CopilotModels.build uses 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 use reasoningEffort are 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 typecheck in packages/core

Requested by: @rekram1-node (Aiden Cline via Slack)

@wzhkdi

wzhkdi commented Oct 6, 2026

Copy link
Copy Markdown

Hey, when are you guys able to merge and release it? Blocking me from working with opencode

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
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:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants