Skip to content

fix(studio): resolve agentv CLI entry point on Windows#1015

Merged
christso merged 1 commit intomainfrom
fix/1013-studio-cli-entry-point
Apr 9, 2026
Merged

fix(studio): resolve agentv CLI entry point on Windows#1015
christso merged 1 commit intomainfrom
fix/1013-studio-cli-entry-point

Conversation

@christso
Copy link
Copy Markdown
Collaborator

@christso christso commented Apr 9, 2026

Summary

Fixes the "Cannot locate agentv CLI entry point" error when running evals from AgentV Studio on Windows.

Root causes:

  • new URL(import.meta.url).pathname returns /D:/... on Windows (leading slash), producing invalid paths that fail existsSync(). Replaced with fileURLToPath() from node:url which handles platform-specific URI→path conversion correctly.
  • When agentv is installed globally via npm/bun (not running from monorepo source), the function only looked for monorepo source files and had no fallback. Added detection of the globally installed agentv command via where (Windows) / which (Unix).

Changes:

  • Replaced new URL(import.meta.url).pathnamefileURLToPath(import.meta.url) for cross-platform path resolution
  • Added fallback to globally installed agentv binary when monorepo source files aren't found
  • Refactored return type from { bunPath, cliPath }{ binPath, args[] } to support both bun cli.ts <args> and agentv <args> invocations

Closes #1013

Test plan

  • Run agentv studio from a globally installed agentv on Windows, trigger eval run — should succeed instead of 500 error
  • Run agentv studio from monorepo dev context — should still use bun apps/cli/src/cli.ts path
  • Build + typecheck pass (verified locally)

Note: 3 pre-existing test failures on main (Windows path separator issues in content-preprocessor, llm-grader-multimodal, and evaluator-parser tests) are unrelated to this change.

🤖 Generated with Claude Code

Two issues prevented Studio from launching evals on Windows:

1. `new URL(import.meta.url).pathname` returns `/D:/...` on Windows,
   producing invalid paths. Replaced with `fileURLToPath()` which
   handles platform-specific URI-to-path conversion correctly.

2. When agentv is installed globally (npm/bun), the monorepo source
   files don't exist. Added a fallback that detects the globally
   installed `agentv` command via `where`/`which`.

Closes #1013

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

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: 082683d
Status: ✅  Deploy successful!
Preview URL: https://91ddbba9.agentv.pages.dev
Branch Preview URL: https://fix-1013-studio-cli-entry-po.agentv.pages.dev

View logs

@christso christso marked this pull request as ready for review April 9, 2026 08:20
@christso christso merged commit c8dd3ad into main Apr 9, 2026
4 checks passed
@christso christso deleted the fix/1013-studio-cli-entry-point branch April 9, 2026 08:20
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: cannot locate agentv cli entry point in AgentV Studio

1 participant