Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

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

Recovery: New PR after head fork EnzoTironi/t3code was deleted (auto-closed #5423). Same branch tip (300d888). #5424/#5425 stay closed (absorbed into this PR).

Original: https://github.com/pingdotgg/t3code/pull/5423

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 to the Grok adapter and shared ACP parsing affect turn lifecycle, prompts, and provider snapshots; risk is mitigated by extensive tests but regressions could affect non-Grok ACP consumers of the shared parser.

Overview Grok provider now maps live Grok ACP behavior into existing T3 UI (context meter, Plan/Build, proposed-plan cards, task rows, slash/skills) instead of leaving those wire events unused.

The shared ACP layer gains parsers and events for thought chunks, usage, command/config/session-info updates, and optional streamKind on content deltas; session/set_model can pass through _meta (used for reasoning effort).

GrokAdapter wires xAI extensions: prompt _meta and usage_update → thread.token-usage.updated; session_info_update → thread titles; auto_compact_completed → compacted state; exit_plan_mode → proposed-plan capture without hanging the turn; spawn_subagent → task.*; plan mode via /plan and /default on send (after successful prompt). Mid-thread reasoning effort uses session/set_model _meta.reasoningEffort without restarting the child process.

GrokDriver / GrokProvider push live slash/skills catalogs (including authoritative empty clears), always retain static /compact, discover model Reasoning options from metadata, set requiresNewThreadForModelChange: false, enable the interaction-mode toggle, and refresh snapshots on catalog updates—not only health probes.

The ACP mock agent and broad unit/integration tests exercise the new paths.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit aa9ae80a82b3a6fac511d7b2421e4e9f0ac9c22e. 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 with catalog, effort, usage, plan, multi-agent, and compact support

  • Extends GrokAdapter.ts to emit thread.token-usage.updated events from both prompt RPC metadata and UsageUpdated session events, including maxTokens when available.
  • Adds reasoning effort selection: spawn args now include --reasoning-effort and --model flags via GrokAcpSupport.ts, and mid-thread effort changes are applied via setSessionModel or setConfigOption without restarting the process.
  • Parses availableCommands from ACP initialize _meta and live available_commands_update events, surfacing slash commands and skills in all provider snapshots including a static /compact command.
  • Detects Grok subagent tool calls and emits task.started/task.completed events; tracks plan mode entry/exit via enter_plan_mode tool calls and exit_plan_mode RPC, emitting turn.proposed.completed with plan markdown.
  • Maps x.ai session_notification with auto_compact_completed to thread.state.changed; maps session_info_update titles to thread.metadata.updated.
  • GrokDriver.ts merges live command catalogs into all snapshot paths (initial, health-check, and streamed changes) via a Ref/PubSub pair.
  • Behavioral Change: provider presentation no longer shows the Early Access badge, enables the interaction mode toggle, and allows model changes within an existing thread session.
Macroscope summarized aa9ae80.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. 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: 8dbfcbe4-b12e-4900-b5a2-25332034e50c

      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.
    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR introduces substantial new Grok integration features (plan mode, multi-agent visibility, usage tracking, slash commands) with ~3000 lines of new runtime behavior and state management. Additionally, an unresolved high-severity bug was identified regarding plan mode state handling.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. 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 aa9ae80a82b3a6fac511d7b2421e4e9f0ac9c22e. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -1096,3 +1858,8 @@
      10961858 input.threadId,
      10971859 Effect.gen(function* () {
      10981860 const ctx = yield* requireSession(input.threadId);
      1861+ // Prompt RPC succeeded — apply plan enter/exit only now so a failed
      1862+ // prep or send cannot leave local planModeActive desynced from Grok.
      1863+ if (prepared.planModeUpdate !== undefined) {
      1864+ ctx.planModeActive = prepared.planModeUpdate;
      1865+ }

      Plan flag revived after exit

      High Severity

      exit_plan_mode clears planModeActive, but a successful /plan turn then applies planModeUpdate: true and turns it back on. The field docs say plan mode ends when exit_plan_mode resolves, so the next Build turn incorrectly prefixes /default onto the implementation prompt after Grok already left plan mode.

      Additional Locations (2)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit aa9ae80a82b3a6fac511d7b2421e4e9f0ac9c22e. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      Closing this PR after an automated pass over open pull requests. Bundles six Grok features and fixes even though basic Grok ACP support already shipped.

Sign in to join this conversation.