Skip to content

fix(grok): surface per-model reasoning effort in the composer - #5403

Open
ahmed-besic wants to merge 1 commit into
pingdotgg:mainfrom
ahmed-besic:fix/grok-reasoning-effort
Open

fix(grok): surface per-model reasoning effort in the composer#5403
ahmed-besic wants to merge 1 commit into
pingdotgg:mainfrom
ahmed-besic:fix/grok-reasoning-effort

Conversation

@ahmed-besic

@ahmed-besic ahmed-besic commented Aug 5, 2026

Copy link
Copy Markdown

What Changed

Grok already advertises per-model reasoning effort menus over ACP (models.availableModels[]._meta.reasoningEfforts), but T3 published every Grok model with empty capabilities and never applied a selected effort. The composer therefore had no Reasoning control for Grok, unlike Claude/Codex.

This maps each model's advertised menu into optionDescriptors (reasoningEffort), passes _meta.reasoningEffort through session/set_model on session start and each turn (including mid-thread effort-only changes), and wires the same selection into Grok text generation.

Why

Grok Build supports Low/Medium/High (and other per-model menus for custom models). Without reading _meta and applying effort on session/set_model, T3 always ran at the CLI default and users could not change it from the UI.

Related open work: #5160 takes a spawn-flag approach and blocks mid-thread changes. This PR is narrower: discovery + apply via the existing ACP session/set_model _meta path, which Grok applies in place without restarting the process.

UI Changes

Uses the existing Traits picker — no new UI components. Once Grok ACP discovery succeeds, models with reasoningEfforts show a Reasoning select; models with different menus keep their own options.

  • Before: Grok models have no Reasoning control in the composer traits menu.
  • After: Grok models that advertise effort menus show Reasoning, and the selected value is applied on the next send (same thread is fine for effort-only changes).

Live-verified against grok agent stdio and the T3 web UI over Tailscale.

Validation

  • vp test run src/provider/acp/GrokAcpSupport.test.ts src/provider/Layers/GrokProvider.test.ts — 17 passed
  • Live ACP probe: session/set_model with _meta.reasoningEffort applies the override
  • Manual web UI check: Reasoning control appears for discovered Grok models and updates per model

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (happy to add if needed — behavior uses the existing traits control)
  • A video is not applicable (no animation/timing change)

Made by Grok Build via the Grok Build harness while working on T3 Code.


Note

Medium Risk
Changes the Grok ACP session/set_model path on every session start and turn; behavior is additive (_meta extension) and covered by tests, but incorrect effort values could affect model behavior at runtime.

Overview
Grok ACP models can advertise per-model reasoning effort menus in availableModels[]._meta, but T3 previously published empty capabilities and never applied a user’s effort choice. This PR wires that through end-to-end.

Discovery: buildGrokCapabilitiesFromModelMeta maps reasoningEfforts / reasoningEffort into a Reasoning select (reasoningEffort) on each discovered model, so the existing composer traits picker can show it after ACP discovery.

Apply: applyGrokAcpModelSelection now reads trait selections and calls session/set_model with _meta.reasoningEffort when the model changes or when only effort changes mid-thread. AcpSessionRuntime.setSessionModel passes optional _meta through. Grok adapter (session start + turns), and Grok text generation pass modelSelection.options into that path.

Unit tests cover capability mapping, discovered models, and effort-only / combined model+effort set_model calls.

Reviewed by Cursor Bugbot for commit 9e2fb80. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Surface per-model reasoning effort selection in the Grok composer

  • Adds buildGrokCapabilitiesFromModelMeta in GrokProvider.ts to parse _meta.reasoningEfforts from model metadata into a select option descriptor, replacing the previous EMPTY_CAPABILITIES fallback.
  • Extends applyGrokAcpModelSelection in GrokAcpSupport.ts to accept selections and call setSessionModel when a reasoningEffort selection is present, even if the model ID is unchanged.
  • Updates AcpSessionRuntime.setSessionModel to accept and forward an optional options._meta payload so reasoning effort reaches the ACP set_model request.
  • Propagates modelSelection.options through GrokAdapter.ts and GrokTextGeneration.ts to ensure selections apply during both session setup and text generation.

Macroscope summarized 9e2fb80.

Grok models already advertise reasoning effort menus in ACP model
_meta, but T3 always published empty capabilities and never applied a
selected effort. Map each model's reasoningEfforts into option
descriptors, pass _meta.reasoningEffort through session/set_model on
start and send, and cover discovery/apply with focused tests.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ab9284f9-1df8-4f43-b96e-eed961cfc988

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 5, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new user-facing functionality (per-model reasoning effort selection in the composer), propagating new _meta configuration through multiple provider layers. New features that add user-facing behavior warrant human review.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant