Skip to content

feat(providers): add xAI (Grok) to built-in providers - #899

Merged
lizhengfeng101 merged 5 commits into
alibaba:mainfrom
Magixyne:feat/xai-grok
Aug 15, 2026
Merged

feat(providers): add xAI (Grok) to built-in providers#899
lizhengfeng101 merged 5 commits into
alibaba:mainfrom
Magixyne:feat/xai-grok

Conversation

@Magixyne

Copy link
Copy Markdown
Contributor

Description

xAI (Grok) is rapidly gaining traction as a major AI infrastructure and Model-as-a-Service (MaaS) provider. This PR
adds the xAI (Grok) to built-in providers.

The preset targets xAI's OpenAI-compatible endpoint (https://api.x.ai/v1) with the XAI_API_KEY environment variable.
Although OCR supports all three protocols (anthropic, openai chat-completions, openai-responses), this preset is wired
with the OpenAI chat-completions protocol, seeded with current-generation models (grok-4.6, grok-4.5, grok-4.3,
grok-4.20-0309-reasoning, grok-4.20-0309-non-reasoning, grok-4.20-multi-agent-0309, grok-build-0.1) verified against
the official catalog. Built-in provider tables synced in en/zh/ja/ru docs.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally

  • Manual testing (describe below)

  • make test passes locally — all internal/llm provider tests pass, including the new TestLookupProvider_XAIDetails.
    Pre-existing, environment-sensitive failures in resolver_shellrc_test.go (TestShellRCFiles, TestTryShellRC) fail
    identically on main and are unrelated to this PR.

  • Manual testing (describe below): make check passes (license, english, tidy, gofmt — no diffs, vet); go build
    ./cmd/opencodereview succeeds.

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)
  • I have signed the CLA

Related Issues

none

@CLAassistant

CLAassistant commented Aug 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s).

Comment thread internal/llm/providers.go Outdated
Comment thread internal/llm/providers.go
Comment thread internal/llm/providers.go Outdated
Magixyne and others added 4 commits August 15, 2026 08:38
Co-authored-by: Tao Xin <wu2196674@icloud.com>
Co-authored-by: Tao Xin <wu2196674@icloud.com>
Co-authored-by: Tao Xin <wu2196674@icloud.com>
@Magixyne
Magixyne requested a review from wu21-web August 15, 2026 00:41

@wu21-web wu21-web left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@lizhengfeng101
lizhengfeng101 merged commit f7344e7 into alibaba:main Aug 15, 2026
13 checks passed
@Magixyne
Magixyne deleted the feat/xai-grok branch August 15, 2026 13:38
Githab-capibara added a commit to Githab-capibara/open-code-review that referenced this pull request Aug 23, 2026
* feat(llm): add xAI Grok provider preset

* Update internal/llm/providers.go

Co-authored-by: Tao Xin <wu2196674@icloud.com>

* Update internal/llm/providers.go

Co-authored-by: Tao Xin <wu2196674@icloud.com>

* apply ccec85 for test

* Update internal/llm/providers.go

Co-authored-by: Tao Xin <wu2196674@icloud.com>

---------

Co-authored-by: Tao Xin <wu2196674@icloud.com>
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.

4 participants