fix(studio): resolve agentv CLI entry point on Windows#1015
Merged
Conversation
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>
Deploying agentv with
|
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).pathnamereturns/D:/...on Windows (leading slash), producing invalid paths that failexistsSync(). Replaced withfileURLToPath()fromnode:urlwhich handles platform-specific URI→path conversion correctly.agentvis 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 installedagentvcommand viawhere(Windows) /which(Unix).Changes:
new URL(import.meta.url).pathname→fileURLToPath(import.meta.url)for cross-platform path resolutionagentvbinary when monorepo source files aren't found{ bunPath, cliPath }→{ binPath, args[] }to support bothbun cli.ts <args>andagentv <args>invocationsCloses #1013
Test plan
agentv studiofrom a globally installed agentv on Windows, trigger eval run — should succeed instead of 500 erroragentv studiofrom monorepo dev context — should still usebun apps/cli/src/cli.tspath🤖 Generated with Claude Code