feat(orchestrator): Surface Grok reasoning effort options - #5160
Conversation
Grok 4.5 supports low / medium / high reasoning effort (default high), but T3 Code always started the agent at the provider default with no control. Advertise a Reasoning select option from ACP model _meta (supportsReasoningEffort / reasoningEfforts), with a fallback menu for grok-4.5 when _meta carries no effort information (an explicit supportsReasoningEffort: false suppresses it), and apply the selected effort as 'grok agent --reasoning-effort <value> stdio' at spawn. Grok ACP has no session/set_config_option, so a new spawnOptionIds flavor hook excludes spawn-applied options from the generic ACP config-option path, and a changed spawn-bound value on an active session logs a warning instead of failing. A live probe (grok 0.2.117) confirmed a loaded session keeps its original effort even when the process is respawned with a different flag, so effort is session-bound: the web traits picker and the mobile options menu lock option changes on started threads for providers that require a new thread for model changes, and a locked web thread displays and dispatches its committed selection rather than draft or sticky values.
|
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 |
| if (input.lockedProvider === null) { | ||
| return false; | ||
| } | ||
| const provider = input.providers.find((snapshot) => snapshot.instanceId === input.instanceId); |
There was a problem hiding this comment.
🟡 Medium components/ChatView.logic.ts:457
isStartedThreadOptionChangeBlocked compares only provider.driver with lockedProvider, so when handoff is enabled and the user switches a started thread to a different instance of the same driver (e.g. two Grok accounts), it still returns true. This wrongly disables option changes for the newly selected instance, even though that instance will start its own provider process and should accept its own spawn-bound reasoning effort. The check needs to distinguish the running provider instance from another instance sharing the same driver — e.g. by comparing instanceId against the locked instance rather than just driver against lockedProvider.
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/web/src/components/ChatView.logic.ts around line 457:
`isStartedThreadOptionChangeBlocked` compares only `provider.driver` with `lockedProvider`, so when handoff is enabled and the user switches a started thread to a different instance of the same driver (e.g. two Grok accounts), it still returns `true`. This wrongly disables option changes for the newly selected instance, even though that instance will start its own provider process and should accept its own spawn-bound reasoning effort. The check needs to distinguish the running provider instance from another instance sharing the same driver — e.g. by comparing `instanceId` against the locked instance rather than just `driver` against `lockedProvider`.
What Changed
web and mobile.
narrow fallback for Grok 4.5 when that metadata is absent.
--reasoning-effortvalue and keepspawn-bound options out of the generic ACP config-option path.
preserve their original effort. Web explains blocked changes with the
existing new-chat toast, and mobile keeps the choices disabled.
Why
session/set_config_optioncannot apply it.grok agent --reasoning-effort <value> stdiowhen the provider process starts.UI Changes
their original value and direct attempted changes to a new chat.
Validation
vp checkpasses with no errors.vp run typecheckreaches all 15 packages. The changed server, web, andmobile packages pass; the CTM base retains one unrelated
HttpResponseCompression.tsBodyIniterror in an untouched file.missing-binary probe; the same probe fails on the clean base when the locally
installed Grok binary remains discoverable.
grok agent --reasoning-effort low stdio, Grok session metadata records Low,a started thread reports the provider lock, and a new thread can select High
successfully.
Checklist
Note
Surface Grok reasoning effort as a spawn-bound option in the orchestrator and UI
GROK_REASONING_EFFORT_OPTION_IDand supporting utilities in GrokAcpSupport.ts to resolve and pass--reasoning-effortas a CLI flag when spawning the Grok agent process.spawnOptionIdson flavors, excluding those options from ACP config validation andsetConfigOptioncalls, and logging a warning on mismatch._metaand advertise aReasoningselect capability on discovered Grok models, with a fallback for grok-4.5.📊 Macroscope summarized bbf8c77. 12 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.