fix(grok): expose advertised reasoning levels - #6386

Closed
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels
Closed

fix(grok): expose advertised reasoning levels#6386
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels

Conversation

@SunkenInTime

@SunkenInTimeSunkenInTime commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • map each Grok model's advertised ACP reasoning menu into the existing model-option contract
  • preserve ACP descriptions, reject malformed effort tokens, and keep current selection separate from the advertised default badge
  • show those choices in the shared composer on web, desktop, and mobile surfaces
  • send the selected effort in session/set_model metadata, including same-model changes and explicit clearing back to the model default
  • honor the same selection in Grok-backed title, commit, PR, and branch-name generation
  • cover the metadata mapping and dispatch path with focused tests and an opt-in real-CLI probe

Why

Grok 4.6 advertises Extra High, High, Medium, and Low reasoning levels through its ACP model metadata, but T3 discarded Grok model capabilities and only sent model IDs. That left the composer without a reasoning control and made same-model effort changes impossible.

This is a focused reasoning-only fix. It overlaps the reasoning portion of #6383, which appeared after this work started and also bundles Grok auth, rewind, and token-usage changes.

I also compared this implementation with the orchestrator-v2 work in #5160. This PR reuses the portable safeguards from that work: safe ACP token parsing, preserved descriptions, current-vs-default separation, one default badge, and symmetric effort clearing. It intentionally leaves out v2-only lifecycle scaffolding, spawn-bound locks, and fallback catalogs.

UI Changes

Before

Grok 4.6 had no reasoning control.

Grok 4.6 before, without reasoning levels

After

The composer reads Grok 4.6's live effort menu, and changing the selection updates the visible value.

The Effort suffix in this screenshot comes from Grok 4.6's ACP-provided labels. T3 displays only ACP-advertised options, preserving their labels verbatim without synthesizing a fallback menu.

Grok 4.6 after, with Medium selected from the reasoning menu

Verification

  • vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts apps/server/src/provider/Layers/GrokProvider.test.ts apps/server/src/provider/Layers/GrokAdapter.test.ts apps/server/src/textGeneration/GrokTextGeneration.test.ts (51 tests passed)
  • T3_GROK_ACP_PROBE=1 vp test run apps/server/src/provider/acp/GrokAcpCliProbe.test.ts --reporter=verbose (4 tests passed against Grok CLI 1.0.3)
  • vp run --filter=t3 typecheck
  • targeted vp fmt --check and vp lint for all changed files
  • full Computer Use verification in Safari against the local T3 app: Grok 4.6 exposed all four advertised levels, accepted a change from Extra High to Medium, and kept the ACP default badge on Extra High

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI change
  • No animation or timing behavior changed, so a video is not applicable

Implemented with gpt-5.6-sol through the Codex harness in T3 Code.


Note

Medium Risk
Changes Grok session model binding and session/set_model behavior (including same-model effort and clearing), which affects live turns and auxiliary Grok prompts; risk is mitigated by validation, deferred set_model until after turn validation, and broad tests.

Overview
Grok reasoning effort is now wired end-to-end from ACP model metadata into the composer and runtime.

Discovery and UI contract:buildGrokModelCapabilities turns each model’s _meta.reasoningEffort / reasoningEfforts into a reasoningEffort select (labels, descriptions, default badge, token validation). Discovered Grok models use these capabilities instead of empty option lists.

ACP dispatch:setSessionModel accepts optional _meta; applyGrokAcpModelSelection compares current vs requested effort and calls session/set_model with { reasoningEffort } when the model or effort changes, or omits _meta to clear effort on the same model. GrokAdapter tracks currentReasoningEffort, applies selection after turn validation (so failed prep/validation does not call set_model), and avoids leaking prior-session effort on start when switching models. Grok text generation applies the same selection path.

Tests and the mock ACP agent cover effort metadata; install docs mention the Reasoning control for supported Grok models.

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

Note

Expose Grok reasoning effort levels from ACP model metadata in model capabilities

  • buildGrokModelCapabilities in GrokProvider.ts parses _meta.reasoningEffort and _meta.reasoningEfforts from ACP model metadata and returns a reasoningEffort select option when present; discovered models now use this instead of empty capabilities.
  • applyGrokAcpModelSelection in GrokAcpSupport.ts now tracks current and requested reasoning effort, triggering session/set_model with _meta.reasoningEffort when effort changes on the same model, and clearing it when omitted.
  • AcpSessionRuntime.setSessionModel in AcpSessionRuntime.ts accepts an optional _meta payload so reasoning effort can be forwarded in set-model requests.
  • The GrokAdapter tracks currentReasoningEffort in session context and applies it alongside model selection on sendTurn; session/set_model is no longer issued when sendTurn validation fails.
  • A Reasoning control is documented in install.md for Grok models that advertise adjustable reasoning levels.

Macroscope summarized e0fc12b.

@coderabbitai

coderabbitaiBot commented Aug 12, 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: 99c9db43-bb0d-4dc1-bd65-013bbda6379a

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-actionsgithub-actionsBot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 12, 2026
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@SunkenInTime
SunkenInTime marked this pull request as ready for review August 12, 2026 22:30
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@macroscopeapp

macroscopeappBot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new user-facing functionality - reasoning level selection for Grok models. The changes expose previously hidden metadata as UI controls and propagate new configuration through the ACP session. While thoroughly tested, this is a new capability from a new contributor to this area of the codebase.

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

@SunkenInTime
SunkenInTimeforce-pushed the t3code/add-grok-reasoning-levels branch from 534f90f to e0fc12bCompareAugust 13, 2026 00:23
@SunkenInTime

Copy link
Copy Markdown
ContributorAuthor

cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e0fc12b. Configure here.

netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 24, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 25, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 26, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 27, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
@t3dotgg

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

Grok reasoning levels already landed in #8358. This older branch no longer has a separate change to review.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotggt3dotgg closed this Aug 28, 2026
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L100-499 changed lines (additions + deletions).vouch:trustedPR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@SunkenInTime@t3dotgg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

fix(grok): expose advertised reasoning levels - #6386

Closed
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels
Closed

fix(grok): expose advertised reasoning levels#6386
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels

Conversation

@SunkenInTime

@SunkenInTimeSunkenInTime commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • map each Grok model's advertised ACP reasoning menu into the existing model-option contract
  • preserve ACP descriptions, reject malformed effort tokens, and keep current selection separate from the advertised default badge
  • show those choices in the shared composer on web, desktop, and mobile surfaces
  • send the selected effort in session/set_model metadata, including same-model changes and explicit clearing back to the model default
  • honor the same selection in Grok-backed title, commit, PR, and branch-name generation
  • cover the metadata mapping and dispatch path with focused tests and an opt-in real-CLI probe

