Bug: pi-fff fails to load in omp (Oh My Pi) — Bun-compiled pi runtime misdetected as "bun"
Summary
@ff-labs/pi-fff (the pi extension behind fffind/ffgrep) fails to load inside omp (Oh My Pi), a coding harness that embeds @earendil-works/pi-coding-agent compiled into a single Bun binary. Every fffind/ffgrep call errors with:
ResolveMessage: Cannot find module '@ff-labs/fff-bun' from '~/.omp/plugins/node_modules/@ff-labs/pi-fff/src/sdk.ts?mtime=...'
The module is installed and complete — it just cannot be resolved at runtime.
Environment
- omp (Oh My Pi), plugin installed via its
~/.omp/plugins mechanism (bun.lock, @ff-labs/pi-fff@0.10.3)
- Linux x64, glibc
- Plugin dir:
~/.omp/plugins/node_modules/@ff-labs/{pi-fff,fff-bun,fff-node,fff-bin-linux-x64-gnu} — all present, freshly installed
Root cause analysis
pi-fff/src/sdk.ts chooses the SDK at runtime:
function detectRuntime(): "bun" | "node" {
if (typeof (globalThis as { Bun?: unknown }).Bun !== "undefined") return "bun";
if (typeof process !== "undefined" && (process as { versions?: { bun?: string } }).versions?.bun) return "bun";
return "node";
}
// const pkg = detectRuntime() === "bun" ? "@ff-labs/fff-bun" : "@ff-labs/fff-node";
omp is a Bun-compiled standalone binary (its logs show the embedded fs: /$bunfs/root/packages/coding-agent/src/cli.js), so globalThis.Bun exists. detectRuntime() therefore returns "bun" and the extension dynamically imports @ff-labs/fff-bun, whose entry is TypeScript source:
// @ff-labs/fff-bun/package.json
"main": "src/index.ts",
"exports": { ".": { "import": "./src/index.ts", "types": "./src/index.ts" } }
omp's module resolver (Node semantics, error type ResolveMessage) cannot load .ts files under node_modules — the same failure Node 24 reports as Stripping types is currently unsupported for files under node_modules. The import fails, reported as Cannot find module.
The JS-compiled sibling @ff-labs/fff-node (main: dist/src/index.js) would work fine, but it is never selected because the runtime is misdetected as bun.
Evidence
bun -e "import('@ff-labs/fff-bun')" from the plugins dir: succeeds (plain Bun handles TS fine)
node -e "import('@ff-labs/fff-bun')": fails with Stripping types is currently unsupported for files under node_modules — the package is found, the entry type is the problem
- Restarting omp does not help (structural, not a stale-cache issue)
- omp's own log shows the same resolver limitation for another external package:
ResolveMessage: Cannot find module 'fastembed/package.json' from '/$bunfs/root/packages/coding-agent/src/cli.js'
- Native pi (
@earendil-works/pi-coding-agent, engines node >= 22.19.0) has no globalThis.Bun, detects "node", uses fff-node — works fine. This is specific to Bun-compiled hosts of pi.
Suggested fixes (any would unblock)
- Publish a compiled-JS entry for
@ff-labs/fff-bun (or point main at a dist/ build) — most robust, mirrors fff-node.
- Make
detectRuntime() probe actual loading capability instead of globalThis.Bun (e.g. try importing the JS build first, or check process.versions.bun only — note a Bun-compiled binary does set process.versions.bun too, so neither global probe is reliable here; an env-var override or capability probe is needed).
- Expose an override (env var like
FFF_SDK=node) so Bun-compiled hosts can force the Node SDK.
Happy to provide more logs or test a fix if useful.
Bug: pi-fff fails to load in omp (Oh My Pi) — Bun-compiled pi runtime misdetected as "bun"
Summary
@ff-labs/pi-fff(the pi extension behind fffind/ffgrep) fails to load inside omp (Oh My Pi), a coding harness that embeds@earendil-works/pi-coding-agentcompiled into a single Bun binary. Everyfffind/ffgrepcall errors with:The module is installed and complete — it just cannot be resolved at runtime.
Environment
~/.omp/pluginsmechanism (bun.lock,@ff-labs/pi-fff@0.10.3)~/.omp/plugins/node_modules/@ff-labs/{pi-fff,fff-bun,fff-node,fff-bin-linux-x64-gnu}— all present, freshly installedRoot cause analysis
pi-fff/src/sdk.tschooses the SDK at runtime:omp is a Bun-compiled standalone binary (its logs show the embedded fs:
/$bunfs/root/packages/coding-agent/src/cli.js), soglobalThis.Bunexists.detectRuntime()therefore returns"bun"and the extension dynamically imports@ff-labs/fff-bun, whose entry is TypeScript source:omp's module resolver (Node semantics, error type
ResolveMessage) cannot load.tsfiles undernode_modules— the same failure Node 24 reports asStripping types is currently unsupported for files under node_modules. The import fails, reported asCannot find module.The JS-compiled sibling
@ff-labs/fff-node(main: dist/src/index.js) would work fine, but it is never selected because the runtime is misdetected as bun.Evidence
bun -e "import('@ff-labs/fff-bun')"from the plugins dir: succeeds (plain Bun handles TS fine)node -e "import('@ff-labs/fff-bun')": fails withStripping types is currently unsupported for files under node_modules— the package is found, the entry type is the problemResolveMessage: Cannot find module 'fastembed/package.json' from '/$bunfs/root/packages/coding-agent/src/cli.js'@earendil-works/pi-coding-agent, enginesnode >= 22.19.0) has noglobalThis.Bun, detects"node", usesfff-node— works fine. This is specific to Bun-compiled hosts of pi.Suggested fixes (any would unblock)
@ff-labs/fff-bun(or pointmainat adist/build) — most robust, mirrorsfff-node.detectRuntime()probe actual loading capability instead ofglobalThis.Bun(e.g. try importing the JS build first, or checkprocess.versions.bunonly — note a Bun-compiled binary does setprocess.versions.buntoo, so neither global probe is reliable here; an env-var override or capability probe is needed).FFF_SDK=node) so Bun-compiled hosts can force the Node SDK.Happy to provide more logs or test a fix if useful.