fix(grok): Grok updates actually install on npm 12#24246

open2
main
GitHub fork: fix/grok-npm12-update
opened5d agobyIishaanko
View on GitHubTwo-way sync enabledPR last imported 2d ago

Problem

With npm 12, updating an npm-installed Grok through its provider card exits successfully but leaves the old executable running. Grok's nested npm install skips the postinstall script that installs the new binary, so T3 still reports an outdated provider.

Change

Pass npm_config_allow_scripts=@xai-official/grok in the existing grok update action's environment so its nested global npm install runs the package's postinstall. Preserve the instance environment and existing Homebrew cask handling.

Scope and approval

Fixes https://github.com/pingdotgg/t3code/issues/24249

GitCafe: #24249

Triaged bug via the automated issue flow. This restores the existing provider update operation without adding a setting or capability.

Verification

  • vp test run packages/provider-grok/src/server/driver.test.ts: 4 passed. With the implementation reverted and the new assertion retained: 1 failed, 3 passed, because the npm update action lacked the allowlist. Red output, green output, test rebuild driver.
  • Real Linux runtime, Node 24.22.1 and npm 12.2.0, isolated npm prefix and GROK_HOME: current main at d53873b6 reproduced the provider-card failure. npm reached 1.0.70 while the executable stayed at 1.0.56. Applying this PR's two-file diff to that main commit and clicking the same instance's Update now advanced both to 1.0.70; T3 refreshed to v1.0.70 and cleared the update indicator. The real Grok installation was unchanged. App runtime transcript.
  • Independent real-binary CLI baseline and allowlist control: runtime transcript, exact reproduction driver.
  • Server-only change; visual fixture matrix is empty. The following captures illustrate the runtime result; no client rendering code changed.
Before: main, remains outdatedAfter: PR diff applied to main, v1.0.70
Before: Grok remains outdated after updatingAfter: Grok reports v1.0.70 and no update indicator

Not independently verified: Windows, macOS desktop shell, and npm versions older than 12. The reporter supplied macOS failure evidence; the fix was verified on Linux through the shared provider maintenance path.

Implementation: Claude Opus 5.5 in Claude Code. Automated triage, independent review, and runtime proof: Claude Opus 5.5 and GPT-6.1 Sol through T3 Code's Claude and Codex harnesses.

Checks

21 successful · 7 skipped
All checks passed
4f45741

Added 1 commit

  • fix(grok): npm-installed Grok updates install the new binary on npm 120716eac
Synced from GitHub

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code Review⚠️ Failed 2026-10-23T22:39:25.306078Z
We couldn’t complete this review. Comment @codex review to try again.
0716eacPR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Synced from GitHub

Approvability

Verdict: Approved at 0716eac

Macroscope's review found this PR approvable — This narrowly scoped fix updates Grok's existing maintenance command so npm 12 runs the package postinstall that installs the refreshed binary. The change is package-specific, preserves the Homebrew path, and includes a focused test assertion.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review.

External image Recent review info
External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between 0716eac3666daa5643213088315b57b981b89c81 and 4f4574175ee21a4ac1a0a726c5d2e464b4373e38.

External image Files selected for processing: 1
  • packages/provider-grok/src/server/driver.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

Non-cask Grok updates now set npm_config_allow_scripts to @xai-official/grok. The test expectation includes this environment setting, and a maintenance comment describes npm’s postinstall behavior.

Changes: Grok update behavior

Layer / File(s)Summary
Allow Grok postinstall during updates
packages/provider-grok/src/server/driver.ts, packages/provider-grok/src/server/driver.test.ts
Non-cask updates add npm_config_allow_scripts for @xai-official/grok to the update environment. A comment describes npm’s postinstall behavior, and the test expects the setting.

Priority: External image Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested labels: size:S

Suggested reviewers: juliusmarminge, mnigos

Merge Risk: External image Minimal · up to 4f457

The change aligns the Grok update environment with the stated npm 12 fix and is mergeable.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title clearly identifies the Grok update fix and the npm 12 compatibility issue. It is concise, specific, and uses conventional commit wording.
Description checkPassedThe description includes all required sections: Problem, Change, Scope and approval, and Verification. It explains the failure, the implementation, linked issue approval, focused test results, runtime…
Linked Issues checkPassedIssue #24249 requires the provider-card grok update path to allow @xai-official/grok scripts under npm 12. driver.ts now sets npm_config_allow_scripts to @xai-official/grok and spreads `cont…
Out of Scope Changes checkPassedThe diff changes only the Grok update environment and its focused test. The comment documents the npm 12 failure mode. These changes directly support issue #24249 and do not add unrelated settings, ca…
Full details: Description check

Explanation

The description includes all required sections: Problem, Change, Scope and approval, and Verification. It explains the failure, the implementation, linked issue approval, focused test results, runtime verification, limitations, and agent usage.

Full details: Linked Issues check

Explanation

Issue #24249 requires the provider-card grok update path to allow @xai-official/grok scripts under npm 12. driver.ts now sets npm_config_allow_scripts to @xai-official/grok and spreads context.env, so the nested postinstall can install the new binary while the instance environment remains present. The existing Homebrew cask branch is unchanged. driver.test.ts verifies the allowlist in the update action environment.

Full details: Out of Scope Changes check

Explanation

The diff changes only the Grok update environment and its focused test. The comment documents the npm 12 failure mode. These changes directly support issue #24249 and do not add unrelated settings, capabilities, or provider behavior.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Added 1 commit

  • Merge remote-tracking branch 'origin/main' into fix/grok-npm12-update4f45741