Why

Grok 4.6 advertises Extra High, High, Medium, and Low reasoning levels through its ACP model metadata, but T3 discarded Grok model capabilities and only sent model IDs. That left the composer without a reasoning control and made same-model effort changes impossible.

This is a focused reasoning-only fix. It overlaps the reasoning portion of #6383, which appeared after this work started and also bundles Grok auth, rewind, and token-usage changes.

I also compared this implementation with the orchestrator-v2 work in #5160. This PR reuses the portable safeguards from that work: safe ACP token parsing, preserved descriptions, current-vs-default separation, one default badge, and symmetric effort clearing. It intentionally leaves out v2-only lifecycle scaffolding, spawn-bound locks, and fallback catalogs.

UI Changes

Before

Grok 4.6 had no reasoning control.

Grok 4.6 before, without reasoning levels

After

The composer reads Grok 4.6's live effort menu, and changing the selection updates the visible value.

The Effort suffix in this screenshot comes from Grok 4.6's ACP-provided labels. T3 displays only ACP-advertised options, preserving their labels verbatim without synthesizing a fallback menu.

Grok 4.6 after, with Medium selected from the reasoning menu

Verification

  • vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts apps/server/src/provider/Layers/GrokProvider.test.ts apps/server/src/provider/Layers/GrokAdapter.test.ts apps/server/src/textGeneration/GrokTextGeneration.test.ts (51 tests passed)
  • T3_GROK_ACP_PROBE=1 vp test run apps/server/src/provider/acp/GrokAcpCliProbe.test.ts --reporter=verbose (4 tests passed against Grok CLI 1.0.3)
  • vp run --filter=t3 typecheck
  • targeted vp fmt --check and vp lint for all changed files
  • full Computer Use verification in Safari against the local T3 app: Grok 4.6 exposed all four advertised levels, accepted a change from Extra High to Medium, and kept the ACP default badge on Extra High

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI change
  • No animation or timing behavior changed, so a video is not applicable

Implemented with gpt-5.6-sol through the Codex harness in T3 Code.


Note

Medium Risk
Changes Grok session model binding and session/set_model behavior (including same-model effort and clearing), which affects live turns and auxiliary Grok prompts; risk is mitigated by validation, deferred set_model until after turn validation, and broad tests.

Overview
Grok reasoning effort is now wired end-to-end from ACP model metadata into the composer and runtime.

Discovery and UI contract:buildGrokModelCapabilities turns each model’s _meta.reasoningEffort / reasoningEfforts into a reasoningEffort select (labels, descriptions, default badge, token validation). Discovered Grok models use these capabilities instead of empty option lists.

ACP dispatch:setSessionModel accepts optional _meta; applyGrokAcpModelSelection compares current vs requested effort and calls session/set_model with { reasoningEffort } when the model or effort changes, or omits _meta to clear effort on the same model. GrokAdapter tracks currentReasoningEffort, applies selection after turn validation (so failed prep/validation does not call set_model), and avoids leaking prior-session effort on start when switching models. Grok text generation applies the same selection path.

Tests and the mock ACP agent cover effort metadata; install docs mention the Reasoning control for supported Grok models.

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

Note

Expose Grok reasoning effort levels from ACP model metadata in model capabilities

  • buildGrokModelCapabilities in GrokProvider.ts parses _meta.reasoningEffort and _meta.reasoningEfforts from ACP model metadata and returns a reasoningEffort select option when present; discovered models now use this instead of empty capabilities.
  • applyGrokAcpModelSelection in GrokAcpSupport.ts now tracks current and requested reasoning effort, triggering session/set_model with _meta.reasoningEffort when effort changes on the same model, and clearing it when omitted.
  • AcpSessionRuntime.setSessionModel in AcpSessionRuntime.ts accepts an optional _meta payload so reasoning effort can be forwarded in set-model requests.
  • The GrokAdapter tracks currentReasoningEffort in session context and applies it alongside model selection on sendTurn; session/set_model is no longer issued when sendTurn validation fails.
  • A Reasoning control is documented in install.md for Grok models that advertise adjustable reasoning levels.

Macroscope summarized e0fc12b.

@coderabbitai

coderabbitaiBot commented Aug 12, 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: 99c9db43-bb0d-4dc1-bd65-013bbda6379a

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-actionsgithub-actionsBot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 12, 2026
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@SunkenInTime
SunkenInTime marked this pull request as ready for review August 12, 2026 22:30
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@macroscopeapp

macroscopeappBot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new user-facing functionality - reasoning level selection for Grok models. The changes expose previously hidden metadata as UI controls and propagate new configuration through the ACP session. While thoroughly tested, this is a new capability from a new contributor to this area of the codebase.

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

@SunkenInTime
SunkenInTimeforce-pushed the t3code/add-grok-reasoning-levels branch from 534f90f to e0fc12bCompareAugust 13, 2026 00:23
@SunkenInTime

Copy link
Copy Markdown
ContributorAuthor

cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e0fc12b. Configure here.

netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 24, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 25, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 26, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 27, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
@t3dotgg

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

Grok reasoning levels already landed in #8358. This older branch no longer has a separate change to review.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotggt3dotgg closed this Aug 28, 2026
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L100-499 changed lines (additions + deletions).vouch:trustedPR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@SunkenInTime@t3dotgg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(grok): expose advertised reasoning levels - #6386

Closed
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels
Closed

fix(grok): expose advertised reasoning levels#6386
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels

Conversation

@SunkenInTime

@SunkenInTimeSunkenInTime commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • map each Grok model's advertised ACP reasoning menu into the existing model-option contract
  • preserve ACP descriptions, reject malformed effort tokens, and keep current selection separate from the advertised default badge
  • show those choices in the shared composer on web, desktop, and mobile surfaces
  • send the selected effort in session/set_model metadata, including same-model changes and explicit clearing back to the model default
  • honor the same selection in Grok-backed title, commit, PR, and branch-name generation
  • cover the metadata mapping and dispatch path with focused tests and an opt-in real-CLI probe

Why

Grok 4.6 advertises Extra High, High, Medium, and Low reasoning levels through its ACP model metadata, but T3 discarded Grok model capabilities and only sent model IDs. That left the composer without a reasoning control and made same-model effort changes impossible.

This is a focused reasoning-only fix. It overlaps the reasoning portion of #6383, which appeared after this work started and also bundles Grok auth, rewind, and token-usage changes.

