GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(grok): Grok Build workflows, usage, rewind — supersedes #6383 by maslinedwin · Pull Request #7070 · pingdotgg/t3code

Conversation

@maslinedwin

@maslinedwin maslinedwin commented Aug 15, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Supersedes #6383.

#6383 wired effort, login, rewind, and a thin token parse. Grok Build was already streaming workflows, subagents, PromptUsage, compact, hooks, and queue over ACP. T3 dropped those notifications, so a Rhai workflow still looked like one chat turn.

This PR rebases the useful #6383 commits onto current main and maps the live Grok wire onto surfaces T3 already has. No Rhai host. No third Agents UI.

Rule

Complexity stays at the adapter. Claude workflow members use parentAgentId + timelineBypass. Codex collab children do the same. Grok uses that shape. Child tokens stay on typedUsage. They never replace the thread context window.

What you get

In T3 On the wire
Model + Reasoning in the composer Live ACP menu. session/set_model _meta.reasoningEffort. No new thread. Product slug grok-build is an alias for the current model — T3 does not send it.
Plan / Default session/set_mode onto advertised plan/architect vs code/agent. ACP plan entries already fill the turn plan list.
Composer /workflow pause|resume|stop and named scripts Lists ~/.grok/workflows and <project>/.grok/workflows. Picking one sends that slash text as a prompt. The Grok CLI runs it. Project scripts override user scripts.
Agents panel for a workflow run x.ai/session_notification / _x.ai/session/update workflow_updated → local_workflow + child subagent rows.
Agents panel for agent() subagent_spawned / progress / finished → the same child-task path.
Context meter + Usage page PromptUsage (totals, cached_read_tokens, incomplete flag). Usage page scans ~/.grok/sessions/**/updates.jsonl. Contract v5 adds grok.
Dollars Complete costUsdTicks only (1e10 = $1). Incomplete bills stay token-only. Never $0.
Undo N turns _x.ai/rewind. Target from remaining history so a cancelled in-flight prompt cannot ghost. Local turns trim only after execute succeeds.
Compact / hooks / queue / recap / background shells Existing events: context meter + compacted, hook.*, session queue length, thread metadata, local_bash.

Login: grok login or XAI_API_KEY. Probe reports unauthenticated vs missing CLI.

From #6383

Theo's three commits (effort menu, set_model effort, rewind, auth probe, in-thread model change) are cherry-picked. Author stays Theo. This branch is the one to review.

Not this PR

Plugins and marketplace updates are accepted and ignored. T3 has no plugin surface. Grok TUI /usage is still the CLI's own screen; T3's Usage page is the transcript scan.

Tests

Adapter, workflow mapper, extras, slash-command discovery, usage transcripts, usage chart. CI Check failed on exactOptionalPropertyTypes (T \| undefined into optional bags). CI Test failed because the usage chart now emits a zero Grok band. Both fixed.

Made with Grok 4.6.


Note

High Risk
Touches the Grok adapter’s session/turn lifecycle, rewind, permissions, and usage contract v5 (older clients miss Grok usage). Permission fallback to allow_once can change auto-approval when Grok omits allow_always.

Overview
Grok Build now uses the same composer, Agents, usage, and undo surfaces as Claude/Codex instead of dropping ACP extras as a single chat turn.

The adapter maps live x.ai session notifications onto existing events: workflows and agent() as local_workflow/subagent tasks (parentAgentId + timelineBypass), plus compact, hooks, queue, recap, and background shells. Reasoning effort and plan/code modes go through session/set_model _meta and session/set_mode; grok-build aliases the live model so in-thread switches work. Undo uses _x.ai/rewind after cancelling in-flight prompts. Workflow .rhai scripts from home/project .grok/workflows become slash commands.

Usage contract v5 adds grok: prompt usage and complete costUsdTicks on the thread, plus scanning ~/.grok/sessions/**/updates.jsonl for the Usage page. Tool-call ticks are rate-limited and truncated. Permission acceptForSession falls back to allow_once when Grok omits allow_always. Auth probe distinguishes login vs missing CLI.

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

Note

