Skip to content

Add Grok 4.6 from SpaceXAI API - #1040

Merged
PeterDaveHello merged 1 commit into
ChatGPTBox-dev:masterfrom
PeterDaveHello:add-xai-grok-4.6
Aug 12, 2026
Merged

Add Grok 4.6 from SpaceXAI API#1040
PeterDaveHello merged 1 commit into
ChatGPTBox-dev:masterfrom
PeterDaveHello:add-xai-grok-4.6

Conversation

@PeterDaveHello

@PeterDaveHello PeterDaveHello commented Aug 12, 2026

Copy link
Copy Markdown
Member

Reference:

Summary by CodeRabbit

  • New Features

    • Added support for the xAI Grok 4.6 model.
    • Grok 4.6 is now available in the default API model selection.
  • Bug Fixes

    • Improved compatibility with the legacy xaiGrok4_6 model name when connecting to xAI.

@PeterDaveHello
PeterDaveHello requested a lite review from Copilot August 12, 2026 15:55
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 90f39f79-fef8-45bf-aaf6-99665ff233e0

📥 Commits

Reviewing files that changed from the base of the PR and between 257635f and 7866703.

📒 Files selected for processing (2)
  • src/config/index.mjs
  • tests/unit/services/apis/provider-registry.test.mjs

📝 Walkthrough

Walkthrough

The PR adds xaiGrok4_6 with the grok-4.6 model identifier, includes it in default API modes, and verifies that provider resolution maps it to xai.

Changes

xAI Grok 4.6 support

Layer / File(s) Summary
Register and validate the xAI model
src/config/index.mjs, tests/unit/services/apis/provider-registry.test.mjs
The configuration adds xaiGrok4_6 to the xAI model keys, model metadata, and default API modes. The provider-registry test verifies resolution to xai.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: josstorer

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding Grok 4.6 support through the xAI API.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Add xAI Grok 4.6 model preset and enable it by default

✨ Enhancement 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Register Grok 4.6 in the xAI model preset list and model metadata.
• Add Grok 4.6 to the default API mode options.
• Extend provider-registry unit coverage for the new xAI model key.
Diagram

graph TD
  A["src/config/index.mjs"] --> B["xAI model presets"] --> C["Default API modes"]
  B --> D["provider-registry.mjs"] --> E{{"xAI API"}}
  A --> F["provider-registry.test.mjs"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Fetch available xAI models dynamically
  • ➕ Avoids hard-coding model versions and reduces future update PRs
  • ➕ Can automatically surface newly released models without redeploy
  • ➖ Adds runtime network dependency and caching/error-handling complexity
  • ➖ Can create UI/behavior drift if the provider changes model availability unexpectedly
2. Alias Grok 4.6 to 4.5 behind a feature flag
  • ➕ Lower risk rollout if downstream behavior/compatibility is uncertain
  • ➕ Easy rollback without removing the model entry
  • ➖ Adds config branching/flag management overhead
  • ➖ Less transparent to users which exact model is being used

Recommendation: The current approach (explicitly adding a new model key in the central config) is appropriate for a preset-based model registry and keeps behavior deterministic. Consider dynamic model discovery only if frequent provider model churn becomes a maintenance burden.

Files changed (2) +7 / -1

Enhancement (1) +6 / -1
index.mjsRegister Grok 4.6 preset and add it to default API modes +6/-1

Register Grok 4.6 preset and add it to default API modes

• Adds 'xaiGrok4_6' to 'xaiApiModelKeys', introduces a 'Models.xaiGrok4_6' entry mapping to 'grok-4.6', and includes the new mode in 'defaultApiModeIds' so it appears by default.

src/config/index.mjs

Tests (1) +1 / -0
provider-registry.test.mjsAdd unit assertion for xaiGrok4_6 provider resolution +1/-0

Add unit assertion for xaiGrok4_6 provider resolution

• Extends the legacy model-name provider resolution test to ensure 'xaiGrok4_6' maps to the 'xai' provider ID.

tests/unit/services/apis/provider-registry.test.mjs

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown

Greptile Summary

Registers Grok 4.6 as an xAI API model and exposes it in the default API-mode list.

  • Adds the xaiGrok4_6 model key and grok-4.6 API identifier.
  • Routes legacy sessions using the new key to the built-in xAI provider.
  • Extends provider-resolution test coverage for the model.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The new model follows existing xAI registration conventions, resolves through the existing xAI prefix-based provider path, and requires no additional model-specific request metadata.

Important Files Changed

Filename Overview
src/config/index.mjs Adds Grok 4.6 consistently to the xAI model group, model registry, and default API-mode list.
tests/unit/services/apis/provider-registry.test.mjs Confirms that sessions using the Grok 4.6 configuration key resolve to the xAI provider.

Reviews (1): Last reviewed commit: "Add Grok 4.6 from SpaceXAI API" | Re-trigger Greptile

@qodo-code-review

qodo-code-review Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Missing xAI (Grok 4.6) i18n key ✗ Dismissed 📘 Rule violation ⚙ Maintainability
Description
The PR adds a new user-facing model label xAI (Grok 4.6) but does not add the corresponding
English localization entry (and thus other locales cannot translate it). This can cause non-English
users to see an untranslated/incorrect label in UI surfaces that call t() for model descriptions.
Code

src/config/index.mjs[R694-697]

+  xaiGrok4_6: {
+    value: 'grok-4.6',
+    desc: 'xAI (Grok 4.6)',
+  },
Evidence
The checklist requires new user-facing text to be added as English localization keys first. The PR
introduces the new label via Models.xaiGrok4_6.desc, and the app translates model descriptions
through t(Models[modelName].desc), but the English locale file section containing other
model/provider labels does not include an entry for xAI (Grok 4.6), meaning the new label is not
properly localized.

Rule 2262059: Add new English localization keys before other locales
src/config/index.mjs[694-697]
src/utils/model-name-convert.mjs[26-33]
src/_locales/en/main.json[171-223]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new user-facing model label (`xAI (Grok 4.6)`) was introduced in `Models` but no corresponding localization key was added to `src/_locales/en/main.json` (and other locales).

## Issue Context
Model labels are passed through `t()` (see `modelNameToDesc()`), so every new `Models[...].desc` string should exist as a localization key.

## Fix Focus Areas
- src/config/index.mjs[694-697]
- src/utils/model-name-convert.mjs[26-33]
- src/_locales/en/main.json[171-223]
- src/_locales/*/main.json[1-99999]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context
✅ Compliance rules (platform): 6 rules

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/config/index.mjs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds xAI Grok 4.6 support to the extension’s API model configuration so it can be selected (and is included by default) alongside existing Grok models, with a unit test ensuring legacy model-name routing still resolves to the xAI provider.

Changes:

  • Added xaiGrok4_6 to the xAI API model key list and Models registry with API ID grok-4.6.
  • Included xaiGrok4_6 in the default API mode IDs so it appears in default selections.
  • Extended provider-registry unit coverage to ensure xaiGrok4_6 legacy model names resolve to provider xai.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/unit/services/apis/provider-registry.test.mjs Adds a unit assertion for legacy xaiGrok4_6 provider resolution.
src/config/index.mjs Registers Grok 4.6 in xAI model keys/models and adds it to default API mode IDs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@PeterDaveHello
PeterDaveHello merged commit 835a798 into ChatGPTBox-dev:master Aug 12, 2026
5 checks passed
@PeterDaveHello
PeterDaveHello deleted the add-xai-grok-4.6 branch August 12, 2026 16:01
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