I also compared this implementation with the orchestrator-v2 work in #5160. This PR reuses the portable safeguards from that work: safe ACP token parsing, preserved descriptions, current-vs-default separation, one default badge, and symmetric effort clearing. It intentionally leaves out v2-only lifecycle scaffolding, spawn-bound locks, and fallback catalogs.

UI Changes

Before

Grok 4.6 had no reasoning control.

Grok 4.6 before, without reasoning levels

After

The composer reads Grok 4.6's live effort menu, and changing the selection updates the visible value.

The Effort suffix in this screenshot comes from Grok 4.6's ACP-provided labels. T3 displays only ACP-advertised options, preserving their labels verbatim without synthesizing a fallback menu.

Grok 4.6 after, with Medium selected from the reasoning menu

Verification

  • vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts apps/server/src/provider/Layers/GrokProvider.test.ts apps/server/src/provider/Layers/GrokAdapter.test.ts apps/server/src/textGeneration/GrokTextGeneration.test.ts (51 tests passed)
  • T3_GROK_ACP_PROBE=1 vp test run apps/server/src/provider/acp/GrokAcpCliProbe.test.ts --reporter=verbose (4 tests passed against Grok CLI 1.0.3)
  • vp run --filter=t3 typecheck
  • targeted vp fmt --check and vp lint for all changed files
  • full Computer Use verification in Safari against the local T3 app: Grok 4.6 exposed all four advertised levels, accepted a change from Extra High to Medium, and kept the ACP default badge on Extra High

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI change
  • No animation or timing behavior changed, so a video is not applicable

Implemented with gpt-5.6-sol through the Codex harness in T3 Code.


Note

Medium Risk
Changes Grok session model binding and session/set_model behavior (including same-model effort and clearing), which affects live turns and auxiliary Grok prompts; risk is mitigated by validation, deferred set_model until after turn validation, and broad tests.

Overview
Grok reasoning effort is now wired end-to-end from ACP model metadata into the composer and runtime.

Discovery and UI contract:buildGrokModelCapabilities turns each model’s _meta.reasoningEffort / reasoningEfforts into a reasoningEffort select (labels, descriptions, default badge, token validation). Discovered Grok models use these capabilities instead of empty option lists.

ACP dispatch:setSessionModel accepts optional _meta; applyGrokAcpModelSelection compares current vs requested effort and calls session/set_model with { reasoningEffort } when the model or effort changes, or omits _meta to clear effort on the same model. GrokAdapter tracks currentReasoningEffort, applies selection after turn validation (so failed prep/validation does not call set_model), and avoids leaking prior-session effort on start when switching models. Grok text generation applies the same selection path.

Tests and the mock ACP agent cover effort metadata; install docs mention the Reasoning control for supported Grok models.

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

Note

Expose Grok reasoning effort levels from ACP model metadata in model capabilities

  • buildGrokModelCapabilities in GrokProvider.ts parses _meta.reasoningEffort and _meta.reasoningEfforts from ACP model metadata and returns a reasoningEffort select option when present; discovered models now use this instead of empty capabilities.
  • applyGrokAcpModelSelection in GrokAcpSupport.ts now tracks current and requested reasoning effort, triggering session/set_model with _meta.reasoningEffort when effort changes on the same model, and clearing it when omitted.
  • AcpSessionRuntime.setSessionModel in AcpSessionRuntime.ts accepts an optional _meta payload so reasoning effort can be forwarded in set-model requests.
  • The GrokAdapter tracks currentReasoningEffort in session context and applies it alongside model selection on sendTurn; session/set_model is no longer issued when sendTurn validation fails.
  • A Reasoning control is documented in install.md for Grok models that advertise adjustable reasoning levels.

Macroscope summarized e0fc12b.

@coderabbitai

coderabbitaiBot commented Aug 12, 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: 99c9db43-bb0d-4dc1-bd65-013bbda6379a

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-actionsgithub-actionsBot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 12, 2026
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@SunkenInTime
SunkenInTime marked this pull request as ready for review August 12, 2026 22:30
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@macroscopeapp

macroscopeappBot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new user-facing functionality - reasoning level selection for Grok models. The changes expose previously hidden metadata as UI controls and propagate new configuration through the ACP session. While thoroughly tested, this is a new capability from a new contributor to this area of the codebase.

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

@SunkenInTime
SunkenInTimeforce-pushed the t3code/add-grok-reasoning-levels branch from 534f90f to e0fc12bCompareAugust 13, 2026 00:23
@SunkenInTime

Copy link
Copy Markdown
ContributorAuthor

cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e0fc12b. Configure here.

netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 24, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 25, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 26, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 27, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
@t3dotgg

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

Grok reasoning levels already landed in #8358. This older branch no longer has a separate change to review.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotggt3dotgg closed this Aug 28, 2026
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L100-499 changed lines (additions + deletions).vouch:trustedPR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@SunkenInTime@t3dotgg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(grok): expose advertised reasoning levels - #6386

Closed
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels
Closed

fix(grok): expose advertised reasoning levels#6386
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels

Conversation

@SunkenInTime

@SunkenInTimeSunkenInTime commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • map each Grok model's advertised ACP reasoning menu into the existing model-option contract
  • preserve ACP descriptions, reject malformed effort tokens, and keep current selection separate from the advertised default badge
  • show those choices in the shared composer on web, desktop, and mobile surfaces
  • send the selected effort in session/set_model metadata, including same-model changes and explicit clearing back to the model default
  • honor the same selection in Grok-backed title, commit, PR, and branch-name generation
  • cover the metadata mapping and dispatch path with focused tests and an opt-in real-CLI probe

Why

Grok 4.6 advertises Extra High, High, Medium, and Low reasoning levels through its ACP model metadata, but T3 discarded Grok model capabilities and only sent model IDs. That left the composer without a reasoning control and made same-model effort changes impossible.

This is a focused reasoning-only fix. It overlaps the reasoning portion of #6383, which appeared after this work started and also bundles Grok auth, rewind, and token-usage changes.

I also compared this implementation with the orchestrator-v2 work in #5160. This PR reuses the portable safeguards from that work: safe ACP token parsing, preserved descriptions, current-vs-default separation, one default badge, and symmetric effort clearing. It intentionally leaves out v2-only lifecycle scaffolding, spawn-bound locks, and fallback catalogs.

UI Changes

Before

Grok 4.6 had no reasoning control.

Grok 4.6 before, without reasoning levels

After

The composer reads Grok 4.6's live effort menu, and changing the selection updates the visible value.

The Effort suffix in this screenshot comes from Grok 4.6's ACP-provided labels. T3 displays only ACP-advertised options, preserving their labels verbatim without synthesizing a fallback menu.

Grok 4.6 after, with Medium selected from the reasoning menu

