Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Closedahmed-besic(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/5403/headopened View on GitHub

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 Touches Grok ACP model selection and session/set_model payloads, so a bad _meta or skip-on-steer bug could send the wrong effort or extra set_model calls. Scope is Grok-only and covered by unit/adapter tests.

Overview Grok models that advertise reasoningEfforts in ACP _meta now get a Reasoning select in the composer, and the chosen value is applied in-session instead of always using the CLI default.

Discovery maps each model's _meta.reasoningEfforts into optionDescriptors. applyGrokAcpModelSelection now sends _meta.reasoningEffort on session/set_model when effort is selected (including effort-only changes), and ACP setSessionModel forwards that _meta. Session start, turns, and text generation all pass modelSelection.options. Steering an in-flight prompt skips effort updates because Grok cannot apply them while a prompt is active.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 175418492115916141dccfdfdecc39278eacae40. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add per-model reasoning effort support to Grok adapter and ACP session model

  • Surfaces reasoningEffort as a per-model Reasoning select descriptor built from session model state _meta.reasoningEfforts, replacing the previous EMPTY_CAPABILITIES for discovered Grok models
  • Extends applyGrokAcpModelSelection and AcpSessionRuntime.setSessionModel to forward options with _meta.reasoningEffort in session/set_model requests, issuing the request even when only the effort changes (model id unchanged)
  • Skips re-applying option selections during steering turns (when steeringTurnId is set) to avoid redundant session/set_model calls while a prompt is active
  • Text generation flow now passes modelSelection.options through to applyGrokAcpModelSelection so reasoning effort is applied before prompting
  • Behavioral Change: session/set_model is now invoked when a reasoningEffort selection is present even if the model id is unchanged; existing callers without options are unaffected
Macroscope summarized 1754184.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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: bff6643f-00ef-4470-9f35-a1aefbdb071d

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Skipped

      Macroscope did not run approvability analysis for this PR. Macroscope could not determine whether this PR modifies its approvability configuration, so the PR was not approved automatically. A PR that may change the rules that govern approval is never approved automatically.

    4. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).

      Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7d734a98ddbd1cd6d277c965a090b7a784665511. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. Fixed the small steering issue and added a regression test. Typecheck and focused Grok tests are passing.

    6. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      Closing this PR after an automated pass over open pull requests. Duplicates trusted Grok reasoning controls in #6386.

Sign in to join this conversation.