feat: add xAI Grok integration with its current features#29
Open
feat: add xAI Grok integration with its current features#29
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)
- 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
- 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrated open PR from upstream for local review.
Upstream: opencode-ai#307
Upstream head:
askiiRobotics:main@cebdf6a