fix(pi-fff): install fff-bun so bun runtimes can load the SDK (#689) - #694
Conversation
PR #669 made sdk.ts dynamically import @ff-labs/fff-bun when running under bun, but only added it as an optional peer dependency. Package managers do not install optional peers by default, so `pi install npm:@ff-labs/pi-fff` on a bun-only host produced a node_modules tree without @ff-labs/fff-bun and pi crashed at session_start with "Cannot find module '@ff-labs/fff-bun'". Promote both SDKs to regular deps. Bundle size cost is minor (SDKs are TS shims over the same optional native bins) and this guarantees the dynamic import in sdk.ts always resolves regardless of runtime or installer. Closes #689
|
@gustav-fff why it is failed? |
|
[triage-bot] CI status: 32 checks green, Honk-Honk 🪿 |
|
[triage-bot] DIRECTED: Flaky watcher race, unrelated to this PR. Attempt 2 passed and all checks are now green ( Failing test on attempt 1: Race in the test itself: Honk-Honk 🪿 |
Upstream 0.10.1 batch (5 commits): pi-fff fixes (install fff-bun dmtrKovalenko#689/dmtrKovalenko#694, Windows cross-volume paths dmtrKovalenko#684), node/bun Android arm64 Termux support (dmtrKovalenko#695), and the 0.10.1 release/version bumps. No Rust source changes reach the fork — all JS-SDK/packaging/CI. Conflicts (config only, no code): - All crate Cargo.toml + workspace: take ours (fork stays 0.17.1; upstream's 0.10.1 is its own release line). fff-mcp keeps daemon deps (fff-ipc/dirs/libc). - install-mcp.sh: ours (fork installs from HEAD/source, not upstream release-pin). - release.yaml: ours — keep the Android C-FFI matrix entry commented, consistent with the fork's policy of disabling non-macOS C builds to keep CI lean. - Cargo.lock: ours (workspace unchanged vs f5db5c1). Daemon rust verified intact (server.rs proxy path present); build-daemon green.
Closes #689
Root cause
PR #669 (commit d1dac82) added a runtime bun/node switch in
packages/pi-fff/src/sdk.ts:26that dynamically imports@ff-labs/fff-bunwhen running under bun. The same PR declared@ff-labs/fff-bunas an optional peer dependency inpackages/pi-fff/package.json:48-55. Package managers do not install optional peers by default, sopi install npm:@ff-labs/pi-fffon a bun-only host produces anode_modulestree containing@ff-labs/fff-nodebut not@ff-labs/fff-bun, and pi crashes atsession_startwithCannot find module '@ff-labs/fff-bun'.Fix
Promote
@ff-labs/fff-bunfrom optional peer to a regular dependency alongside@ff-labs/fff-nodeinpackages/pi-fff/package.json. Bundle-size cost is minor — both SDKs are thin TS shims over the same optional native@ff-labs/fff-bin-*binaries — and this guarantees the dynamic import insdk.tsalways resolves regardless of runtime or which installer pi uses.bun.lockregenerated accordingly.Steps to reproduce
Reproduce on
origin/main(pre-fix) on any host with bun and no global node:Expected: pi starts,
session_startsucceeds,ffgrep/fffindtools available.Actual (pre-fix):
Confirmed by three independent reporters (Debian, mise, Windows/scoop) in issue #689, all sharing
bunas the runtime.How verified
Simulated a fresh install of the fixed package into an empty project against a bun-only host:
Also ran:
Automated triage via Gustav. Honk-Honk 🪿