Add Grok Build provider workflows, usage, and rewind support

  • Adds Grok as a new usage provider kind, parsing updates.jsonl transcripts and bumping USAGE_CONTRACT_VERSION to 5.
  • Introduces ACP mapping for Grok workflows, subagent lifecycles, session extras (hooks, auto-compact, recaps), and tool update gating.
  • Implements conversation rewind via _x.ai/rewind/points and _x.ai/rewind/execute RPC methods, including active prompt cancellation and state trimming.
  • Adds reasoning effort menu handling, model resolution, and fallback capabilities for the grok-build model.
  • Risk: bumps USAGE_CONTRACT_VERSION in usage.ts; clients must negotiate version 5 to report Grok usage.

Macroscope summarized 1a3608f.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
t3dotgg and others added 4 commits August 15, 2026 18:26
@t3dotgg @maslinedwin
feat(server): wire Grok Build effort, auth, rewind, and usage
2263b8c
Grok already advertised reasoning effort and rewind over ACP. T3 dropped the metadata and forced a new thread for model changes.

Map the live effort menu into composer options, send session/set_model _meta.reasoningEffort, probe login, roll back turns through _x.ai/rewind, and emit thread token usage.

Made with Grok 4.6.
@t3dotgg @maslinedwin
fix(server): allow undefined Grok effort on session/set_model
d3dcbf5
exactOptionalPropertyTypes rejected passing string | undefined into the optional effort fields, which also leaked unknown into the adapter Effect error channel.

Made with Grok 4.6.
@t3dotgg @maslinedwin
fix(server): keep Grok effort and rewind aligned with the live session
cf18ba5
Do not carry an old effort onto a new model. Count steered prompts when rewinding. Lock rollback against a replaced session. Keep one default effort in the composer menu.

Made with Grok 4.6.
@maslinedwin
feat(server): ingest Grok Build workflows and real PromptUsage
fe46af8
pingdotgg#6383 wired effort, rewind, and a thin usage parser. Grok Build already
streams workflow_updated over x.ai/session_notification and bills through
PromptUsage totals. T3 dropped both.

Map workflow runs onto local_workflow / subagent tasks, fold child tokens
into thread usage, and accept the official cached_read_tokens shape.
@coderabbitai

coderabbitai Bot commented Aug 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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: 219cc4f4-51d5-4477-a535-cddbdffedc68

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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 15, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 15, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokProvider.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 15, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokProvider.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

macroscopeapp Bot commented Aug 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Skipped

Macroscope did not run approvability analysis for this PR. Macroscope could not determine whether this PR modifies its approvability configuration, so the PR was not approved automatically. A PR that may change the rules that govern approval is never approved automatically.

Not approved because:

  • 2 blocking correctness issues found at or above your repo's Minimum Blocking Severity
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maslinedwin
fix(grok): align workflow ingest with Claude and Codex
1d45fdb
Claude stamps workflow members with parentAgentId, timelineBypass, and a
stable slot id. Codex does the same for collab children and keeps child
tokens on typedUsage. The first Grok ingest used agentId and overwrote
the thread context window with the child token sum.

Extract a pure mapper, complete first-seen terminal runs, skip unchanged
member ticks, and ingest Grok's standalone subagent ACP updates on that
same path.
@maslinedwin

maslinedwin commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up `1d45fdb2` after auditing this against how T3 actually integrates Claude and Codex.

What T3 expects (and the first ingest got wrong)

  • Claude workflow members use `parentAgentId` + `timelineBypass` + a stable `:wf:` slot. Codex collab children do the same. The first Grok mapper set `agentId = runId`, which T3 reads as “launched from inside a subagent,” and it did not bypass the parent timeline.
  • Child tokens belong on `typedUsage`. Claude never folds member tokens into `thread.token-usage.updated`. Codex rewrites child usage to `collabAgent/tokenUsage` so it cannot clobber the parent context window. The first Grok mapper emitted `usedTokens: workflowSum`, which ingestion treats as the new context-window snapshot (latest-wins on the client).
  • A first notification that is already terminal must still emit `task.completed`. Claude/Codex both handle first-seen terminal; we only completed if we had already seen a start.