Verification

  • vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts apps/server/src/provider/Layers/GrokProvider.test.ts apps/server/src/provider/Layers/GrokAdapter.test.ts apps/server/src/textGeneration/GrokTextGeneration.test.ts (51 tests passed)
  • T3_GROK_ACP_PROBE=1 vp test run apps/server/src/provider/acp/GrokAcpCliProbe.test.ts --reporter=verbose (4 tests passed against Grok CLI 1.0.3)
  • vp run --filter=t3 typecheck
  • targeted vp fmt --check and vp lint for all changed files
  • full Computer Use verification in Safari against the local T3 app: Grok 4.6 exposed all four advertised levels, accepted a change from Extra High to Medium, and kept the ACP default badge on Extra High

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI change
  • No animation or timing behavior changed, so a video is not applicable

Implemented with gpt-5.6-sol through the Codex harness in T3 Code.


Note

Medium Risk
Changes Grok session model binding and session/set_model behavior (including same-model effort and clearing), which affects live turns and auxiliary Grok prompts; risk is mitigated by validation, deferred set_model until after turn validation, and broad tests.

Overview
Grok reasoning effort is now wired end-to-end from ACP model metadata into the composer and runtime.

Discovery and UI contract:buildGrokModelCapabilities turns each model’s _meta.reasoningEffort / reasoningEfforts into a reasoningEffort select (labels, descriptions, default badge, token validation). Discovered Grok models use these capabilities instead of empty option lists.

ACP dispatch:setSessionModel accepts optional _meta; applyGrokAcpModelSelection compares current vs requested effort and calls session/set_model with { reasoningEffort } when the model or effort changes, or omits _meta to clear effort on the same model. GrokAdapter tracks currentReasoningEffort, applies selection after turn validation (so failed prep/validation does not call set_model), and avoids leaking prior-session effort on start when switching models. Grok text generation applies the same selection path.

Tests and the mock ACP agent cover effort metadata; install docs mention the Reasoning control for supported Grok models.

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

Note

Expose Grok reasoning effort levels from ACP model metadata in model capabilities

  • buildGrokModelCapabilities in GrokProvider.ts parses _meta.reasoningEffort and _meta.reasoningEfforts from ACP model metadata and returns a reasoningEffort select option when present; discovered models now use this instead of empty capabilities.
  • applyGrokAcpModelSelection in GrokAcpSupport.ts now tracks current and requested reasoning effort, triggering session/set_model with _meta.reasoningEffort when effort changes on the same model, and clearing it when omitted.
  • AcpSessionRuntime.setSessionModel in AcpSessionRuntime.ts accepts an optional _meta payload so reasoning effort can be forwarded in set-model requests.
  • The GrokAdapter tracks currentReasoningEffort in session context and applies it alongside model selection on sendTurn; session/set_model is no longer issued when sendTurn validation fails.
  • A Reasoning control is documented in install.md for Grok models that advertise adjustable reasoning levels.

Macroscope summarized e0fc12b.

@coderabbitai

coderabbitaiBot commented Aug 12, 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: 99c9db43-bb0d-4dc1-bd65-013bbda6379a

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-actionsgithub-actionsBot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 12, 2026
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@SunkenInTime
SunkenInTime marked this pull request as ready for review August 12, 2026 22:30
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@macroscopeapp

macroscopeappBot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new user-facing functionality - reasoning level selection for Grok models. The changes expose previously hidden metadata as UI controls and propagate new configuration through the ACP session. While thoroughly tested, this is a new capability from a new contributor to this area of the codebase.

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

@SunkenInTime
SunkenInTimeforce-pushed the t3code/add-grok-reasoning-levels branch from 534f90f to e0fc12bCompareAugust 13, 2026 00:23
@SunkenInTime

Copy link
Copy Markdown
ContributorAuthor

cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e0fc12b. Configure here.

netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 24, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 25, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 26, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 27, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
@t3dotgg

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

Grok reasoning levels already landed in #8358. This older branch no longer has a separate change to review.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotggt3dotgg closed this Aug 28, 2026
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L100-499 changed lines (additions + deletions).vouch:trustedPR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@SunkenInTime@t3dotgg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

fix(grok): expose advertised reasoning levels - #6386

Closed
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels
Closed

fix(grok): expose advertised reasoning levels#6386
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels

Conversation

@SunkenInTime

@SunkenInTimeSunkenInTime commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • map each Grok model's advertised ACP reasoning menu into the existing model-option contract
  • preserve ACP descriptions, reject malformed effort tokens, and keep current selection separate from the advertised default badge
  • show those choices in the shared composer on web, desktop, and mobile surfaces
  • send the selected effort in session/set_model metadata, including same-model changes and explicit clearing back to the model default
  • honor the same selection in Grok-backed title, commit, PR, and branch-name generation
  • cover the metadata mapping and dispatch path with focused tests and an opt-in real-CLI probe

Why

Grok 4.6 advertises Extra High, High, Medium, and Low reasoning levels through its ACP model metadata, but T3 discarded Grok model capabilities and only sent model IDs. That left the composer without a reasoning control and made same-model effort changes impossible.

This is a focused reasoning-only fix. It overlaps the reasoning portion of #6383, which appeared after this work started and also bundles Grok auth, rewind, and token-usage changes.

I also compared this implementation with the orchestrator-v2 work in #5160. This PR reuses the portable safeguards from that work: safe ACP token parsing, preserved descriptions, current-vs-default separation, one default badge, and symmetric effort clearing. It intentionally leaves out v2-only lifecycle scaffolding, spawn-bound locks, and fallback catalogs.

UI Changes

Before

Grok 4.6 had no reasoning control.

Grok 4.6 before, without reasoning levels

After

The composer reads Grok 4.6's live effort menu, and changing the selection updates the visible value.

The Effort suffix in this screenshot comes from Grok 4.6's ACP-provided labels. T3 displays only ACP-advertised options, preserving their labels verbatim without synthesizing a fallback menu.

Grok 4.6 after, with Medium selected from the reasoning menu

Verification

  • vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts apps/server/src/provider/Layers/GrokProvider.test.ts apps/server/src/provider/Layers/GrokAdapter.test.ts apps/server/src/textGeneration/GrokTextGeneration.test.ts (51 tests passed)
  • T3_GROK_ACP_PROBE=1 vp test run apps/server/src/provider/acp/GrokAcpCliProbe.test.ts --reporter=verbose (4 tests passed against Grok CLI 1.0.3)
  • vp run --filter=t3 typecheck
  • targeted vp fmt --check and vp lint for all changed files
  • full Computer Use verification in Safari against the local T3 app: Grok 4.6 exposed all four advertised levels, accepted a change from Extra High to Medium, and kept the ACP default badge on Extra High

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI change
  • No animation or timing behavior changed, so a video is not applicable

