-
Notifications
You must be signed in to change notification settings - Fork 60
fix(build): drop redundant @agent-relay/* tsconfig paths so the compiled CLI keeps workspace exports #1184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
fix(build): drop redundant @agent-relay/* tsconfig paths so the compiled CLI keeps workspace exports #1184
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
.agentworkforce/trajectories/completed/2026-06/traj_d88jruejk2zk/summary.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Trajectory: Fix @agent-relay/fleet exports dropped to undefined in bun --compile standalone binary (local up Fleet local node skipped) | ||
|
|
||
| > **Status:** ✅ Completed | ||
| > **Confidence:** 90% | ||
| > **Started:** June 22, 2026 at 09:44 AM | ||
| > **Completed:** June 22, 2026 at 10:06 AM | ||
|
|
||
| --- | ||
|
|
||
| ## Summary | ||
|
|
||
| Fixed bun-compiled CLI dropping @agent-relay/_ workspace exports to undefined (Fleet local node skipped / 'is not a function' on local up). Root cause: bun & esbuild honor tsconfig paths that map workspace packages to their .d.ts (no runtime exports); paths resolve per nearest tsconfig to the importing file, so transitive imports broke too. Final fix (after a fresh-eyes review pivoted away from an earlier build-script workaround): removed the redundant @agent-relay/_ paths from the root and packages/cli tsconfig.json — they duplicated the npm workspace node_modules symlinks, so tsc still resolves .d.ts (via package exports.types) and bundlers resolve .js (via exports.import). Also reverted the now-obsolete namespace-import workarounds in fleet-sidecar.ts and fleet/src/index.ts to plain named imports. tsc type-checking untouched. Verified: build:core green (0 type errors), built binary, local up starts implicit fleet node with fleet-node.json connected:true + spawn:claude/codex/gemini. | ||
|
|
||
| **Approach:** Standard approach | ||
|
|
||
| --- | ||
|
|
||
| ## Key Decisions | ||
|
|
||
| ### Fix at the bundler layer via empty-paths tsconfig next to the build entry | ||
|
|
||
| - **Chose:** Fix at the bundler layer via empty-paths tsconfig next to the build entry | ||
| - **Reasoning:** Root cause: packages/cli/tsconfig.json paths map @agent-relay/\* to dist/index.d.ts; bun/esbuild honor tsconfig paths and bundle the declaration files (no runtime exports) -> undefined. fleet breaks because it is only ever namespace-imported. Build-script override is surgical and leaves tsc type-checking untouched, vs changing shared root paths. | ||
|
|
||
| --- | ||
|
|
||
| ## Chapters | ||
|
|
||
| ### 1. Work | ||
|
|
||
| _Agent: default_ | ||
|
|
||
| - Fix at the bundler layer via empty-paths tsconfig next to the build entry: Fix at the bundler layer via empty-paths tsconfig next to the build entry | ||
| - Root cause is bun/esbuild honoring tsconfig paths (->.d.ts, no runtime exports) per-importing-file; fix needs empty-paths tsconfig in EVERY bundled package dist, not just the entry, to cover transitive workspace imports. Verified end-to-end: fleet-node.json connected:true with all spawn handlers. |
63 changes: 63 additions & 0 deletions
63
.agentworkforce/trajectories/completed/2026-06/traj_d88jruejk2zk/trajectory.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| { | ||
| "id": "traj_d88jruejk2zk", | ||
| "version": 1, | ||
| "task": { | ||
| "title": "Fix @agent-relay/fleet exports dropped to undefined in bun --compile standalone binary (local up Fleet local node skipped)" | ||
| }, | ||
| "status": "completed", | ||
| "startedAt": "2026-06-22T07:44:17.272Z", | ||
| "completedAt": "2026-06-22T08:06:29.530Z", | ||
| "agents": [ | ||
| { | ||
| "name": "default", | ||
| "role": "lead", | ||
| "joinedAt": "2026-06-22T07:53:58.239Z" | ||
| } | ||
| ], | ||
| "chapters": [ | ||
| { | ||
| "id": "chap_fmr96gta9rp3", | ||
| "title": "Work", | ||
| "agentName": "default", | ||
| "startedAt": "2026-06-22T07:53:58.239Z", | ||
| "endedAt": "2026-06-22T08:06:29.530Z", | ||
| "events": [ | ||
| { | ||
| "ts": 1782114838239, | ||
| "type": "decision", | ||
| "content": "Fix at the bundler layer via empty-paths tsconfig next to the build entry: Fix at the bundler layer via empty-paths tsconfig next to the build entry", | ||
| "raw": { | ||
| "question": "Fix at the bundler layer via empty-paths tsconfig next to the build entry", | ||
| "chosen": "Fix at the bundler layer via empty-paths tsconfig next to the build entry", | ||
| "alternatives": [], | ||
| "reasoning": "Root cause: packages/cli/tsconfig.json paths map @agent-relay/* to dist/index.d.ts; bun/esbuild honor tsconfig paths and bundle the declaration files (no runtime exports) -> undefined. fleet breaks because it is only ever namespace-imported. Build-script override is surgical and leaves tsc type-checking untouched, vs changing shared root paths." | ||
| }, | ||
| "significance": "high" | ||
| }, | ||
| { | ||
| "ts": 1782115588773, | ||
| "type": "reflection", | ||
| "content": "Root cause is bun/esbuild honoring tsconfig paths (->.d.ts, no runtime exports) per-importing-file; fix needs empty-paths tsconfig in EVERY bundled package dist, not just the entry, to cover transitive workspace imports. Verified end-to-end: fleet-node.json connected:true with all spawn handlers.", | ||
| "raw": { | ||
| "confidence": 0.9 | ||
| }, | ||
| "significance": "high", | ||
| "tags": ["confidence:0.9"] | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "retrospective": { | ||
| "summary": "Fixed bun-compiled CLI dropping @agent-relay/* workspace exports to undefined (Fleet local node skipped / 'is not a function' on local up). Root cause: bun & esbuild honor tsconfig paths that map workspace packages to their .d.ts (no runtime exports); paths resolve per nearest tsconfig to the importing file, so transitive imports broke too. Fix: build-bun.sh & build-standalone.sh write an empty-paths tsconfig into every packages/*/dist before bundling, forcing node_modules (.js) resolution. tsc type-checking untouched. Verified: rebuilt core from source, built binary, local up starts implicit fleet node with fleet-node.json connected:true + spawn:claude/codex/gemini.", | ||
| "approach": "Standard approach", | ||
| "confidence": 0.9 | ||
| }, | ||
| "commits": [], | ||
| "filesChanged": [], | ||
| "projectId": "AgentWorkforce/relay", | ||
| "tags": [], | ||
| "_trace": { | ||
| "startRef": "c7380efd69238db002f4cba087cebef593bf9fcd", | ||
| "endRef": "c7380efd69238db002f4cba087cebef593bf9fcd" | ||
| } | ||
| } |
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
CHANGELOG entry includes implementation details; focus on user-visible impact only.
Per coding guidelines for CHANGELOG.md, entries should be "concise and impact-first, with one short bullet per user-visible change. Omit... internal notes, and implementation details."
The current entry includes technical implementation details (tsconfig paths, .d.ts vs. compiled JS, npm workspace symlinks, "no runtime exports") that users don't need to understand. The user-visible change is singular:
local upnow works instead of failing.Suggested revision (concise, impact-first, omits implementation):
🤖 Prompt for AI Agents
Source: Coding guidelines