What this commit does

  • Pure mapper in `GrokAcpWorkflow.ts` (same seam as Claude’s `parseWorkflowProgress` / Codex’s `mapCollabAgentEvent`).
  • Members match Claude linkage. Unchanged ticks are fingerprinted and skipped.
  • Prompt usage stays the context-window snapshot; child tokens stay on the task.
  • Standalone Grok `subagent_spawned|progress|finished` updates use that same child-task path.

58 Grok tests passing (workflow mapper, adapter, extension, support).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 15, 2026
View reviewed changes
Comment thread apps/server/src/provider/acp/GrokAcpWorkflow.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/acp/GrokAcpWorkflow.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@maslinedwin
fix(grok): close remaining Macroscope and Bugbot findings
c99fc87
Pass spawn-time effort before ACP discovery. Hide Reasoning on models
that do not support it, and keep the fallback menu only when support is
advertised without choices. Key workflow members by agent_id, clear
stale maxTokens on model switch, and keep duration/tool-use on
subagent finish.
macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 15, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 15, 2026
View reviewed changes
Comment thread apps/server/src/provider/acp/GrokAcpWorkflow.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@maslinedwin
fix(grok): cancel in-flight prompts before rewind and keep subagent t…
615135e
…okens

Rewind now stops the live ACP prompt first so a late session/prompt
cannot re-append a discarded turn. Tool-only subagent ticks reuse the
last known token count instead of publishing totalTokens: 0.
macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 15, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

maslinedwin added 2 commits August 15, 2026 23:54
@maslinedwin
fix(grok): emit token usage from the sendTurn success fallback
5c8bd7c
The Effect.ensuring path already kept the prompt result after sendTurn
was interrupted. It now publishes thread.token-usage.updated the same
way the happy path does.
@maslinedwin
fix(grok): close reported model, login, permission, and tool-update i…
b0079ed
…ssues

