Skip to content

fix(package): ship harnesses/pi/bundle so npm installs get the pi workers - #362

Open
efenocchi wants to merge 2 commits into
mainfrom
fix/ship-pi-workers
Open

efenocchi wants to merge 2 commits into
mainfrom
fix/ship-pi-workers

Conversation

@efenocchi

@efenocchi efenocchi commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Problem

src/cli/install-pi.ts installs the pi workers (wiki, skillify, autopull, skillopt, notifications) from harnesses/pi/bundle, guarded by existsSync. That directory has never been in package.json files, so every published release installed the pi extension with no workers and no error. Found while verifying the published 0.7.159 against a copy of a stale pi install: skilify-worker.js (pre-#116 name) was not pruned because the package shipped nothing to sync from.

$ ls node_modules/@deeplake/hivemind/harnesses/pi/       # 0.7.159 from npm
extension-source

Fix

Add harnesses/pi/bundle to files. New test tests/cli/package-files.test.ts extracts every join(pkgRoot(), ...) payload path from the installers and asserts each is covered by files; it fails on main (× harnesses/pi/bundle is shipped) and passes here.

Verification

npm run build && npm pack, tarball installed into a temp dir, then its CLI run over an isolated HOME seeded with the stale pi dir (real HOME untouched):

$ tar tzf deeplake-hivemind-0.7.159.tgz | grep harnesses/pi/
package/harnesses/pi/bundle/autopull-worker.js
package/harnesses/pi/bundle/notifications-worker.js
package/harnesses/pi/bundle/skillify-worker.js
package/harnesses/pi/bundle/skillopt-worker.js
package/harnesses/pi/bundle/wiki-worker.js
package/harnesses/pi/bundle/package.json
package/harnesses/pi/extension-source/hivemind.ts

== BEFORE pi: autopull-worker.js notifications-worker.js skilify-worker.js skillify-worker.js skillopt-worker.js wiki-worker.js
  pi             removed stale $FH/.pi/agent/hivemind/skilify-worker.js
  pi             workers installed -> $FH/.pi/agent/hivemind
== AFTER pi:  autopull-worker.js notifications-worker.js package.json skillify-worker.js skillopt-worker.js wiki-worker.js

npx tsc --noEmit clean; tests/cli/package-files.test.ts 13/13.

Summary by CodeRabbit

  • New Features

    • Pi harness bundle files are now included in published packages.
  • Tests

    • Added validation to ensure installer payloads, including Codex, Hermes, Pi, OpenClaw, and MCP assets, are packaged correctly.

…kers

The pi installer copies wiki-worker, skillify-worker, autopull-worker,
skillopt-worker and notifications-worker from harnesses/pi/bundle, guarded
by existsSync, but that directory was never in package.json files: every
published release installed the pi extension with no workers and no error.
Found while verifying the published 0.7.159 against a stale pi install:
the pre-rename skilify-worker.js was not pruned because nothing shipped.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b5d351ca-ddc1-4881-94dc-3ce00fc8cacf

📥 Commits

Reviewing files that changed from the base of the PR and between ce30de7 and 03e1e4e.

📒 Files selected for processing (2)
  • package.json
  • tests/cli/package-files.test.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Package Payload Coverage

Layer / File(s) Summary
Manifest inclusion and payload validation
package.json, tests/cli/package-files.test.ts
The published files list includes harnesses/pi/bundle. Tests discover installer payloads and verify that each payload is directly or hierarchically covered by the package manifest.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 03e1e

The required Pi workers are included in published packages, with coverage preventing this omission from recurring.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: shipping harnesses/pi/bundle so npm installations include the Pi workers.
Description check ✅ Passed The description clearly explains the problem, fix, affected files, verification steps, and test results. It uses equivalent sections rather than the template headings and does not explicitly state whe…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

No src/*.ts files changed in this PR.

Generated for commit c710ef5.

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.

1 participant