@wengine-ai/pi-session-handoff0.1.3
Hand a self-contained task to another local pi session (GUI or TUI) — recipient keeps its own project, model and permissions; busy targets queue instead of being interrupted.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@wengine-ai/pi-session-handoff
Hand a self-contained task to another local pi session — from the terminal, from the desktop app, or between the two.
The recipient keeps its own project, model and permissions; the sender never gets to drive another project's tools or files. If the target session is busy, the message is queued behind its current turn instead of interrupting it.
Install
pi install npm:@wengine-ai/pi-session-handoff
The
npm:prefix is required. Without it,pi install @wengine-ai/pi-session-handoffis interpreted as a local path and fails withPath does not exist.
Both sides need this plugin. A session can only receive a handoff if it is running with the plugin loaded. In the desktop app it ships built in; in the terminal you install it as above.
After installing, restart pi (or run /reload) so the tool registers.
What it does
| Capability | Detail |
|---|---|
| Deliver to any local session | GUI ↔ GUI, TUI ↔ TUI, TUI ↔ GUI |
| Recipient autonomy | Keeps its own project, model, permissions and memory scope |
| Busy target | Queued behind the current turn; never interrupts |
| Idempotency | A stable idempotencyKey prevents double delivery on retry |
| Disambiguation | Duplicate session names return candidates instead of guessing |
| Probe safety | Liveness probes use a dedicated route and do not consume queued work |
In the desktop app it can also reach a session that is currently disconnected, because the main process reconnects it before delivering.
Usage
The model calls it as a tool. Typical flow:
action: "list"— discover candidate sessions (optionally scoped byprojectPath)action: "send"— deliver a self-contained message to one exactsessionKey
A handoff message must stand on its own: the recipient never saw the sending conversation. Include the findings, evidence, file paths and acceptance criteria.
Notes
- A
queuedresult means accepted in memory, not completed. Closing or reloading the receiver before it starts can cancel pending work. - If a send times out or returns something unexpected, inspect before retrying — pass the same
idempotencyKeyso a retry cannot deliver twice. - Sessions are addressed by their own identity; a session cannot hand off to itself.
How it works
Two files, zero runtime dependencies:
index.mjs— registers thesession_handofftool; in the desktop app it also uses the reserveddesktop-handoffchannel to ask the main process for candidates and to reach disconnected sessions.transport.mjs— per-session descriptor registry (under the pi agent dir) plus a loopback HTTP endpoint for delivery, with instance ids, a/pingprobe and receiver-side idempotency.
License
Apache-2.0