Map the product slug grok-build onto a live ACP model before
session/set_model (pingdotgg#6075). If Always allow has no allow_always option,
fall back to allow_once instead of cancelling the turn (pingdotgg#6502). Skip
ACP startup on provider probe when there is no XAI_API_KEY or
~/.grok/auth.json, so a background check cannot open a login browser
(pingdotgg#5852, pingdotgg#4983). Bound high-churn tool_call_update payloads so a
redrawing terminal does not flood ingestion (pingdotgg#6556).
This was referenced Aug 16, 2026
[Bug]: Grok model slug grok-build advertised but rejected by Grok CLI ACP (session/set_model → Invalid params / unknown model id) #6075
Closed
[Bug]: Always allow in this session stops Grok 4.6 #6502
Closed
Grok provider check can open browser login without user action #5852
Closed
[Bug]: Grok Build constantly opens new log in pages #4983
Closed
[Bug]: Grok ACP resends full cumulative terminal output in every tool_call_update, flooding ingestion for all threads #6556
Closed
macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 16, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/GrokProvider.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/acp/GrokAcpToolUpdates.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/acp/GrokAcpToolUpdates.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 16, 2026
View reviewed changes

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Reviewed the Grok ACP changes against the Effect service conventions. Three findings in apps/server/src/provider/Layers/GrokAdapter.ts; the new pure modules (GrokAcpWorkflow.ts, GrokAcpToolUpdates.ts, XAiAcpExtension.ts) and the new FileSystem/Path acquisition in GrokProvider.ts follow the conventions (namespace subpath imports, dependencies acquired from the environment, requirements surfaced in the signature).

Posted via Macroscope — Effect Service Conventions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 16, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/GrokProvider.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@maslinedwin
fix(grok): address Macroscope and Bugbot findings on probe, tools, an…
5f29710
…d rewind

Drop the incomplete auth-file pre-check so GROK_HOME and provider-command
credentials still reach ACP; keep CI/NO_BROWSER on the probe. Read the
tool-update clock through Effect Clock, fingerprint more than content
length, and bound aggregate tool payloads. Replay session notifications
that arrive during acp.start, delete the permission-option wrapper, and
keep rewind errors as cause rather than wire detail.
cursor[bot]
cursor Bot reviewed Aug 16, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/acp/GrokAcpToolUpdates.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

maslinedwin added 4 commits August 22, 2026 23:51
@maslinedwin
feat(grok): map session extras onto existing runtime events
29016bb
Live Grok extras arrive on `_x.ai/session/update`, not only
`x.ai/session_notification`. Auto-compact, hooks, recap, background
shells, and complete PromptUsage costUsdTicks were dropped.

Parse those updates onto the same compact, hook.*, metadata, local_bash,
and token-usage events Claude already uses. Incomplete bills stay
token-only.
@maslinedwin
feat(grok): honor plan mode through session/set_mode
935cd6c
The Grok composer hid Plan/Default even though ACP advertises architect
and code modes, and sendTurn never called set_mode.

Turn the toggle on and map Plan onto the advertised plan/architect mode
and Default onto code/agent, the same way Cursor does. ACP plan entries
already update the turn plan list.
@maslinedwin
feat(grok): advertise workflow slash commands from disk scripts
103affa
Pause, resume, and stop still lived only in the Grok TUI, and T3 had no
way to launch a named Rhai workflow without reimplementing the host.

Surface `/workflow pause|resume|stop` plus `~/.grok/workflows` and
project `.grok/workflows` scripts as Grok slash commands. Selecting one
sends that text as a prompt. Project scripts override user scripts of
the same name.
@maslinedwin
feat(grok): project prompt queue onto session state
fdd8765
Grok emits `_x.ai/queue/changed` when prompts wait behind the current
turn. T3 already kept the JSON-RPC path alive but dropped the payload.

Map a length change onto session.state.changed and thread metadata so
the existing session surface can show that work is queued, without a
third queue UI.
macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 22, 2026
View reviewed changes

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

One finding: adding grok to PROVIDER_ORDER makes the hardcoded colSpan={5} in the Usage cost breakdown table's empty row short by one column. Details inline.

Posted via Macroscope — UI Consistency

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/web/src/components/usage/usageProviders.ts
Comment on lines +27 to +31
grok: {
label: "Grok Build",
color: "#8884d8",
mark: GrokIcon,
},

@macroscopeapp macroscopeapp Bot Aug 22, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Adding a third provider here widens every PROVIDER_ORDER-driven table, but the cost breakdown's empty row in UsagePage.tsx still hardcodes its span:

// apps/web/src/components/usage/UsagePage.tsx:393
<td colSpan={5} className="py-6 text-center text-muted-foreground">
  No activity in this window.
</td>

That header row is now Day + 3 providers + Total + Tokens = 6 columns, so the "No activity in this window." cell no longer spans the table and its centered text is offset by the leftover cell. Consider deriving the span from the order so it stays correct as providers are added:

-                            <td colSpan={5} className="py-6 text-center text-muted-foreground">
+                            <td
+                              colSpan={PROVIDER_ORDER.length + 3}
+                              className="py-6 text-center text-muted-foreground"
+                            >

Posted via Macroscope — UI Consistency

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 22, 2026
View reviewed changes
Comment thread apps/server/src/usage/usageTranscripts.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/usage/usageTranscripts.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/usage/usageTranscriptReader.ts
}

if (provider === "grok") {
if (!mightCarryUsage(line, provider)) continue;

@macroscopeapp macroscopeapp Bot Aug 22, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🟡 Medium usage/usageTranscriptReader.ts:134

Camel-case Grok completion events are dropped before parsing, so transcripts with sessionUpdate: "turnCompleted" contribute no usage to the dashboard. parseGrokLine accepts both spellings, but mightCarryUsage only matches turn_completed; include turnCompleted in this prefilter.

Suggested change
if (!mightCarryUsage(line, provider)) continue;
if (!mightCarryUsage(line, provider) && !line.includes("turnCompleted")) continue;
Also found in 1 other location(s)

apps/server/src/usage/UsageService.ts:134

The new Grok reader prefilters with mightCarryUsage before calling parseGrokLine. parseGrokLine explicitly accepts both turn_completed and turnCompleted, but mightCarryUsage only searches for turn_completed; therefore every camel-case turnCompleted transcript record is silently skipped and its usage is omitted from the dashboard.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/usage/usageTranscriptReader.ts around line 134:

Camel-case Grok completion events are dropped before parsing, so transcripts with `sessionUpdate: "turnCompleted"` contribute no usage to the dashboard. `parseGrokLine` accepts both spellings, but `mightCarryUsage` only matches `turn_completed`; include `turnCompleted` in this prefilter.

Also found in 1 other location(s):
- apps/server/src/usage/UsageService.ts:134 -- The new Grok reader prefilters with `mightCarryUsage` before calling `parseGrokLine`. `parseGrokLine` explicitly accepts both `turn_completed` and `turnCompleted`, but `mightCarryUsage` only searches for `turn_completed`; therefore every camel-case `turnCompleted` transcript record is silently skipped and its usage is omitted from the dashboard.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/provider/acp/GrokWorkflowCommands.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/acp/GrokAcpSessionExtras.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 22, 2026
View reviewed changes

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Effect service conventions review of the Grok parity changes. Earlier findings (Date.now() in the tool-update gate, the redundant selectPermissionOptionId wrapper, unbounded rewind detail, and the string-matched auth-failure classifier) are resolved in this head. One new finding on ambient environment access in GrokProvider.ts.

Posted via Macroscope — Effect Service Conventions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/provider/Layers/GrokProvider.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 22, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokProvider.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@maslinedwin
fix(grok): close Macroscope and Bugbot findings
ef5cc54
Usage empty rows still spanned five columns after Grok joined the table.
Transcript parsing dropped nested PromptUsage totals, camelCase
turnCompleted lines, and later turns that shared a session id as the
dedupe key.

Failed Grok turns left lastCompleteCostUsd on the session. Queue updates
before startSession were dropped. Auto-compact never left waiting.
Rewind truncated local turns when Grok had no matching point. Workflow
discovery read ambient HOME/cwd and whole oversized Rhai files.

Derive the cost-table span from PROVIDER_ORDER, parse both usage shapes,
consume cost on every terminal turn, buffer queue/changed until the
session exists, emit running after compact, refuse rewind without a
target, and discover workflows from injected home and project roots
with a bounded read.
cursor[bot]
cursor Bot reviewed Aug 22, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/GrokProvider.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@maslinedwin
fix(grok): include project workflows on the initial snapshot
2ec14f6
The health check scanned project .grok/workflows, but the pending
snapshot did not. Composer /workflow was missing those scripts until
ACP discovery finished.

Pass the same injected project root into the initial snapshot.
cursor[bot]
cursor Bot reviewed Aug 22, 2026
View reviewed changes
Comment thread apps/server/src/provider/Drivers/GrokDriver.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@maslinedwin
fix(grok): satisfy exactOptionalPropertyTypes and usage chart bands
110efe8
Server typecheck failed because optional projectRoot, homeDir, and
usage counts were passed as T | undefined into exact-optional bags.
Allow undefined on those fields and stop comparing workflow events to
a thread usage type they cannot have.

The usage chart test still expected only Codex and Claude bands after
Grok joined PROVIDER_ORDER. Include the zero Grok band.
@maslinedwin maslinedwin changed the title feat(server): Grok Build workflows, usage, effort, rewind — supersedes #6383 feat(grok): Grok Build workflows, usage, rewind — supersedes #6383 Aug 22, 2026
@maslinedwin
Merge branch 'main' into feat/grok-build-parity
4f0eb5d
@maslinedwin

maslinedwin commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

@t3dotgg would love to have Grok more native. could you review this PR please.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 23, 2026
View reviewed changes

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

One Effect-convention issue in the new Grok provider code: filesystem discovery for workflow slash commands is done with imperative sync node:fs behind a plain function, so the dependency never appears in the Effect environment of the provider-snapshot effects that call it. Details inline.

Posted via Macroscope — Effect Service Conventions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/provider/acp/GrokWorkflowCommands.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 23, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/GrokAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/acp/GrokAcpSessionExtras.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@maslinedwin
fix(grok): discover workflow scripts through Effect FileSystem
899ffa2
Macroscope flagged readGrokWorkflowSlashCommands as blocking node:fs
behind a plain function, so snapshot effects never declared the
filesystem they used.

Scan ~/.grok/workflows and project scripts with FileSystem and Path,
and thread that requirement through the initial snapshot and health
check.
cursor[bot]
cursor Bot reviewed Aug 23, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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 2 potential issues.

There are 5 total unresolved issues (including 3 from previous reviews).

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 899ffa2. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/provider/acp/GrokWorkflowCommands.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/acp/GrokWorkflowCommands.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@maslinedwin
fix(grok): keep context max, rewind extras, and compact session honest
af3cc51
Bugbot: a model-map miss wrote undefined into ctx.maxTokens and dropped
the context ceiling. Rewind only trimmed turns, so usage, cost, queue,
workflow, and tool gates stayed pre-undo. Compact complete always
emitted session running, even with no live turn.

Assign maxTokens only when the map has a number. After a successful
rewind, clear those derived fields. Compact complete is ready unless a
prompt is in flight or the session is already running.
macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 23, 2026
View reviewed changes

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

One finding: the Grok driver reads the project root from the process.cwd() module global instead of the ServerConfig service that is already declared in GrokDriverEnv.

Posted via Macroscope — Effect Service Conventions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/provider/Drivers/GrokDriver.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

maslinedwin added 2 commits August 23, 2026 15:06
@maslinedwin
fix(grok): bound workflow reads and resolve home without HOME
56d7255
Bugbot: Effect discovery loaded whole .rhai files then sliced, and
skipped ~/.grok/workflows unless HOME was set. Windows uses
USERPROFILE. GrokDriver still took project scripts from process.cwd()
even though ServerConfig was already in its environment.

Read only the 64 KiB prefix through FileSystem.open/readAlloc. Resolve
the user workflow directory from HOME or USERPROFILE. Discover project
scripts from ServerConfig.cwd.
@maslinedwin
fix(grok): provide FileSystem to snapshot effects and decode utf-8
1a3608f
Check failed: initialSnapshot and checkProvider still required
FileSystem and Path after workflow discovery moved onto Effect, and
TextDecoder rejected the 'utf8' label.

Provide those services the same way Claude does. Decode the capped
prefix with the default utf-8 decoder.
macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 23, 2026
View reviewed changes
Comment thread apps/server/src/provider/acp/GrokWorkflowCommands.ts
continue;
}
const command = grokWorkflowSlashCommandFromMeta(meta);
byName.set(command.name, command);

@macroscopeapp macroscopeapp Bot Aug 23, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🟡 Medium acp/GrokWorkflowCommands.ts:109

A discovered script can replace a built-in command, so a valid pause.rhai causes the advertised workflow pause command to launch the script instead of pausing the active run. byName already contains the built-ins before scripts are read, but this unconditional set overwrites them; preserve reserved built-in names while continuing to allow project scripts to override user scripts.

-    byName.set(command.name, command);
+    if (!GROK_WORKFLOW_CONTROL_COMMANDS.some(({ name }) => name === command.name)) {
+      byName.set(command.name, command);
+    }
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/provider/acp/GrokWorkflowCommands.ts around line 109:

A discovered script can replace a built-in command, so a valid `pause.rhai` causes the advertised `workflow pause` command to launch the script instead of pausing the active run. `byName` already contains the built-ins before scripts are read, but this unconditional `set` overwrites them; preserve reserved built-in names while continuing to allow project scripts to override user scripts.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@t3dotgg

t3dotgg commented Aug 23, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

Closing this PR after an automated pass over open pull requests. Bundles several Grok product features that overlap existing and trusted provider work.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t3dotgg t3dotgg closed this Aug 23, 2026
This was referenced Aug 27, 2026
[Bug]: Grok model switching is blocked after a thread starts even though ACP supports it #8385
Closed
fix(grok): allow model changes in existing threads #8392
Merged
@Sma-Das Sma-Das mentioned this pull request Sep 5, 2026
[Bug]: Grok subagents do not show correctly in the Agents panel #9892
Closed
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@maslinedwin @t3dotgg
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.