Skip to content

fix: resolve agent-browser via module resolution (fixes #15) - #19

Merged
queso merged 1 commit into
mainfrom
fix/agent-browser-resolution
Aug 21, 2026
Merged

fix: resolve agent-browser via module resolution (fixes #15)#19
queso merged 1 commit into
mainfrom
fix/agent-browser-resolution

Conversation

@queso

@queso queso commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Fixes #15 — flowspec hardcoded <flowspec>/node_modules/.bin/agent-browser, which only exists under nested installs (pnpm, or flowspec's own repo). Under bun/npm hoisting the binary lives at the consumer root, the hardcoded path points at nothing, and every flow fails at step 0 with "Browser command failed." The old comment promised an npx fallback that was never implemented.

getAgentBrowserPath now resolves through createRequire(import.meta.url):

  1. .bin shim beside the resolved package (identical spawn semantics to before),
  2. the package's own bin script,
  3. bare agent-browser for PATH lookup (the fallback the old comment promised).

Works for nested, hoisted, and workspace layouts. Regression tests cover all three paths plus the real install in this repo (4 new tests; full suite 475 pass / 0 fail).

Note for release flow: once #18's semantic-release lands, merging this fix: commit auto-cuts v0.2.0 carrying the August headers/setup/CLI-adapter features to npm — unblocking bun-installed consumers (TheAITeam/test-harness) and the arcanelayer-store monitoring lanes (queso/arcanelayer-store#35).

🤖 Generated with Claude Code

https://claude.ai/code/session_01GtAjJabU9hUkrzoWF3Xtzm

…ted path

flowspec looked for its agent-browser binary only at
<flowspec>/node_modules/.bin/agent-browser — a layout that exists under
nested installs (pnpm, flowspec's own repo) but not under hoisting package
managers (bun, npm), where the binary is hoisted to the consumer root. The
comment promised an npx fallback that was never implemented, so as an
installed dependency every flow died at step 0 with 'Browser command
failed'.

getAgentBrowserPath now resolves agent-browser through createRequire from
this module's URL — correct for nested, hoisted, and workspace layouts —
preferring the .bin shim beside the resolved package, then the package's
own bin script, then bare 'agent-browser' for PATH lookup.

Fixes #15

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GtAjJabU9hUkrzoWF3Xtzm

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick review — approve

This change updates the core execution logic in src/runner.ts and introduces a new test suite to cover the modifications. The additions provide direct test coverage for the new behavior without introducing any apparent risks. The code is clean and ready to merge.

0 inline comment(s).

Verdict was approve, posted as a comment — this repo does not allow GitHub Actions to approve PRs.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@queso, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 16 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 516ffe82-5b95-4900-8d51-a667720f5b58

📥 Commits

Reviewing files that changed from the base of the PR and between d304c12 and f374387.

📒 Files selected for processing (2)
  • src/runner.ts
  • test/agent-browser-resolution.test.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@queso
queso merged commit e44fba2 into main Aug 21, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@queso
queso deleted the fix/agent-browser-resolution branch August 22, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent-browser binary resolution fails under hoisted installs (bun/npm) — flows cannot run at all when flowspec is a dependency

1 participant