Implemented with gpt-5.6-sol through the Codex harness in T3 Code.


Note

Medium Risk
Changes Grok session model binding and session/set_model behavior (including same-model effort and clearing), which affects live turns and auxiliary Grok prompts; risk is mitigated by validation, deferred set_model until after turn validation, and broad tests.

Overview
Grok reasoning effort is now wired end-to-end from ACP model metadata into the composer and runtime.

Discovery and UI contract:buildGrokModelCapabilities turns each model’s _meta.reasoningEffort / reasoningEfforts into a reasoningEffort select (labels, descriptions, default badge, token validation). Discovered Grok models use these capabilities instead of empty option lists.

ACP dispatch:setSessionModel accepts optional _meta; applyGrokAcpModelSelection compares current vs requested effort and calls session/set_model with { reasoningEffort } when the model or effort changes, or omits _meta to clear effort on the same model. GrokAdapter tracks currentReasoningEffort, applies selection after turn validation (so failed prep/validation does not call set_model), and avoids leaking prior-session effort on start when switching models. Grok text generation applies the same selection path.

Tests and the mock ACP agent cover effort metadata; install docs mention the Reasoning control for supported Grok models.

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

Note

Expose Grok reasoning effort levels from ACP model metadata in model capabilities

  • buildGrokModelCapabilities in GrokProvider.ts parses _meta.reasoningEffort and _meta.reasoningEfforts from ACP model metadata and returns a reasoningEffort select option when present; discovered models now use this instead of empty capabilities.
  • applyGrokAcpModelSelection in GrokAcpSupport.ts now tracks current and requested reasoning effort, triggering session/set_model with _meta.reasoningEffort when effort changes on the same model, and clearing it when omitted.
  • AcpSessionRuntime.setSessionModel in AcpSessionRuntime.ts accepts an optional _meta payload so reasoning effort can be forwarded in set-model requests.
  • The GrokAdapter tracks currentReasoningEffort in session context and applies it alongside model selection on sendTurn; session/set_model is no longer issued when sendTurn validation fails.
  • A Reasoning control is documented in install.md for Grok models that advertise adjustable reasoning levels.

Macroscope summarized e0fc12b.

@coderabbitai

coderabbitaiBot commented Aug 12, 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: 99c9db43-bb0d-4dc1-bd65-013bbda6379a

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-actionsgithub-actionsBot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 12, 2026
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@SunkenInTime
SunkenInTime marked this pull request as ready for review August 12, 2026 22:30
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@macroscopeapp

macroscopeappBot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new user-facing functionality - reasoning level selection for Grok models. The changes expose previously hidden metadata as UI controls and propagate new configuration through the ACP session. While thoroughly tested, this is a new capability from a new contributor to this area of the codebase.

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

@SunkenInTime
SunkenInTimeforce-pushed the t3code/add-grok-reasoning-levels branch from 534f90f to e0fc12bCompareAugust 13, 2026 00:23
@SunkenInTime

Copy link
Copy Markdown
ContributorAuthor

cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e0fc12b. Configure here.

netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 24, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 25, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 26, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 27, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
@t3dotgg

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

Grok reasoning levels already landed in #8358. This older branch no longer has a separate change to review.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotggt3dotgg closed this Aug 28, 2026
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L100-499 changed lines (additions + deletions).vouch:trustedPR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@SunkenInTime@t3dotgg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(grok): expose advertised reasoning levels - #6386

Closed
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels
Closed

fix(grok): expose advertised reasoning levels#6386
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels

Conversation

@SunkenInTime

@SunkenInTimeSunkenInTime commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • map each Grok model's advertised ACP reasoning menu into the existing model-option contract
  • preserve ACP descriptions, reject malformed effort tokens, and keep current selection separate from the advertised default badge
  • show those choices in the shared composer on web, desktop, and mobile surfaces
  • send the selected effort in session/set_model metadata, including same-model changes and explicit clearing back to the model default
  • honor the same selection in Grok-backed title, commit, PR, and branch-name generation
  • cover the metadata mapping and dispatch path with focused tests and an opt-in real-CLI probe

Why

Grok 4.6 advertises Extra High, High, Medium, and Low reasoning levels through its ACP model metadata, but T3 discarded Grok model capabilities and only sent model IDs. That left the composer without a reasoning control and made same-model effort changes impossible.

This is a focused reasoning-only fix. It overlaps the reasoning portion of #6383, which appeared after this work started and also bundles Grok auth, rewind, and token-usage changes.

I also compared this implementation with the orchestrator-v2 work in #5160. This PR reuses the portable safeguards from that work: safe ACP token parsing, preserved descriptions, current-vs-default separation, one default badge, and symmetric effort clearing. It intentionally leaves out v2-only lifecycle scaffolding, spawn-bound locks, and fallback catalogs.

UI Changes

Before

Grok 4.6 had no reasoning control.

Grok 4.6 before, without reasoning levels

After

The composer reads Grok 4.6's live effort menu, and changing the selection updates the visible value.

The Effort suffix in this screenshot comes from Grok 4.6's ACP-provided labels. T3 displays only ACP-advertised options, preserving their labels verbatim without synthesizing a fallback menu.

Grok 4.6 after, with Medium selected from the reasoning menu

Verification

  • vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts apps/server/src/provider/Layers/GrokProvider.test.ts apps/server/src/provider/Layers/GrokAdapter.test.ts apps/server/src/textGeneration/GrokTextGeneration.test.ts (51 tests passed)
  • T3_GROK_ACP_PROBE=1 vp test run apps/server/src/provider/acp/GrokAcpCliProbe.test.ts --reporter=verbose (4 tests passed against Grok CLI 1.0.3)
  • vp run --filter=t3 typecheck
  • targeted vp fmt --check and vp lint for all changed files
  • full Computer Use verification in Safari against the local T3 app: Grok 4.6 exposed all four advertised levels, accepted a change from Extra High to Medium, and kept the ACP default badge on Extra High

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI change
  • No animation or timing behavior changed, so a video is not applicable

Implemented with gpt-5.6-sol through the Codex harness in T3 Code.


Note

Medium Risk
Changes Grok session model binding and session/set_model behavior (including same-model effort and clearing), which affects live turns and auxiliary Grok prompts; risk is mitigated by validation, deferred set_model until after turn validation, and broad tests.

Overview
Grok reasoning effort is now wired end-to-end from ACP model metadata into the composer and runtime.

