Skip to content

fix(flows): let the local kit preflight find an installed relayflows - #97

Merged
kjgbot merged 1 commit into
mainfrom
fix/flow-local-preflight-resolve
Sep 18, 2026
Merged

kjgbot merged 1 commit into
mainfrom
fix/flow-local-preflight-resolve

Conversation

@kjgbot

@kjgbot kjgbot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The generated local kit's relay-preflight.mjs blocked every run at START-HERE step 4 with:

Blocked before the flow started: relayflows is not installed in this repository.

even after step 2's npm install --save-dev relayflows@2.0.15 @relayflows/surface@2.0.15 had run. relayflows@2.0.15 publishes only a bin ({"bin":{"flows":"./bin/flows.js"},"type":"module"}, no main, no exports), so createRequire(...).resolve("relayflows") throws MODULE_NOT_FOUND for every real install.

Reproduced in a checkout of AgentWorkforce/relay: preflight failed while npx flows check software-factory.flow.mts passed from the same directory.

Fix

  • web/lib/flow-local.ts: resolve relayflows/package.json, which exists for any install (and is resolvable because the package has no exports map).
  • web/lib/test/flow-local.test.ts: the "passes once step 2 has run" positive control used a fake package with "main": "index.js", which is why it passed while real installs failed. The fake now mirrors the published shape (bin only).

Verification

  • npx vitest run lib/test/flow-local.test.ts: 30/30 pass.
  • With the old resolve("relayflows") restored against the corrected fake, passes the same check once step 2 has run in that repository fails, so the test now catches this.
  • The patched preflight printed Preconditions met. Starting the flow. in the relay checkout.

🤖 Generated with Claude Code


Note

Low Risk
Localized change to local-kit preflight dependency detection and matching tests; no auth, data, or production runtime paths.

Overview
Fixes a false relayflows is not installed block in the local kit preflight after a real npm install of relayflows@2.0.15.

The generated relay-preflight.mjs now checks install presence with createRequire(...).resolve("relayflows/package.json") instead of resolve("relayflows"), because the published package is CLI-only (bin, no main/exports) and the bare name never resolves.

Tests were updated so the fake node_modules/relayflows matches that published shape (bin entry only, no fake main), and the positive preflight test asserts the new resolve string so the suite would catch regressions.

Reviewed by Cursor Bugbot for commit abbbf43. Bugbot is set up for automated code reviews on this repo. Configure here.

relayflows@2.0.15 publishes only a bin (no "main", no "exports"), so the
preflight's bare resolve("relayflows") threw MODULE_NOT_FOUND even after
step 2's install, blocking every local run with "relayflows is not
installed in this repository". Resolve relayflows/package.json instead,
which exists for any install.

The positive-control test passed only because its fake package declared
a "main" the real one does not; it now mirrors the published shape, and
fails against the old check.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c062abe7-1734-4a76-bad3-dab8eab21250


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.

@github-actions

Copy link
Copy Markdown
Contributor

Preview deployed!

Environment URL
Web https://cdf3382c-agentrelay-web.agent-workforce.workers.dev

This is a Cloudflare Workers preview version of this PR's build.

@kjgbot
kjgbot merged commit a09d7ed into main Sep 18, 2026
5 checks passed
@kjgbot
kjgbot deleted the fix/flow-local-preflight-resolve branch September 18, 2026 15:03
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.

1 participant