-
Notifications
You must be signed in to change notification settings - Fork 659
feat: add xAI Grok integration with its current features #307
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
base: main
Are you sure you want to change the base?
Conversation
- Complete xAI provider with 8 Grok models (2/3/4 series) - Deferred completion support for long-running requests - Concurrent request handling for improved performance - Web search tool integration for real-time information - Image generation and vision capabilities - Advanced reasoning support with model-specific validation Core provider features: - Full streaming support with proper error handling - Intelligent model selection and configuration - Robust caching and retry mechanisms - Provider-specific option handling (reasoning, deferred, concurrent) - Comprehensive test coverage for all capabilities Configuration enhancements: - Runtime options support via CLI flags (--deferred, --deferred-timeout) - Provider-level deferred completion configuration - Auto-enable rules for smart feature activation - Model-specific reasoning effort validation (xAI: low/high only) - Enhanced agent configuration with override capabilities Tool ecosystem expansion: - Web search tool for real-time information retrieval - Enhanced coder agent toolset with web capabilities - Improved tool validation and error handling - Better integration with existing LSP and file tools Documentation and schema updates: - Comprehensive README updates with xAI model details - Updated configuration schema with new provider options - Enhanced CLI help text and examples - Added feature capability documentation
.claude/settings.local.json - deleted
- Fix EventThinkingDelta to use event.Thinking field instead of event.Content - Add ReasoningContent field to ProviderResponse for XAI reasoning models - Fix tool schema double-wrapping issue causing "Invalid function schema" errors - Add reasoning_effort validation: convert "medium" to "high" for Grok-3-mini models - Add XAIHTTPClient for proper request handling with reasoning support - Add ReasoningHandler to process reasoning content and emit thinking deltas - Fix ls tool to handle uninitialized config in test environments - Fix message rendering to properly display reasoning content - Add content truncation for very long messages to prevent UI issues - Fix platform-specific help key bindings (macOS vs Linux)
Thanks for this PR, I wanted to try Grok4 with OpenCode but got this message:
|
- Updated ShouldUseReasoning() to properly handle Grok 4's automatic reasoning - Grok 4 now uses the reasoning handler path without requiring reasoning_effort parameter - This ensures proper tool schema handling for Grok 4 models
Dear Tycale, This has now been fixed — thanks for pointing it out! Heads-up: Still includes many untested features and plenty of room for improvement beyond basic chat. Core functionality is there, but it needs proper integration with UI and other components. |
Thanks, I will ASAP ! |
hmm, it's kind of working, I got some responses but I have a lot of
(Grok4) |
Just noticed that switching back to o3 will produce the following error :
|
- Implement FilterToolsByProvider to restrict tools based on provider capabilities - Add Providers field to ToolInfo struct for specifying tool availability - Integrate filtering across all provider clients (OpenAI, Gemini, xAI, Copilot) - Add comprehensive tests for tool filtering logic with case-insensitive matching - Update web search tool to be xAI-only as it requires live search capabilities - Clarify Grok 4 reasoning behavior in docs and comments (internal reasoning only)
Thanks for pointing this out — you're right on both counts.
I’ve just pushed a commit that should resolve both: feat: Add provider-based tool filtering for model compatibility This should prevent the mismatches you were seeing and improve fallback behavior. One caveat: I still have concerns about pricing accuracy for xAI — this will need another pass to verify. Appreciate the testing and feedback — feel free to flag anything else that comes up! |
Can be fixed with
I will be able to play a bit more now :) Thanks for this PR, I really appreciate it ! 🙏🏻 |
Grok 4, 32k token-per-minute cap is somehow annoying… C’mon, Elon, let me spend my money ! 😢 |
@askiiRobotics we have added you to the early access for what will become the next version of @Tycale make sure to submit https://charm.sh/early-access/ if you want to try out the new version. |
@kujtimiihoxha I’d be keen to also try it out and share my feedback. I’m a heavy user of Claude Code and OpenCode, and I’ve also relied on aider.chat quite a bit in the past. |
Just merge it! YOLO! |
Hey folks! Just a heads up - I mainly tested this with xAI/Grok since
that's what I wanted to try out, and it felt solid enough to use as a
foundation. Haven't thoroughly tested with other providers yet, so if you
notice any issues or regressions with OpenAI/Anthropic/etc., please feel
free to jump in and fix this PR! 🙏
Configuration enhancements:
Documentation and schema updates: