Skip to content

regex_match gates fail in the standalone runtime: Cannot find module 're2js' #457

Closed

Description

@khaliqgant

Found while running tests/authored-node-runtime.test.ts under Bun 1.4.0 for #449 (the suite is skipped on hosts with another Bun, so this went unnoticed).

packages/sdk/src/named-gate-lowering.ts embeds the RE2 engine into the gate command via createRequire(import.meta.url).resolve('re2js'). In the standalone relayflows CLI the authored runner executes from a temp dir where re2js is not resolvable, so every .gate({ type: 'regex_match', … }) fails with Cannot find module 're2js'. The other three named gates are unaffected; #449's Bun test uses word_count_bounds to sidestep it.

Pre-existing on main before #449. Fix options: bundle re2js into the standalone runner, or resolve it relative to the SDK's own dist at lowering time and embed the source (as the code already intends) rather than resolving at execution.

🤖 Generated with Claude Code

Activity

  1. AgentRelayBot commented on Oct 5, 2026

    @AgentRelayBot
    Contributor

    Triage 2026-10-05: VALID — still present on main (3c58ee1). embeddedRE2() (packages/sdk/src/named-gate-lowering.ts:12-15) resolves re2js via createRequire(import.meta.url), which fails inside the standalone authored-node payload built by scripts/build-standalone-cli.mjs:21-27 (inlined and run from a temp dir). The workaround in packages/sdk/tests/authored-node-runtime.test.ts:132 (word_count_bounds instead of regex_match) is still there. Acceptance: bundle or inline re2js into the standalone payload, add a regex_match gate to that runtime test, and have it pass under the standalone build.

  2. added
    garden-readyScoped and ready for an agent to pick up
    and removed
    garden-readyScoped and ready for an agent to pick up
    on Oct 5, 2026
  3. added
    garden-readyScoped and ready for an agent to pick up
    and removed
    garden-readyScoped and ready for an agent to pick up
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    garden-readyScoped and ready for an agent to pick up

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions