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 1 commit 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: Needs human review This PR introduces new user-facing functionality (per-model reasoning effort selection in the composer), propagating new You can customize Macroscope's approvability policy. Learn more. |
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
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 request shaping, so incorrect
_metahandling could misconfigure runtime effort. Scope is limited to the Grok provider path and covered by unit tests.Overview
Grok models that advertise
reasoningEffortsin ACP_metanow expose a Reasoning select in the composer, and the chosen effort is applied on send.Discovery maps each model's
_meta.reasoningEffortsintooptionDescriptorsinstead of empty capabilities.applyGrokAcpModelSelectionnow accepts selections and callssession/set_modelwith_meta.reasoningEfforteven for effort-only changes (no model switch). The same selection is wired through session start, turns, and Grok text generation.Reviewed by Cursor Bugbot for commit c8d471b. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Surface per-model reasoning effort selection in the Grok composer
buildGrokCapabilitiesFromModelMetain GrokProvider.ts to parse_meta.reasoningEffortsfrom model metadata into a select option descriptor, replacing the previousEMPTY_CAPABILITIESfallback.applyGrokAcpModelSelectionin GrokAcpSupport.ts to acceptselectionsand callsetSessionModelwhen areasoningEffortselection is present, even if the model ID is unchanged.AcpSessionRuntime.setSessionModelto accept and forward an optionaloptions._metapayload so reasoning effort reaches the ACPset_modelrequest.modelSelection.optionsthrough GrokAdapter.ts and GrokTextGeneration.ts to ensure selections apply during both session setup and text generation.Macroscope summarized c8d471b.