Skip to content

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

Open
EnzoTironi wants to merge 4 commits into
pingdotgg:mainfrom
EnzoTironi:pr/grok-native
Open

feat(grok): native ACP parity (catalog, effort, usage, plan, multi-agent, compact)#5423
EnzoTironi wants to merge 4 commits into
pingdotgg:mainfrom
EnzoTironi:pr/grok-native

Conversation

@EnzoTironi

@EnzoTironi EnzoTironi commented Aug 5, 2026

Copy link
Copy Markdown

What Changed

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

Area Behavior
Shared ACP session/update kinds → typed events; set_model _meta pass-through (#5422 same commits)
Catalog Live commands → slash/skills; empty live catalog clears stale; static /compact always present
Effort Per-model Reasoning select; apply via session/set_model _meta.reasoningEffort (no process restart)
Usage Prompt _meta + usage_update → context meter; per-model windows; idempotent
Plan entry Plan mode → /plan text; Plan/Build toggle for Grok
Plan surface exit_plan_mode → proposed-plan card + abandoned capture; session plan.md only under ~/.grok/sessions/
Multi-agent spawn_subagenttask.* 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

Out of scope

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

High Risk
Large, central Grok provider/ACP adapter changes affect turn lifecycle, catalog merging, plan-mode prompt rewriting, and token usage—behavior users rely on in every Grok thread; regressions would be user-visible across sessions.

Overview
Brings Grok’s live ACP wire behavior into T3’s existing provider UI: context meter, Plan/Build, slash/skills, proposed-plan cards, task rows, and compaction work-log entries—without new chrome.

Shared ACP parsing now turns more session/update kinds into typed events (reasoning chunks, usage, available commands, config options, session info, user echoes) and passes optional _meta through session/set_model.

Grok provider snapshot enables Plan/Build and in-thread model changes (requiresNewThreadForModelChange → false), discovers models with Reasoning option descriptors from _meta, merges live slash/skills from initialize and available_commands_update (empty catalog clears stale entries), always keeps static /compact, and improves probe auth messaging.

Grok driver publishes catalog changes immediately via PubSub so clients do not wait on the next health probe.

Grok adapter maps those events to runtime semantics: token usage from prompt _meta and usage_update; thread titles from session_info_update; /compact / auto_compact_completedthread.state.changed compacted; exit_plan_mode and session plan.md writes → turn.proposed.completed with abandoned capture so turns do not hang; spawn_subagenttask.* with dedupe; plan mode via /plan and /default prompt prefixes; mid-thread reasoning effort via session/set_model _meta.reasoningEffort (CLI flags only on spawn); optional onAvailableCommands callback for the driver.

Mock agent and tests are extended to simulate initialize commands, usage meta, compaction, session info, skills-reload response ids, and effort set_model without process restart.

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

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 29e5c6b.

@coderabbitai

coderabbitai Bot commented Aug 5, 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: a1107d08-4425-42a6-923f-896cbe02c01a

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-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 5, 2026
Comment thread apps/server/src/provider/Layers/GrokProvider.ts Outdated
Comment thread apps/server/src/provider/Drivers/GrokDriver.ts
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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.

@EnzoTironi

Copy link
Copy Markdown
Author

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).

@EnzoTironi
EnzoTironi force-pushed the pr/grok-native branch 2 times, most recently from 449b958 to 6c766ad Compare August 5, 2026 16:22
Comment thread apps/server/src/provider/acp/GrokAcpSupport.ts Outdated
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Outdated
Comment thread apps/server/src/provider/acp/XAiAcpExtension.ts Outdated
Comment thread apps/server/src/provider/acp/GrokAcpSupport.ts
@EnzoTironi EnzoTironi changed the title feat(grok): native ACP provider core (catalog, effort, usage) feat(grok): native ACP parity (catalog, effort, usage, plan, multi-agent, compact) Aug 5, 2026
Comment thread apps/server/src/provider/acp/GrokAcpSupport.ts
@EnzoTironi

Copy link
Copy Markdown
Author

UI screenshots

Grok model + effort

selected

effort menu

Plan mode

plan

Slash: /plan + /compact

slash

- Skip set_model when effort matches currentEffort; no-op when model id missing
- Session model context windows win over initializeMeta for the same modelId
- Require encoded-cwd/session-id segments for Grok plan.md paths
- Prefix /default when leaving plan mode for Build

@cursor cursor Bot 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.

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.

Reviewed by Cursor Bugbot for commit 0792ff8. Configure here.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts
clearProposedPlanFallback only drops turn-scoped plan.md fallback. Clearing
planModeActive there made every new sendTurn see plan mode as off, so Build
never emitted /default after a Plan turn.
@ahmed-besic

Copy link
Copy Markdown

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

@EnzoTironi

Copy link
Copy Markdown
Author

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.

@ahmed-besic

Copy link
Copy Markdown

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grok/ACP: sessionUpdate parity for live Grok agent stdio

2 participants