fix(grok): add skills, plan mode, usage, and turn reliability - #118
Merged
Conversation
Co-authored-by: Dara Adedeji <daraadedeji07@gmail.com> Co-authored-by: Ahmed Besic <ahmed-besic@users.noreply.github.com> Co-authored-by: Michael Brown <michaeltbrown.mtb@gmail.com> Co-authored-by: Lars Nieuwenhuis <35393046+lnieuwenhuis@users.noreply.github.com> Co-authored-by: Guilherme Barros <gbarros1095@gmail.com> Co-authored-by: PC <pc@localhost> Co-authored-by: 1xpixi <157762409+1xpixi@users.noreply.github.com> (cherry picked from commit ead4ce52a1624d9c55461f61524580978fc8b719)
Pylon's ProviderApprovalDecision union carries `acceptAlways` in addition to upstream's decisions, and every Pylon adapter treats it as at least session-wide (see `acpPermissionOutcome`). Upstream's rewrite of `selectGrokPermissionOptionId` in pingdotgg/t3code#8358 only knows the four upstream literals, so two of its new code paths skipped `acceptAlways`: - The allow_once fallback for a Grok build that omits allow_always. Returning undefined reaches the permission handler as outcome "cancelled", so picking "Always allow" would have rejected the very call the user approved. - Registration in `sessionApprovedOperations`, so a repeat of the same operation would have prompted again.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
This was referenced Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Grok is Pylon's weakest provider today: no skill discovery, no reasoning control, no plan mode, no usage data, and turns that can sit on Working after the ACP connection stops responding. This adopts upstream
#8358(ead4ce52a) to fix all of that, and grafts back a Pylon decision the port would have silently reverted.What the port brings
Grok skill discovery via
grok inspect --json; an ACP-driven Reasoning control beside the model picker; plan mode that surfacesplan.mdwrites and_x.ai/exit_plan_modeas proposed-plan events while unblocking the native approval gate; a turn liveness watchdog that fails a turn after long silence instead of hanging on Working; xAIrate_limitcompletions mapped to usage limits; session-scoped auto-approval keyed by operation identity; and CLI argv that mirror Pylon's runtime permission modes. Web and mobile usage charts gain a Grok band.Pylon adaptations
acceptAlwayswould have started rejecting approvals (second commit, kept separate so the port can be diffed against upstream). Pylon'sProviderApprovalDecisionunion carriesacceptAlwayson top of upstream's four literals, and every Pylon adapter treats it as at least session-wide — seeacpPermissionOutcome. Upstream's rewrite ofselectGrokPermissionOptionIdonly knows the upstream literals, so two of its new paths skipped it:allow_oncefallback for Grok builds that omitallow_always. Returningundefinedreaches the permission handler as outcome"cancelled", so choosing Always allow would have rejected the call the user just approved.sessionApprovedOperations, so repeating the same operation would have prompted again.Both now cover
acceptAlways, with a focused test.Four conflicts, resolved Pylon-first.
GrokAdapter.ts(theacceptAlwaysmapping above, plus upstream'spreferredKindrename), and branding inUsageService.ts,packages/contracts/src/usage.ts, anddocs/user/install.md— each took upstream's substance (Grok transcript paths, the new Reasoning paragraph) in Pylon voice.docs/user/permission-modes.mdauto-merged with Pylon's Prime Agent section intact. Seven further T3 references in comments and test names were rewritten; thet3-*ACPclientInfoidentifiers were left alone, since those are Pylon's established compatibility names across Cursor, Grok, and text generation.Blast radius
The shared ACP changes are not Grok-only.
decideToolCallUpdateEmissionnow also emits on status change and measurescontent/rawOutputlength rather than justdetail, and tool output bounding was reworked — that layer is shared by Cursor, Grok, and Prime Agent. Expect somewhat more websocket traffic per in-progress tool call in exchange for live command output that previously stalled until the call completed. Cursor and Prime Agent suites are in the verification below for that reason.Verification
acceptAlwaystest is confirmed executing, alongside upstream'skeeps a Grok turn running when Always allow has no allow_always optionandasks before a different command after Always allow this session.t3,@t3tools/web,@t3tools/contracts,@t3tools/shared(4/4 tasks ran) and@t3tools/mobile(0 errors).Not run: upstream's opt-in real-Grok CLI verification, which needs xAI credentials. The turn watchdog and rate-limit mapping are therefore covered by tests and the mock ACP agent, not by a live Grok session.
Model: Claude Opus 5. Harness: Claude Code.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.