Skip to content

feat(agents): add a pi preset - #36

Open
Pateemu wants to merge 7 commits into
VRTFinland:mainfrom
Pateemu:feat/pi-preset
Open

Pateemu wants to merge 7 commits into
VRTFinland:mainfrom
Pateemu:feat/pi-preset

Conversation

@Pateemu

@Pateemu Pateemu commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

npm install is used as opposed to install script - as install script prompts y/n on /dev/tty.
pi agent can be shared with all the jb session

pi (@earendil-works/pi-coding-agent) installs with npm into a shared prefix at ~/.local/share/pi (subpath pi-install), so the package is downloaded once per repo and later containers only relink ~/.local/bin/pi — the claude-install / opencode split. The vendor's pi.dev/install.sh is not used: it prompts on /dev/tty, which the install step's tmux window has, so jailbee new would block until step_timeout. pi needs Node >= 22.19, i.e. golden.stacks.node.

/.pi/agent is shared whole: sessions are one JSONL file each and auth.json is written under a mkdir-based proper-lockfile lock, so unlike opencode's SQLite store it is safe across containers. The preset also sets headless (pi -p --no-approve with --session-id) and skills_dir (/.pi/agent/skills); egress is pi.dev:443, the install step runs loose for registry.npmjs.org.

Verified against pi 1.0.0: install, second-container relink, and the headless one-shot with and without --model against a local Ollama model reached through host_ports.
Claude

Linked issue

Checklist

  • Tests added/updated for this change
  • uv run pytest passes
  • uv run ruff check src/ tests/ passes
  • uv run ruff format --check src/ tests/ passes
  • uv run mypy src/ passes
  • Docs updated if behavior changed (README, CLAUDE.md, docstrings, etc.)

Pateemu and others added 7 commits October 5, 2026 09:57
pi (@earendil-works/pi-coding-agent) installs with npm into a shared
prefix at ~/.local/share/pi (subpath `pi-install`), so the package is
downloaded once per repo and later containers only relink
~/.local/bin/pi — the claude-install / opencode split. The vendor's
pi.dev/install.sh is not used: it prompts on /dev/tty, which the
install step's tmux window has, so `jailbee new` would block until
step_timeout. pi needs Node >= 22.19, i.e. golden.stacks.node.

~/.pi/agent is shared whole: sessions are one JSONL file each and
auth.json is written under a mkdir-based proper-lockfile lock, so
unlike opencode's SQLite store it is safe across containers. The
preset also sets `headless` (pi -p --no-approve with --session-id)
and `skills_dir` (~/.pi/agent/skills); egress is pi.dev:443, the
install step runs loose for registry.npmjs.org.

Verified against pi 1.0.0: install, second-container relink, and the
headless one-shot with and without --model against a local Ollama
model reached through host_ports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The timeout hint was gated on `name == "claude"` and hard-coded
`claude --resume`, so pi's caller-chosen --session-id was never
reported. Each resumable agent now carries its own resume command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ions

~/.local/bin/pi is per container, so every fresh container failed
install_check and took the install line, which skipped npm whenever the
shared prefix already held pi: auto_update never fired. And an update
ran npm in place over the shared prefix, replacing the lazily imported
chunks a sibling container's running pi still needed.

pi now installs through a bundled ensure-pi.sh that decides about
updating itself from the new JAILBEE_AUTO_UPDATE step variable, installs
each release into its own releases/<version> prefix, switches a
`current` link by rename and keeps the two newest releases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
~/.local/bin/opencode is per container, so every fresh container failed
install_check and took the install line, which skipped the installer
whenever the shared ~/.opencode already held a binary: auto_update
never fired and the shared install stayed on its first version.

opencode now installs through a bundled ensure-opencode.sh that decides
about updating from JAILBEE_AUTO_UPDATE. The vendor installer downloads
~88MB on every run, so an update first compares the installed version
with the installer's own version pointer and pins the installer to it
only when they differ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm only warns EBADENGINE when Node is older than a package's engines,
so on an image with golden.stacks.node pinned low the pi install step
succeeded and pi crashed at first use. ensure-pi.sh now checks the
release in use against its engines.node after linking, which also
covers a link-only container on an older image, and names a missing
Node instead of reporting an unreachable npm registry.

The tests now run the script on a PATH of stubs and the exact tools it
uses, so a node on the test machine cannot leak in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Several preset lists and counts still described the six presets before
pi: the headless and skills_dir rows, the shipped-preset count, and the
bundled config-schema skill, which is copied into every container and
told in-container agents pi had neither. The pi row now also says that
~/.pi/agent holds trust.json, so trusting the repo's .pi/ in one
container trusts it in all of them, --pr review containers included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t status

install_host_skills detects agents by binary name alone, so an
unrelated `pi` such as Debian's digit calculator counts too; say so.
agents.md §5 and the doctor socket check grouped pi with the unverified
presets while §8 says its ~/.pi/agent was checked against 1.0.0 and
holds no socket; they now agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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