Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(grok): native ACP parity (catalog, effort, usage, plan, multi-agent, compact) #5423

ClosedEnzoTironi(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/5423/headopened View on GitHub

What Changed

Grok provider ACP parity (self-contained branch: shared parser commit + Grok adapter commit):

AreaBehavior
Shared ACPsession/update kinds → typed events; set_model _meta pass-through (#5422 same commits)
CatalogLive commands → slash/skills; empty live catalog clears stale; static /compact always present
EffortPer-model Reasoning select; apply via session/set_model _meta.reasoningEffort (no process restart)
UsagePrompt _meta + usage_update → context meter; per-model windows; idempotent
Plan entryPlan mode → /plan text; Plan/Build toggle for Grok
Plan surfaceexit_plan_mode → proposed-plan card + abandoned capture; session plan.md only under ~/.grok/sessions/
Multi-agentspawn_subagent → task.* with unique stamps + dedupe
Compact/compact + auto_compact_completed → compacted work-log row

Fixes #5417 #5418 #5419 #5420.

Merge note: Prefer merging #5422 first (shared parser only, size L), then this. If maintainers want one PR, this tip already contains both commits and can land alone.

Why

Grok Build already exposes these on the wire. T3 left them dark while Claude/Codex surface them. One adapter-boundary PR avoids unmergeable half-states from mid-file splits.

Related: #5403 #5405 #5409 #5412 #5131 — this tip absorbs those lakes with review fixes.

UI Changes

Uses existing Traits / meter / proposed-plan / task rows / Plan toggle — no new chrome.

Grok selected with effort menu

Grok 4.5 with High Effort selected

Reasoning effort options for Grok

Plan mode toggle

Grok composer in Plan mode

Slash menu: /plan (built-in) + /compact (provider)

Grok slash commands including /plan and /compact

Checklist

  • Small and focused — large by necessity (full Grok adapter). #5422 is the small shared slice if you want a smaller first merge.
  • Explained what/why
  • UI screenshots for effort, plan toggle, slash/compact
  • Video N/A

Out of scope

  • Desktop / Zoen brand
  • Web sticky → #5426
  • #5160 dump

Test plan

  • 72 unit tests (GrokAcpSupport, XAi, GrokProvider, GrokAdapter)
  • Live spawn_subagent probe
  • set_model effort without process restart

Model: grok-4.5 (Grok Build)


Note

Medium Risk Large, behavior-rich changes across Grok session lifecycle, turn settlement, and provider snapshots; mistakes could affect token metering, plan mode, or catalog freshness, but scope is mostly Grok-specific with heavy test coverage.

Overview Brings Grok’s live ACP wire behavior into T3: slash/skills catalogs from initialize and available_commands_update (with immediate provider snapshot pushes), static /compact, and Plan/Build via /plan and /default plus interaction-mode toggle without forcing a new thread on model change.

The adapter maps xAI extensions and richer session/update kinds into existing UI events: prompt _meta and usage updates → context meter; session_info_update → thread title; auto_compact_completed → compacted work log; exit_plan_mode and session plan.md writes → proposed-plan cards; spawn_subagent → task rows; reasoning effort via session/set_model _meta (and optional config options) with CLI flags only on spawn.

Shared ACP parsing gains thought chunks, usage, commands, config, and session-info events; setSessionModel passes through _meta. Mock agent and broad unit/integration tests cover the new paths.

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

Note

Add native ACP parity to Grok provider including catalog, reasoning effort, token usage, plan mode, multi-agent, and compact support

  • GrokAdapter.ts now emits thread.token-usage.updated from both prompt RPC meta and session/update UsageUpdated events, including per-model context window tracking.
  • Plan mode is supported end-to-end: prompt text is prefixed with /plan or /default based on interactionMode, enter_plan_mode tool calls toggle plan state, and turn.proposed.completed events are emitted from plan.md writes and exit_plan_mode.
  • Multi-agent support tracks Grok subagent tool calls and emits task.started/task.completed events; /compact prompts trigger thread.state.changed via auto_compact_completed session notifications.
  • ACP command catalog is discovered at initialization and live-updated: slash commands and skills are derived from availableCommands in the ACP init result, with /compact always present as a static fallback via ensureGrokStaticSlashCommands.
  • Reasoning effort is applied via session/set_model _meta.reasoningEffort (or session/set_config_option when exposed as a config option), and models now surface a Reasoning select in capabilities when advertised.
  • session_info_update notifications map to thread.metadata.updated; agent_thought_chunk maps to ContentDelta with streamKind: 'reasoning_text'.
  • Provider presentation now shows the interaction mode toggle and no longer requires a new thread on model change.
  • Behavioral Change: provider snapshots are pushed immediately on commandCatalogChanges, not only on health probes or setting changes.
Macroscope summarized 300d888.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 789a0cda-f325-4c3a-8b00-2084830cae0a

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

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

      Approvability

      Verdict: Needs human review

      This feature PR introduces substantial new Grok provider capabilities including reasoning effort configuration, token usage tracking, Plan/Build mode mapping, multi-agent task visibility, compact commands, and slash command catalogs. The scope and complexity of these new runtime behaviors warrants human review.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Review findings from Bugbot/Macroscope for this slice are fixed on the Zoen product tip (zoen/main @ 16474ab0d). Will restack / re-push these PR heads after further slim-slicing. Open remaining: effort restart without session.exited (or adopt #5403 set_model path).

    5. UI screenshots

      Grok model + effort

      selected

      effort menu

      Plan mode

      plan

      Slash: /plan + /compact

      slash

    6. Man I just wanted grok to work normally with some QoL improvements, and you took that and turned it up to 11 hopefully it works, its a ton of changes

    7. Man I just wanted grok to work normally with some QoL improvements, and you took that and turned it up to 11 hopefully it works, its a ton of changes

      I am still working on it. I am now making the stop button work properly. You can checkout to the PR and test it out.

    8. Oh yeah, i totally forgot about that, the thread still keeps going even if you interrupt it.

      There is also steer/queue prompts (currently the message gets send but its put in the queue, in t3 code it continues working unter that message, you think you steered but you didn't, it only starts workingon that when it replies)

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

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 300d8886b2bac2f056514521dc047398970eef58. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -868,4 +1549,21 @@
      8681549 rawPayload: event.rawPayload,
      8691550 }),
      8701551 );
      8711552 return;
      1553+ case "UsageUpdated": {
      1554+ const maxTokens =
      1555+ event.usage.size > 0
      1556+ ? event.usage.size
      1557+ : resolveActiveContextWindowTokens(ctx);
      1558+ yield* offerRuntimeEvent(
      1559+ makeAcpTokenUsageEvent({
      1560+ stamp,
      1561+ provider: PROVIDER,
      1562+ threadId: ctx.threadId,
      1563+ turnId: notificationTurnId,
      1564+ usedTokens: event.usage.used,
      1565+ ...(maxTokens !== undefined ? { maxTokens } : {}),
      1566+ rawPayload: event.rawPayload,
      1567+ }),
      1568+ );
      1569+ return;
      cursor[bot](GitHub profile, opens in a new tab)commented

      Usage update overwrites prompt meta

      Medium Severity

      The adapter emits redundant thread.token-usage.updated events. UsageUpdated session notifications always trigger an event, even after a prompt RPC has already provided a more detailed token usage event for the same turn. This can lead to sparser UsageUpdated data overwriting richer prompt RPC usage details.

      Additional Locations (1)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 300d8886b2bac2f056514521dc047398970eef58. Configure [here](https://www.cursor.com/dashboard/bugbot).
    10. Head fork was deleted and GitHub closed this PR permanently (cannot reopen).

      Correct recovery PR: pull request title must not be blank

      Same commits/branch tip as this one. #5424 and #5425 stay closed on purpose (absorbed into the Grok native parity PR).

Sign in to join this conversation.