Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 25, 2025

Summary

This PR fixes API errors that occur when using the Grok 4 model by removing the stream_options parameter from the xAI provider.

Problem

Users reported that while Grok 3 works well, Grok 4 frequently encounters API errors that make it difficult to complete tasks. The issue was that the xAI provider was including stream_options: { include_usage: true } in API requests, but Grok models do not support this parameter.

Solution

  • Removed stream_options: { include_usage: true } from the XAIHandler.createMessage() method
  • Added a comment explaining that Grok models don't support the stream_options parameter
  • Updated the corresponding test to reflect this change

Testing

  • All xAI provider tests pass successfully
  • Linting and type checking pass

Related Issue

Fixes #6211


Important

Remove stream_options from XAIHandler.createMessage() to fix Grok 4 API errors and update tests accordingly.

  • Behavior:
    • Removed stream_options: { include_usage: true } from XAIHandler.createMessage() in xai.ts to fix Grok 4 API errors.
    • Added a comment in xai.ts explaining Grok models don't support stream_options.
  • Testing:
    • Updated test in xai.spec.ts to reflect removal of stream_options parameter.
    • All xAI provider tests pass successfully.

This description was created by Ellipsis for dc45a26. You can customize this summary. It will automatically update as commits are pushed.

- Removed stream_options: { include_usage: true } from XAIHandler
- Grok models do not support the stream_options parameter
- This fixes API errors when using Grok 4 model
- Updated tests to reflect the change

Fixes #6211
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 25, 2025 14:35
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jul 25, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 25, 2025
@roomote roomote bot mentioned this pull request Jul 25, 2025
@daniel-lxs
Copy link
Member

The issue is not properly scoped so this is most likely incorrect

@daniel-lxs daniel-lxs closed this Jul 28, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 28, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Grok 4 problems

4 participants