fix(grok): surface per-model reasoning effort in the composer - #5403
fix(grok): surface per-model reasoning effort in the composer#5403ahmed-besic wants to merge 3 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: 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. |
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.
9e2fb80 to
c8d471b
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
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 for commit 7d734a9. Configure here.
|
Fixed the small steering issue and added a regression test. Typecheck and focused Grok tests are passing. |
|
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. |

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.reasoningEffortthroughsession/set_modelon 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
_metaand applying effort onsession/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_metapath, 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
reasoningEffortsshow a Reasoning select; models with different menus keep their own options.Live-verified against
grok agent stdioand the T3 web UI over Tailscale.Validation
vp test run src/provider/acp/GrokAcpSupport.test.ts src/provider/Layers/GrokProvider.test.ts— 17 passedsession/set_modelwith_meta.reasoningEffortapplies the overrideChecklist
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
_metaor 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
reasoningEffortsin ACP_metanow 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.reasoningEffortsintooptionDescriptors.applyGrokAcpModelSelectionnow sends_meta.reasoningEffortonsession/set_modelwhen effort is selected (including effort-only changes), and ACPsetSessionModelforwards that_meta. Session start, turns, and text generation all passmodelSelection.options. Steering an in-flight prompt skips effort updates because Grok cannot apply them while a prompt is active.Reviewed by Cursor Bugbot for commit 1754184. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add per-model reasoning effort support to Grok adapter and ACP session model
reasoningEffortas a per-model Reasoning select descriptor built from session model state_meta.reasoningEfforts, replacing the previousEMPTY_CAPABILITIESfor discovered Grok modelsapplyGrokAcpModelSelectionandAcpSessionRuntime.setSessionModelto forwardoptionswith_meta.reasoningEffortinsession/set_modelrequests, issuing the request even when only the effort changes (model id unchanged)steeringTurnIdis set) to avoid redundantsession/set_modelcalls while a prompt is activemodelSelection.optionsthrough toapplyGrokAcpModelSelectionso reasoning effort is applied before promptingsession/set_modelis now invoked when areasoningEffortselection is present even if the model id is unchanged; existing callers withoutoptionsare unaffectedMacroscope summarized 1754184.