Discovery and UI contract:buildGrokModelCapabilities turns each model’s _meta.reasoningEffort / reasoningEfforts into a reasoningEffort select (labels, descriptions, default badge, token validation). Discovered Grok models use these capabilities instead of empty option lists.

ACP dispatch:setSessionModel accepts optional _meta; applyGrokAcpModelSelection compares current vs requested effort and calls session/set_model with { reasoningEffort } when the model or effort changes, or omits _meta to clear effort on the same model. GrokAdapter tracks currentReasoningEffort, applies selection after turn validation (so failed prep/validation does not call set_model), and avoids leaking prior-session effort on start when switching models. Grok text generation applies the same selection path.

Tests and the mock ACP agent cover effort metadata; install docs mention the Reasoning control for supported Grok models.

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

Note

Expose Grok reasoning effort levels from ACP model metadata in model capabilities

  • buildGrokModelCapabilities in GrokProvider.ts parses _meta.reasoningEffort and _meta.reasoningEfforts from ACP model metadata and returns a reasoningEffort select option when present; discovered models now use this instead of empty capabilities.
  • applyGrokAcpModelSelection in GrokAcpSupport.ts now tracks current and requested reasoning effort, triggering session/set_model with _meta.reasoningEffort when effort changes on the same model, and clearing it when omitted.
  • AcpSessionRuntime.setSessionModel in AcpSessionRuntime.ts accepts an optional _meta payload so reasoning effort can be forwarded in set-model requests.
  • The GrokAdapter tracks currentReasoningEffort in session context and applies it alongside model selection on sendTurn; session/set_model is no longer issued when sendTurn validation fails.
  • A Reasoning control is documented in install.md for Grok models that advertise adjustable reasoning levels.

Macroscope summarized e0fc12b.

@coderabbitai

coderabbitaiBot commented Aug 12, 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: 99c9db43-bb0d-4dc1-bd65-013bbda6379a

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-actionsgithub-actionsBot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 12, 2026
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@SunkenInTime
SunkenInTime marked this pull request as ready for review August 12, 2026 22:30
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@macroscopeapp

macroscopeappBot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new user-facing functionality - reasoning level selection for Grok models. The changes expose previously hidden metadata as UI controls and propagate new configuration through the ACP session. While thoroughly tested, this is a new capability from a new contributor to this area of the codebase.

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

@SunkenInTime
SunkenInTimeforce-pushed the t3code/add-grok-reasoning-levels branch from 534f90f to e0fc12bCompareAugust 13, 2026 00:23
@SunkenInTime

Copy link
Copy Markdown
ContributorAuthor

cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e0fc12b. Configure here.

netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 24, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 25, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 26, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 27, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
@t3dotgg

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

Grok reasoning levels already landed in #8358. This older branch no longer has a separate change to review.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotggt3dotgg closed this Aug 28, 2026
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L100-499 changed lines (additions + deletions).vouch:trustedPR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@SunkenInTime@t3dotgg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(grok): expose advertised reasoning levels - #6386

Closed
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels
Closed

fix(grok): expose advertised reasoning levels#6386
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels

Conversation

@SunkenInTime

@SunkenInTimeSunkenInTime commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • map each Grok model's advertised ACP reasoning menu into the existing model-option contract
  • preserve ACP descriptions, reject malformed effort tokens, and keep current selection separate from the advertised default badge
  • show those choices in the shared composer on web, desktop, and mobile surfaces
  • send the selected effort in session/set_model metadata, including same-model changes and explicit clearing back to the model default
  • honor the same selection in Grok-backed title, commit, PR, and branch-name generation
  • cover the metadata mapping and dispatch path with focused tests and an opt-in real-CLI probe

Why

Grok 4.6 advertises Extra High, High, Medium, and Low reasoning levels through its ACP model metadata, but T3 discarded Grok model capabilities and only sent model IDs. That left the composer without a reasoning control and made same-model effort changes impossible.

This is a focused reasoning-only fix. It overlaps the reasoning portion of #6383, which appeared after this work started and also bundles Grok auth, rewind, and token-usage changes.

I also compared this implementation with the orchestrator-v2 work in #5160. This PR reuses the portable safeguards from that work: safe ACP token parsing, preserved descriptions, current-vs-default separation, one default badge, and symmetric effort clearing. It intentionally leaves out v2-only lifecycle scaffolding, spawn-bound locks, and fallback catalogs.

UI Changes

Before

Grok 4.6 had no reasoning control.

Grok 4.6 before, without reasoning levels

After

The composer reads Grok 4.6's live effort menu, and changing the selection updates the visible value.

The Effort suffix in this screenshot comes from Grok 4.6's ACP-provided labels. T3 displays only ACP-advertised options, preserving their labels verbatim without synthesizing a fallback menu.

Grok 4.6 after, with Medium selected from the reasoning menu

Verification

  • vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts apps/server/src/provider/Layers/GrokProvider.test.ts apps/server/src/provider/Layers/GrokAdapter.test.ts apps/server/src/textGeneration/GrokTextGeneration.test.ts (51 tests passed)
  • T3_GROK_ACP_PROBE=1 vp test run apps/server/src/provider/acp/GrokAcpCliProbe.test.ts --reporter=verbose (4 tests passed against Grok CLI 1.0.3)
  • vp run --filter=t3 typecheck
  • targeted vp fmt --check and vp lint for all changed files
  • full Computer Use verification in Safari against the local T3 app: Grok 4.6 exposed all four advertised levels, accepted a change from Extra High to Medium, and kept the ACP default badge on Extra High

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI change
  • No animation or timing behavior changed, so a video is not applicable

Implemented with gpt-5.6-sol through the Codex harness in T3 Code.


Note

Medium Risk
Changes Grok session model binding and session/set_model behavior (including same-model effort and clearing), which affects live turns and auxiliary Grok prompts; risk is mitigated by validation, deferred set_model until after turn validation, and broad tests.

Overview
Grok reasoning effort is now wired end-to-end from ACP model metadata into the composer and runtime.

Discovery and UI contract:buildGrokModelCapabilities turns each model’s _meta.reasoningEffort / reasoningEfforts into a reasoningEffort select (labels, descriptions, default badge, token validation). Discovered Grok models use these capabilities instead of empty option lists.

ACP dispatch:setSessionModel accepts optional _meta; applyGrokAcpModelSelection compares current vs requested effort and calls session/set_model with { reasoningEffort } when the model or effort changes, or omits _meta to clear effort on the same model. GrokAdapter tracks currentReasoningEffort, applies selection after turn validation (so failed prep/validation does not call set_model), and avoids leaking prior-session effort on start when switching models. Grok text generation applies the same selection path.

Tests and the mock ACP agent cover effort metadata; install docs mention the Reasoning control for supported Grok models.

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

