What happened?
Installing both @earendil-works/pi-ai and @earendil-works/pi-coding-agent as direct deps puts two identical copies of pi-ai on disk — one hoisted, one nested under pi-coding-agent. Since the API provider registry is a module-level Map, the two copies are separate module instances with separate registries. A provider I register through the hoisted copy is invisible to the agent loop, which imports pi-ai through the nested copy. Stream dispatch then fails with:
No API provider registered for api: <my-api>
and the agent session ends in ~120ms with empty output.
Cause: the published pi-coding-agent tarball ships an npm-shrinkwrap.json whose nested pi-ai entry has no integrity field, so npm won't dedupe it against the hoisted copy even though the bytes are identical.
Steps to reproduce
package.json with both as direct deps, then:
npm install
find node_modules -type d -name pi-ai -path "*@earendil-works*"
# node_modules/@earendil-works/pi-ai
# node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-ai
diff -rq node_modules/@earendil-works/pi-ai \
node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-ai
# no output — the two copies are byte-identical
npm 10.9.8, node 22.22.3.
Expected behavior
One deduped pi-ai, so registerApiProvider and the agent loop share one registry. Fix options: don't ship a published npm-shrinkwrap.json from a library, or give its entries integrity hashes so npm can dedupe. Happy to PR if useful.
Version
0.79.1
What happened?
Installing both
@earendil-works/pi-aiand@earendil-works/pi-coding-agentas direct deps puts two identical copies ofpi-aion disk — one hoisted, one nested underpi-coding-agent. Since the API provider registry is a module-levelMap, the two copies are separate module instances with separate registries. A provider I register through the hoisted copy is invisible to the agent loop, which importspi-aithrough the nested copy. Stream dispatch then fails with:and the agent session ends in ~120ms with empty output.
Cause: the published
pi-coding-agenttarball ships annpm-shrinkwrap.jsonwhose nestedpi-aientry has nointegrityfield, so npm won't dedupe it against the hoisted copy even though the bytes are identical.Steps to reproduce
package.jsonwith both as direct deps, then:npm 10.9.8, node 22.22.3.
Expected behavior
One deduped
pi-ai, soregisterApiProviderand the agent loop share one registry. Fix options: don't ship a publishednpm-shrinkwrap.jsonfrom a library, or give its entries integrity hashes so npm can dedupe. Happy to PR if useful.Version
0.79.1