Repository navigation
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
session-write-hot-path-benchmark.mjs— wrapped 5 computed dynamic-import specifiers inpathToFileURL(...).hrefand importedpathToFileURL.agent-inspection-cadence-batching-benchmark.mjs— wrapped 3 computed dynamic-import specifiers.capture-fish-mode2031-trace.mjs— wrapped its 1 computed dynamic-import specifier.
These fix ERR_UNSUPPORTED_ESM_URL_SCHEME on Windows, where path.join(ROOT, '...ts') starts with C: and the ESM loader reads it as a URL scheme. pathToFileURL is platform-neutral and already the idiom used by sibling benchmarks.
I verified node --check passes on all three files and ran both benchmarks end to end on Linux (Node 24.19) — tables print, exit 0, so the file-URL specifiers still resolve on POSIX. I also spot-checked the completeness claim that these are the only un-wrapped computed import() sites in config/scripts/tests/tools: the rest use data: URLs, new URL(..., import.meta.url).href, or a source() helper that already returns pathToFileURL(...).href. Nothing missed.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
📥 CommitsReviewing files that changed from the base of the PR and between b4d39d1c036d8541689a5345bf72558cb7368e3f and 07fae64. You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📥 CommitsReviewing files that changed from the base of the PR and between 87bc51d and b4d39d1c036d8541689a5345bf72558cb7368e3f. 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe cadence batching benchmark, session write benchmark, and fish-mode trace harness now convert filesystem paths to file URLs before dynamically importing source modules. The benchmarks retain their existing Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The scripts now pass file URLs for the same source modules, addressing Windows path resolution without changing their targets. No merge-blocking risk is evident. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation For
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. Comment |
|
No actionable findings from either reviewer, so there is nothing to change here. Recording what was verified, since the only real risk in this change is a POSIX regression (the failure it fixes is Windows-only, so CI would not have caught it either way). Analysis. The fix replaces the argument handed to Results
Completeness. An AST-level scan of computed
|
`await import(path.join(ROOT, '...ts'))` hands Node a bare Windows path
(`C:\...`), which the ESM loader rejects as an unsupported URL scheme
("Received protocol 'c:'"). The two benchmarks that load production
modules this way crashed on Windows before running a single scenario,
while working on macOS and Linux where an absolute path is a valid
specifier.
Wrap each computed specifier in `pathToFileURL(...).href`, the form the
other benchmark scripts already use for the same purpose.
Verified on Windows: bench:session-write-hot-path and
bench:agent-inspection-cadence now run and print their measurement
tables. The fish mode-2031 trace capture resolves its import too, but its
harness targets macOS/Linux shells and cannot complete on Windows.
Fixes stablyai#25235
b4d39d1 to
07fae64
Compare
|
Rebased onto current Re-ran the script this PR unblocks, on macOS / Node 24, to check that the rebase did not disturb the imports it touches: That is the POSIX path, which already worked — the Windows reproduction in the body is the one that matters and I have no Windows machine to repeat it on. Ready for review whenever there is a slot — @nwparker. |
|
Closing this rather than letting it age. It fixes the benchmark harness on a Windows checkout, not anything a user hits, and I had seven small PRs open here at once — four fewer is a better trade for this repo than seven. #25235 stays open and this change is described in it, so it is still actionable for anyone closer to a Windows setup. Nothing in the diff is wrong; it just should not compete for your review time with the others. |

Author: @paolovalletta_
ELI5
Two of this repo's benchmark scripts hand Node a Windows file path (
C:\...) where Node expects a URL. Node reads theC:as a URL scheme and refuses to load the file, so both scripts crash on Windows before doing any measuring — while working fine on macOS and Linux.What Changed
Before, on Windows:
After, both run and print their tables:
Mechanism. Each script computed its specifier with
path.join(ROOT, '...ts')and passed it straight toimport(). On Windows that value starts withC:, which the ESM loader parses as the schemec:. On macOS and Linux the same value is an absolute POSIX path, which the loader accepts, so the failure was invisible to CI. The specifier is nowpathToFileURL(path.join(...)).href, the form other benchmark scripts in this directory already use for the same job (e.g.renderer-quadratic-scan-benchmark.mjs:65,200).Three files, one line each plus the
node:urlimport:config/scripts/session-write-hot-path-benchmark.mjs— 5 specifiersconfig/scripts/agent-inspection-cadence-batching-benchmark.mjs— 3 specifierstests/tools/fish-mode2031-repro/capture-fish-mode2031-trace.mjs— 1 specifierI scanned
config/scripts,tests/toolsandsrcfor computedimport()specifiers; these three are all of them that are not already wrapped or bare module names.Why
These scripts are how the repo produces evidence for exactly the kind of Windows work tracked in #9300, and Windows performance work cannot cite a benchmark that cannot start.
pathToFileURLis already the established idiom here rather than a new dependency or abstraction, so this is the smallest change that makes the scripts run on all three platforms; the alternative (spawning a shell soC:\...resolves) would change how the scripts are invoked and is not needed.Linked Issue
Fixes #25235
(That issue also covers the
bench:idle-cpuWindows gaps, which are a separate PR.)Visual Proof
N/ANo UI, no user-facing behaviour: only how a benchmark script forms a module specifier.
Testing
No new tests: the fix is one expression per import site, and the scripts themselves are the reproduction — they fail loudly before and print their tables after.
bench:session-write-hot-pathnode config/scripts/session-write-hot-path-benchmark.mjsERR_UNSUPPORTED_ESM_URL_SCHEME; after: table printed, exit 0bench:agent-inspection-cadencenode config/scripts/agent-inspection-cadence-batching-benchmark.mjsnode tests/tools/fish-mode2031-repro/capture-fish-mode2031-trace.mjsfishpath is macOS-only — see Limitations)node node_modules/oxlint/bin/oxlint <3 files>node config/scripts/check-changed-code-quality.mjsPlatforms tested: Windows only, which is the platform that failed. The change is platform-neutral (
pathToFileURLyieldsfile:///…everywhere) and macOS/Linux already worked, so no regression is expected there; I did not run them.AI Disclosure
Written with an AI coding agent, session model
deepseek-v4.1-flash(provideropencode-go). All commands and outputs above were produced on this machine.Review
process.platformbranching added.pathToFileURLonly converts a path that was already being imported.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
/opt/homebrew/bin/fish), so on Windows I could only verify that its import now resolves; it still cannot complete there for unrelated reasons.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass — lint on changed files and the changed-code gate pass;typecheck/test/buildare unrelated to these scripts and could not run end to end here (no MSVC); CI will cover