Note

Expose Grok reasoning effort levels from ACP model metadata in model capabilities

  • buildGrokModelCapabilities in GrokProvider.ts parses _meta.reasoningEffort and _meta.reasoningEfforts from ACP model metadata and returns a reasoningEffort select option when present; discovered models now use this instead of empty capabilities.
  • applyGrokAcpModelSelection in GrokAcpSupport.ts now tracks current and requested reasoning effort, triggering session/set_model with _meta.reasoningEffort when effort changes on the same model, and clearing it when omitted.
  • AcpSessionRuntime.setSessionModel in AcpSessionRuntime.ts accepts an optional _meta payload so reasoning effort can be forwarded in set-model requests.
  • The GrokAdapter tracks currentReasoningEffort in session context and applies it alongside model selection on sendTurn; session/set_model is no longer issued when sendTurn validation fails.
  • A Reasoning control is documented in install.md for Grok models that advertise adjustable reasoning levels.

Macroscope summarized e0fc12b.

@coderabbitai

coderabbitaiBot commented Aug 12, 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: 99c9db43-bb0d-4dc1-bd65-013bbda6379a

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-actionsgithub-actionsBot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 12, 2026
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@SunkenInTime
SunkenInTime marked this pull request as ready for review August 12, 2026 22:30
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@macroscopeapp

macroscopeappBot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new user-facing functionality - reasoning level selection for Grok models. The changes expose previously hidden metadata as UI controls and propagate new configuration through the ACP session. While thoroughly tested, this is a new capability from a new contributor to this area of the codebase.

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

@SunkenInTime
SunkenInTimeforce-pushed the t3code/add-grok-reasoning-levels branch from 534f90f to e0fc12bCompareAugust 13, 2026 00:23
@SunkenInTime

Copy link
Copy Markdown
ContributorAuthor

cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e0fc12b. Configure here.

netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 24, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 25, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 26, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 27, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
@t3dotgg

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

Grok reasoning levels already landed in #8358. This older branch no longer has a separate change to review.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotggt3dotgg closed this Aug 28, 2026
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L100-499 changed lines (additions + deletions).vouch:trustedPR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@SunkenInTime@t3dotgg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

fix(grok): expose advertised reasoning levels - #6386

Closed
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels
Closed

fix(grok): expose advertised reasoning levels#6386
SunkenInTime wants to merge 6 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/add-grok-reasoning-levels

Conversation

@SunkenInTime

@SunkenInTimeSunkenInTime commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • map each Grok model's advertised ACP reasoning menu into the existing model-option contract
  • preserve ACP descriptions, reject malformed effort tokens, and keep current selection separate from the advertised default badge
  • show those choices in the shared composer on web, desktop, and mobile surfaces
  • send the selected effort in session/set_model metadata, including same-model changes and explicit clearing back to the model default
  • honor the same selection in Grok-backed title, commit, PR, and branch-name generation
  • cover the metadata mapping and dispatch path with focused tests and an opt-in real-CLI probe

Why

Grok 4.6 advertises Extra High, High, Medium, and Low reasoning levels through its ACP model metadata, but T3 discarded Grok model capabilities and only sent model IDs. That left the composer without a reasoning control and made same-model effort changes impossible.

This is a focused reasoning-only fix. It overlaps the reasoning portion of #6383, which appeared after this work started and also bundles Grok auth, rewind, and token-usage changes.

I also compared this implementation with the orchestrator-v2 work in #5160. This PR reuses the portable safeguards from that work: safe ACP token parsing, preserved descriptions, current-vs-default separation, one default badge, and symmetric effort clearing. It intentionally leaves out v2-only lifecycle scaffolding, spawn-bound locks, and fallback catalogs.

UI Changes

Before

Grok 4.6 had no reasoning control.

Grok 4.6 before, without reasoning levels

After

The composer reads Grok 4.6's live effort menu, and changing the selection updates the visible value.

The Effort suffix in this screenshot comes from Grok 4.6's ACP-provided labels. T3 displays only ACP-advertised options, preserving their labels verbatim without synthesizing a fallback menu.

Grok 4.6 after, with Medium selected from the reasoning menu

Verification

  • vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts apps/server/src/provider/Layers/GrokProvider.test.ts apps/server/src/provider/Layers/GrokAdapter.test.ts apps/server/src/textGeneration/GrokTextGeneration.test.ts (51 tests passed)
  • T3_GROK_ACP_PROBE=1 vp test run apps/server/src/provider/acp/GrokAcpCliProbe.test.ts --reporter=verbose (4 tests passed against Grok CLI 1.0.3)
  • vp run --filter=t3 typecheck
  • targeted vp fmt --check and vp lint for all changed files
  • full Computer Use verification in Safari against the local T3 app: Grok 4.6 exposed all four advertised levels, accepted a change from Extra High to Medium, and kept the ACP default badge on Extra High

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI change
  • No animation or timing behavior changed, so a video is not applicable

Implemented with gpt-5.6-sol through the Codex harness in T3 Code.


Note

Medium Risk
Changes Grok session model binding and session/set_model behavior (including same-model effort and clearing), which affects live turns and auxiliary Grok prompts; risk is mitigated by validation, deferred set_model until after turn validation, and broad tests.

Overview
Grok reasoning effort is now wired end-to-end from ACP model metadata into the composer and runtime.

Discovery and UI contract:buildGrokModelCapabilities turns each model’s _meta.reasoningEffort / reasoningEfforts into a reasoningEffort select (labels, descriptions, default badge, token validation). Discovered Grok models use these capabilities instead of empty option lists.

ACP dispatch:setSessionModel accepts optional _meta; applyGrokAcpModelSelection compares current vs requested effort and calls session/set_model with { reasoningEffort } when the model or effort changes, or omits _meta to clear effort on the same model. GrokAdapter tracks currentReasoningEffort, applies selection after turn validation (so failed prep/validation does not call set_model), and avoids leaking prior-session effort on start when switching models. Grok text generation applies the same selection path.

Tests and the mock ACP agent cover effort metadata; install docs mention the Reasoning control for supported Grok models.

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

Note

Expose Grok reasoning effort levels from ACP model metadata in model capabilities

  • buildGrokModelCapabilities in GrokProvider.ts parses _meta.reasoningEffort and _meta.reasoningEfforts from ACP model metadata and returns a reasoningEffort select option when present; discovered models now use this instead of empty capabilities.
  • applyGrokAcpModelSelection in GrokAcpSupport.ts now tracks current and requested reasoning effort, triggering session/set_model with _meta.reasoningEffort when effort changes on the same model, and clearing it when omitted.
  • AcpSessionRuntime.setSessionModel in AcpSessionRuntime.ts accepts an optional _meta payload so reasoning effort can be forwarded in set-model requests.
  • The GrokAdapter tracks currentReasoningEffort in session context and applies it alongside model selection on sendTurn; session/set_model is no longer issued when sendTurn validation fails.
  • A Reasoning control is documented in install.md for Grok models that advertise adjustable reasoning levels.

