From f07cdd21497b2061f1bc7575e80da1916fbc8c2f Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 07:22:10 +0000 Subject: [PATCH] feat: update xAI model to Grok 4.3 (grok-latest) - Update lib/utils/index.ts to use 'grok-latest' for 'Grok 4.3' - Update default settings to use 'Grok 4.3' - Update model selection UI to reflect 'Grok 4.3' - Update error messages and logs to refer to 'Grok 4.3' Closes #581 Co-authored-by: ngoiyaeric <115367894+ngoiyaeric@users.noreply.github.com> --- code_review_request.md | 15 +++++++++++++++ .../settings/components/model-selection-form.tsx | 4 ++-- components/settings/components/settings.tsx | 2 +- lib/utils/index.ts | 10 +++++----- 4 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 code_review_request.md diff --git a/code_review_request.md b/code_review_request.md new file mode 100644 index 00000000..35690a07 --- /dev/null +++ b/code_review_request.md @@ -0,0 +1,15 @@ +# Code Review Request: Update xAI Model to Grok 4.3 + +## Changes: +1. Updated `lib/utils/index.ts`: + - Replaced `Grok 4.2` with `Grok 4.3` in switch cases and error messages. + - Updated model identifier from `grok-4-fast-non-reasoning` to `grok-latest`. +2. Updated `components/settings/components/settings.tsx`: + - Updated default `selectedModel` to `Grok 4.3`. +3. Updated `components/settings/components/model-selection-form.tsx`: + - Updated `models` array entries from `Grok 4.2` to `Grok 4.3`. + +## Verification: +- Targetted unit tests in `lib/utils/index.test.ts` pass. +- Syntax verification using `bun build` for all modified files. +- Verified no remaining occurrences of old model strings. diff --git a/components/settings/components/model-selection-form.tsx b/components/settings/components/model-selection-form.tsx index 148ba85a..bae03dc2 100644 --- a/components/settings/components/model-selection-form.tsx +++ b/components/settings/components/model-selection-form.tsx @@ -35,8 +35,8 @@ const models = [ badgeVariant: "default" as const, }, { - id: "Grok 4.2", - name: "Grok 4.2", + id: "Grok 4.3", + name: "Grok 4.3", description: "The latest from xAI, pushing the boundaries of reasoning and problem-solving.", icon: Rocket, badge: "New", diff --git a/components/settings/components/settings.tsx b/components/settings/components/settings.tsx index 7a526e18..d5db12a4 100644 --- a/components/settings/components/settings.tsx +++ b/components/settings/components/settings.tsx @@ -54,7 +54,7 @@ export type SettingsFormValues = z.infer const defaultValues: Partial = { systemPrompt: "You are a planetary copilot, an AI assistant designed to help users with information about planets, space exploration, and astronomy. Provide accurate, educational, and engaging responses about our solar system and beyond.", - selectedModel: "Grok 4.2", + selectedModel: "Grok 4.3", users: [], } diff --git a/lib/utils/index.ts b/lib/utils/index.ts index 5303da34..ee31399d 100644 --- a/lib/utils/index.ts +++ b/lib/utils/index.ts @@ -34,20 +34,20 @@ export async function getModel(requireVision: boolean = false) { if (selectedModel) { switch (selectedModel) { - case 'Grok 4.2': + case 'Grok 4.3': if (xaiApiKey) { const xai = createXai({ apiKey: xaiApiKey, baseURL: 'https://api.x.ai/v1', }); try { - return xai('grok-4-fast-non-reasoning'); + return xai('grok-latest'); } catch (error) { - console.error('Selected model "Grok 4.2" is configured but failed to initialize.', error); + console.error('Selected model "Grok 4.3" is configured but failed to initialize.', error); throw new Error('Failed to initialize selected model.'); } } else { - console.error('User selected "Grok 4.2" but XAI_API_KEY is not set.'); + console.error('User selected "Grok 4.3" but XAI_API_KEY is not set.'); throw new Error('Selected model is not configured.'); } case 'Gemini 3': @@ -85,7 +85,7 @@ export async function getModel(requireVision: boolean = false) { baseURL: 'https://api.x.ai/v1', }); try { - return xai('grok-4-fast-non-reasoning'); + return xai('grok-latest'); } catch (error) { console.warn('xAI API unavailable, falling back to next provider:'); }