Skip to content

Fix Mistral model matching bug - change from "tral-" to "mistral-" prefix #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jun 2, 2025

The Mistral provider's matchesModel() method was incorrectly using model.startsWith("tral-") instead of model.startsWith("mistral-"), causing it to fail to match valid Mistral model names like "mistral-small-latest".

Problem

  • Models like "mistral-small-latest" were not being matched by the Mistral provider
  • The method was checking for the wrong prefix: "tral-" instead of "mistral-"
  • This meant requests with Mistral models would fail to route to the correct provider

Solution

Changed the model matching logic from:

return model.startsWith("tral-")

To:

return model.startsWith("mistral-")

Validation

  • ✅ "mistral-small-latest" now correctly matches
  • ✅ "mistral-large" now correctly matches
  • ✅ Invalid models like "tral-test" correctly don't match
  • ✅ Follows the same pattern as other providers (OpenAI uses "gpt-", Anthropic uses "claude-", etc.)
  • ✅ Build passes successfully

Fixes #5.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Mistral model matching bug Fix Mistral model matching bug - change from "tral-" to "mistral-" prefix Jun 2, 2025
@Copilot Copilot AI requested a review from hughcrt June 2, 2025 02:35
Copilot finished work on behalf of hughcrt June 2, 2025 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mistral model matching bug
2 participants