Macroscope summarized e0fc12b.

@coderabbitai

coderabbitaiBot commented Aug 12, 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: 99c9db43-bb0d-4dc1-bd65-013bbda6379a

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-actionsgithub-actionsBot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 12, 2026
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@SunkenInTime
SunkenInTime marked this pull request as ready for review August 12, 2026 22:30
Comment threadapps/server/src/provider/Layers/GrokAdapter.ts Outdated
@macroscopeapp

macroscopeappBot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new user-facing functionality - reasoning level selection for Grok models. The changes expose previously hidden metadata as UI controls and propagate new configuration through the ACP session. While thoroughly tested, this is a new capability from a new contributor to this area of the codebase.

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

@SunkenInTime
SunkenInTimeforce-pushed the t3code/add-grok-reasoning-levels branch from 534f90f to e0fc12bCompareAugust 13, 2026 00:23
@SunkenInTime

Copy link
Copy Markdown
ContributorAuthor

cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e0fc12b. Configure here.

netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 24, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 25, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 26, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 27, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
@t3dotgg

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

Grok reasoning levels already landed in #8358. This older branch no longer has a separate change to review.

If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

@t3dotggt3dotgg closed this Aug 28, 2026
netpro2k added a commit to netpro2k/t3code that referenced this pull request Aug 28, 2026
Intent:
Keep Grok 4.6 usable from T3: plan-mode turns must stay reviewable over ACP,
advertised reasoning levels and user-invocable skills must show in the
composer, and the T3 runtime-mode control must actually drive Grok instead of
~/.grok/config.toml.
Behavior:
- Handle both x.ai/exit_plan_mode and _x.ai/exit_plan_mode, including wrapped
payloads and null planContent.
- Emit the existing proposed-plan card from planContent, or fall back to the
last session plan.md body when Grok races the plan-file write.
- Reply abandoned with a capture message so Grok unblocks without implementing
in the same turn.
- Detect enter_plan_mode and promote writes to ~/.grok/sessions/.../plan.md
onto the same card. Ignore workspace plan.md files, dedupe identical
markdown per turn, and clear fallback state on settle or a new non-steer
turn.
- Leave implement and request-changes to the existing proposed-plan follow-up;
do not auto-approve plans even in full-access mode.
- Map each Grok model's ACP _meta.reasoningEfforts into the existing Reasoning
select, preserving labels and descriptions and exposing the applied effort
as currentValue. Keep one default badge and do not invent a menu when
metadata is absent.
- Apply reasoning effort through session/set_model _meta.reasoningEffort,
including effort-only changes. Do not carry an effort across model switches
unless explicitly selected, skip set_model when nothing changes, and defer
turn-time mutation until sendTurn validation succeeds.
- Honor the selected effort in Grok-backed title, commit, PR, and branch-name
generation.
- Read user-invocable skills from grok inspect --json into the provider
snapshot; use those names for both $ and /, skip bundled helpers, and leave
both catalogs empty on inspect failure without failing provider discovery.
- Supervised spawns `--permission-mode default` so the thread asks even if the
Grok CLI config is always-approve or auto.
- Auto-accept edits spawns `--permission-mode acceptEdits`.
- Auto spawns `--permission-mode auto` and sends session/new (and session/load)
`_meta.autoMode: true`.
- Full access spawns `grok agent --always-approve stdio` and sends
`_meta.yoloMode: true`.
- Probe and text-generation ACP processes omit a T3 mode and keep `grok agent
stdio`.
- Always allow this session falls back to allow_once when Grok omits
allow_always, then auto-approves later prompts in that session.
- Auto still escalates risky calls to T3; it is not always-approve.
Design constraints:
- Keep Grok-specific ACP, inspect, and permission dialects at the
adapter/provider boundary. Do not change contracts or other providers.
- Reuse turn.proposed.completed, the existing plan card, and generic composer
optionDescriptors / skills / slashCommands. Add no Grok-only approval
prompt or new composer UI.
- Do not spawn-bind --reasoning-effort or require a new thread to change
effort; Grok applies _meta in place.
- Do not map T3 Auto to yolo / bypassPermissions. That is Full access.
- Do not restart mid-thread on a runtime-mode change (separate hang: upstream
pingdotgg#6517).
Integration:
- Grok adapter, xAI ACP extension helpers, ACP mock, ACP session runtime
(set_model and session/new|/load _meta), Grok spawn args, Grok
model/provider snapshot, inspect catalog parser, text generation, focused
tests, internals provider docs, install.md, and permission-modes.md.
- Web, desktop, and mobile consume existing proposed-plan events, generic
snapshot fields, and the existing runtime-mode picker with no client
changes.
Verification:
- vp test run apps/server/src/provider/acp/GrokAcpSupport.test.ts
apps/server/src/provider/Layers/GrokProvider.test.ts
apps/server/src/provider/Drivers/GrokSkills.test.ts
apps/server/src/provider/Layers/GrokAdapter.test.ts
apps/server/src/provider/acp/XAiAcpExtension.test.ts
- Runtime-mode slice: 57 passed (GrokAcpSupport, GrokAdapter, GrokProvider).
- Earlier combined Grok slice: 64 passed including skills and xAI extension.
Rebase notes:
- Conflict hotspots are GrokAdapter plan handlers, sendTurn settlement,
handleRequestPermission, buildGrokAcpSpawnInput, XAiAcpExtension.ts,
GrokProvider discovered-model capabilities, GrokDriver inspect cwd, and
AcpSessionRuntime setSessionModel plus session/new _meta.
- Upstream pingdotgg#4514 (plan), pingdotgg#5403/pingdotgg#6386/pingdotgg#6887 (reasoning), pingdotgg#4109 (skills),
pingdotgg#6502/pingdotgg#6626 (Always allow and spawn permission-mode). Drop this patch only
when main handles both plan-exit spellings with live/fallback plan capture,
maps ACP reasoningEfforts and effort-only set_model, publishes grok inspect
skills to $ and /, forwards all four T3 modes onto Grok argv with
autoMode/yoloMode on session setup, Supervised overrides config.toml, and
Always allow does not cancel when allow_always is missing.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L100-499 changed lines (additions + deletions).vouch:trustedPR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@SunkenInTime@t3dotgg