Skip to content

fix(studio): use shell mode for spawn on Windows#1025

Merged
christso merged 2 commits intomainfrom
fix/1024-spawn-error
Apr 9, 2026
Merged

fix(studio): use shell mode for spawn on Windows#1025
christso merged 2 commits intomainfrom
fix/1024-spawn-error

Conversation

@christso
Copy link
Copy Markdown
Collaborator

@christso christso commented Apr 9, 2026

Summary

  • Adds shell: process.platform === 'win32' to both spawn() calls in eval-runner.ts (global and benchmark-scoped routes)
  • On Windows, spawn() cannot execute .cmd/.bat wrappers (e.g. npm-installed agentv.cmd) without shell: true, causing ENOENT errors when clicking "Re-run with Filters" in Studio
  • Consistent with the existing pattern in self/index.ts which already uses shell: true
  • Fixes 3 pre-existing Windows path separator bugs in test files

Test plan

  • Build passes (bun run build)
  • Typecheck passes (bun run typecheck)
  • All unit tests pass (1474 core + 431 CLI, 0 failures)
  • Pre-push hooks pass (build, typecheck, lint, test, validate)
  • RED/GREEN e2e verified:
    • RED: spawn('agentv', ['--version'])ENOENT (exit code -4058) without shell: true
    • GREEN: spawn('agentv', ['--version'], { shell: true })4.12.0 (exit code 0)
    • Studio API on fix branch successfully spawns child process (no ENOENT)

Closes #1024

🤖 Generated with Claude Code

On Windows, Node's spawn() cannot execute .cmd/.bat wrappers (e.g.
npm-installed agentv.cmd) without shell:true, causing ENOENT errors
when clicking "Re-run with Filters" in Studio.

Closes #1024

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 9, 2026

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: 289014b
Status: ✅  Deploy successful!
Preview URL: https://46cfafb8.agentv.pages.dev
Branch Preview URL: https://fix-1024-spawn-error.agentv.pages.dev

View logs

- content-preprocessor.test.ts: double-escape backslash in inline script
  regex so split() handles Windows paths
- llm-grader-multimodal.test.ts: same fix for spreadsheet preprocessor test
- evaluator-parser.test.ts: use [/\] in regex to match both path separators

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@christso christso force-pushed the fix/1024-spawn-error branch from 3798254 to 289014b Compare April 9, 2026 10:18
@christso christso marked this pull request as ready for review April 9, 2026 10:19
@christso christso merged commit 63b45f6 into main Apr 9, 2026
4 checks passed
@christso christso deleted the fix/1024-spawn-error branch April 9, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: spawn error in studio when re-run evals

1 participant