Skip to content

Conversation

@pwang347
Copy link
Member

@pwang347 pwang347 commented Oct 30, 2025

Validated that the behaviour change does not seem drastic. Given relatively lower usage from BYOK route, I think we can make all the prompts consistent for xAI models without need for ExP.

Note: ideally we should pass the provider's byok ID directly, but as is there's a layering issue.

@pwang347 pwang347 requested a review from bhavyaus October 31, 2025 17:55
@pwang347 pwang347 marked this pull request as ready for review October 31, 2025 17:55
Copilot AI review requested due to automatic review settings October 31, 2025 17:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a matchesModel static method to the XAIPromptResolver class to enable more precise model matching for xAI endpoints. This allows the xAI prompt resolver to be matched based on the endpoint's family property ("xAI") rather than relying solely on the model name prefix ("grok-code").

Key Changes

  • Added a matchesModel static method to XAIPromptResolver that checks if endpoint.family === 'xAI'

Comment on lines +124 to +126
static matchesModel(endpoint: IChatEndpoint): Promise<boolean> | boolean {
return endpoint.family === 'xAI';
}
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The matchesModel implementation checks for endpoint.family === 'xAI', while familyPrefixes is set to ['grok-code']. This creates a discrepancy where the matcher uses the family property ('xAI') but the prefix fallback uses a different value ('grok-code'). According to the PromptRegistry.getPrompt logic, matchers are checked first, so the prefix list may never be used for xAI endpoints. Consider either aligning the familyPrefixes with the actual family name (e.g., ['xAI']) or documenting why these values differ.

Copilot uses AI. Check for mistakes.
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.

2 participants