fix(client-runtime): highlight Node eval scripts after diagnostic path options #48253
main fromrefs/pull/48253/head·opened View on GitHubProblem#
Node eval scripts appear as shell strings in the expanded work log when a diagnostic path option takes a separate argument. The highlighter mistakes the path for a script file and stops before -e.
Deterministic repro on origin/main (7b6a2c96f646830f10183339c2031141dd2801ca): Have a T3 Code agent run these exact shell commands on Node v24.15.0, then expand the command rows in the thread's work log. For a provider-independent repro, pass each command verbatim to embeddedScripts.
node --diagnostic-dir /tmp -e 'console.log(42)'
node --openssl-config /dev/null -e 'console.log(42)'
node --report-dir /tmp -e 'console.log(42)'
node --report-directory /tmp -e 'console.log(42)'
Observed: Each command prints 42, but embeddedScripts returns [] and the eval operand keeps its shell string color. Expected: One JavaScript script with text console.log(42), and JavaScript token colors in the expanded command.
On Codex, CodexAdapterV2 stores the command as command_execution.input. Wire projection and body deduplication leave the input intact; output buffering is separate, and the fixture is below the detail size limit. The web/Electron inspector passes the input through ShellCommandBlock to HighlightedTokens, and the mobile work-log row passes it through CommandCodeText to highlightCommand. Both paths use embeddedScripts and withEmbeddedScripts, which keeps the shell colors when no embedded scripts are found.
Change#
Add --diagnostic-dir, --openssl-config, --report-dir, and its --report-directory alias to Node's existing value-taking option set. The shared parser fixes web, Electron, and mobile without changing provider, transport, or UI code.
Scope#
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification#
- The focused regression failed on base (
expected [] to deeply equal …) for all four separate-value commands, then passed on head for both separate-value and equals forms. vp run check:changedexited 0: formatting, lint, knip, typecheck, and all 174 tests inembeddedScripts.test.tspassed.- Before/after runtime transcript: real Node prints
42on both revisions; the shared overlay with the web lexer changes the operand from one shell string token to JavaScript tokens. - Not shown: Browser or Electron screenshots, native mobile rendering, and an end-to-end provider turn. The proof exercises the parser and token styles directly.
Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).
- 1
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
1ec2878Macroscope's review found this PR approvable — Recognizes four additional Node options so eval scripts following their path arguments receive JavaScript highlighting. The change affects display parsing only, without changing command execution or product defaults.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review.
Walkthrough
-
The Node option parser now recognizes
--diagnostic-dir,--openssl-config,--report-dir, and--report-directoryas options that consume a following argument. Tests check eval-script extraction when these options use space-separated or equals-separated values.Changes: Node eval-script extraction
Layer / File(s) Summary Recognize value-taking options
packages/client-runtime/src/work-log/embeddedScripts.ts,packages/client-runtime/src/work-log/embeddedScripts.test.tsThe parser adds four options to its value-taking set. Tests check eval-script extraction after each option with space-separated and equals-separated values. Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Suggested reviewers:
only21mil,iamshadmantaqi,aymankhan9
Merge Risk:
Minimal · up to1ec28-
This fixes highlighting of Node eval scripts that follow the diagnostic and report path options. The change is small and covered by focused tests, so merge risk is minimal.
Pre-merge checks:
4-
Check name Status Explanation Title check The title names the actual change: Node eval-script highlighting after diagnostic path options. The raw summary confirms the change adds --diagnostic-dir, --openssl-config, --report-dir, and --report-… Description check The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives a clear reproduction and expected behavior. The Change section explains the sh… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Title check
-
Explanation
The title names the actual change: Node eval-script highlighting after diagnostic path options. The raw summary confirms the change adds --diagnostic-dir, --openssl-config, --report-dir, and --report-directory to Node's value-taking options so -e scripts are detected. It follows the conventional commit form. The title is specific and accurate, though at 78 characters it is slightly long.
Full details: Description check
-
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives a clear reproduction and expected behavior. The Change section explains the shared parser fix. The Scope section justifies the absence of an issue. The Verification section lists focused regression results, the check run, and a runtime transcript, and it states what was not verified. The description is thorough. It does not follow the template's conventional-title guidance exactly, but that is minor. The template's trailing model/harness attribution line is present.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: e3cfabe
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
cc9254b8-683d-48a2-98c8-62d1488892b2
Commits-
Reviewing files that changed from the base of the PR and between e3cfabeaf925390fc951c247932289549f9364f9 and 1ec287810bfc55ecb2b4b536db96254fc89b3cfb.
Files selected for processing: 2-
packages/client-runtime/src/work-log/embeddedScripts.test.tspackages/client-runtime/src/work-log/embeddedScripts.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
-
-
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes