Skip to content

fix(cli): auto-build local sdk workflows runtime#588

Merged
khaliqgant merged 2 commits intomainfrom
fix/global-workflow-resolution-clean
Mar 19, 2026
Merged

fix(cli): auto-build local sdk workflows runtime#588
khaliqgant merged 2 commits intomainfrom
fix/global-workflow-resolution-clean

Conversation

@miyaontherelay
Copy link
Contributor

@miyaontherelay miyaontherelay commented Mar 18, 2026

Summary

Fix agent-relay run <workflow.ts> inside the monorepo when the local linked @agent-relay/sdk package has not been built yet.

Before this change, running a TypeScript workflow script from the repo could fail immediately with a missing module error like:

Cannot find module .../packages/sdk/dist/workflows/index.js

Root cause

Inside the monorepo, node_modules/@agent-relay/sdk resolves to the local workspace package, whose ./workflows export points at:

packages/sdk/dist/workflows/index.js

If packages/sdk had not been built yet, the CLI attempted to execute the workflow script via tsx, but module resolution failed before the workflow could start.

What this PR changes

  • detects when agent-relay run <workflow.ts> is being executed inside the agent-relay monorepo
  • checks whether the local SDK workflows runtime exists at packages/sdk/dist/workflows/index.js
  • if missing, automatically runs:
npm run build:sdk

before invoking tsx / ts-node

Validation

Confirmed that the original module-resolution failure is fixed:

agent-relay run workflows/add-swift-sdk.ts

now gets past the missing @agent-relay/sdk/workflows dist import and launches the workflow.

Note

There is still a separate runtime issue where the specific add-swift-sdk workflow appears to hang after startup (Workflow starting...). That is not addressed by this PR; this PR is only for the global CLI/local-runtime bootstrap fix.


Open with Devin

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Copy link
Member

@khaliqgant khaliqgant left a comment

Choose a reason for hiding this comment

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

Edge case handling. LGTM

@khaliqgant khaliqgant merged commit cc3b43b into main Mar 19, 2026
38 of 39 checks passed
@khaliqgant khaliqgant deleted the fix/global-workflow-resolution-clean branch March 19, 2026 17:12
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.

2 participants