All notable changes to the pi-intercom extension will be documented in this file.
- Forked/replaced sessions now register with the broker. The runtime was only initialized on
session_start; when a session's id changed in-process without a freshsession_start(forking/branching a session, or a resume path that adopts an id), it never (re-)registered and stayed unreachable until a full process restart. Re-initialize on the first turn whose live session id diverges from the registered identity (or when nosession_startever fired).
- Added
brokerCommandandbrokerArgsconfig options for choosing the broker runtime command. Thanks to William Fligor for PR #12.
- Busy interactive sessions now queue inbound intercom messages until the receiver is idle instead of aborting the active turn.
- Sessions now publish automatic lifecycle status (
idle,thinking, ortool:<name>) through intercom presence updates. - Deferred startup connection, delayed inbound flushes, overlay work, reconnect attempts, and relay callbacks now guard against stale session contexts after shutdown or reload.
intercomandcontact_supervisortool calls/results now use compact custom transcript renderers.
- Added
contact_supervisorreason: "interview_request"for child subagents to send structured supervisor interviews, wait for a reply, and receive parsed JSON replies in tool result details when available.
- Busy non-interactive sessions now auto-reply to top-level intercom messages instead of aborting and losing the message.
- Added a
contact_supervisortool forpi-subagentschild sessions so delegated agents can request supervisor decisions or send meaningful progress updates with run metadata. - Documented subagent-to-supervisor escalation in the README and bundled
pi-intercomskill.
- Made inline intercom message cards use the available terminal width instead of a narrow fixed width.
- Cleared supervisor ask waiters correctly after cancellation or delivery failure so subagents can ask again.
- Stopped tracking
package-lock.jsonand ignored localprogress.mdmemory files.
- Added
pi-subagentsgrouped result relay support overpi-intercom, including delivery acknowledgments so parent runs can return compact receipts only after the orchestrator receives the result message.
- Delivered
pi-subagentsneeds-attention control events to the orchestrator over intercom.
- Added receiver-side
replyergonomics for inbound asks. Agents can now useintercom({ action: "reply", message })in the triggered turn or later against a single pending ask, plusintercom({ action: "pending" })to inspect unresolved inbound asks.
- Migrated extension tool schemas from
@sinclair/typeboxtotypebox1.x so packaged installs follow Pi's current extension runtime contract. - Included
reply-tracker.tsin the published package so installed extensions can load the new reply-tracking helper at runtime. - Updated the integration test harness to set
USERPROFILEalongsideHOME, keeping temp-home isolation reliable on Windows.
- Moved TypeBox from
peerDependenciesto a realdependenciesentry sopi installproduction installs keep the schema package available at runtime. - Incoming ask reply hints now prefer
intercom({ action: "reply", ... })instead of exposing rawtoandreplyToidentifiers. - Updated the bundled
pi-intercomskill and README examples to preferreply/pendingover manual reply threading.
- Bundled
pi-intercomskill with coordination patterns, error handling, constraints, and optional cmux/tmux peer-session spawning for visible multi-session workflows. pi.skillsmanifest inpackage.jsonsopi installloads the skill automatically.- AGENTS.md snippet in README recommending a project-level coordination hint for agents.
- Attachments example to Quick Start section in README.
- Incoming message reply hints now say "To reply, use the intercom tool:" instead of "— reply:" so agents are more likely to use the intercom tool instead of replying inline.
askaction now documents the one-at-a-time constraint in the Tool Reference.statusaction now clarifies that the session count includes the current session.- Broker startup no longer uses a non-null assertion for sender session lookup in the
sendhandler — missing sessions now produce adelivery_failedresponse instead of a crash. - Broker spawn lock error handling tightened to check
instanceof Errorbefore accessing.code. - Broker PID parsing now guards against
NaNfrom corrupt PID files. isConnected()readability cleanup inIntercomClient.- README file structure updated to include
broker/paths.ts, test files, andskills/directory. - README runtime files section now clarifies that
broker.sockis macOS/Linux only; Windows uses a named pipe. - README mermaid diagram changed "Unix Socket" to "Local Socket/Pipe" for cross-platform accuracy.
- README broker limitation rephrased from "must be running" to "auto-spawns on first use and exits when idle."
- README Install section now mentions that the bundled skill is registered on startup.
- Broker startup now works on Windows by launching the local
tsxCLI through a hiddenwscript.exehelper without treating the helper's expected early exit as a broker failure.
- The broker now uses a Windows named pipe instead of a Unix socket on Windows, while keeping the existing Unix socket transport on macOS and Linux.
- Declared the extension entry in
package.jsonviapi.extensionssopi install npm:pi-intercomcan discover and load the extension from the npm package.
- Added
pi-packagepackage metadata plus peer dependency declarations for every Pi runtime package the extension imports, including@mariozechner/pi-tui.
- Intercom sessions now reconnect automatically after broker disconnects or sleep/wake interruptions instead of staying offline until reload or restart.
- Replaced raw runtime
console.errorintercom disconnect logging with silent recovery so transient broker churn no longer splashes stray text into the Pi TUI.
- Unnamed sessions now register a runtime-only
subagent-chat-<id>intercom alias instead of persisting a generic session title into Pi session history, sopi --resumecan keep showing transcript snippets while unnamed sessions remain reachable over intercom. - Intercom presence updates now refresh the advertised session name during later turn/intercom activity, so renaming a session does not leave subagents and peers targeting a stale startup alias.
- Busy incoming intercom messages now try a graceful detach handshake with
pi-subagentsbefore falling back to interrupting the active turn. - Reply follow-ups are deferred and re-delivered as follow-up wakeups so final confirmation messages stop causing unnecessary
Operation abortedinterruptions. - Unnamed sessions now auto-register a stable
session-<id>display name so orchestrators and delegated children can target each other reliably without a manual/name.
- Switched intercom send confirmation to opt-in.
sendnow delivers immediately by default, and interactive confirmation only appears whenconfirmSend: trueis set in~/.pi/agent/intercom/config.json. - Replaced the old inverted
autoSendconfig withconfirmSendto make the behavior easier to understand.
- Added an MIT
LICENSEfile and setpackage.jsonlicensetoMIT.
- Updated
README.mdto mention thepi-subagentsintegration and link to https://github.com/nicobailon/pi-subagents.
- Clearer self vs peer identity —
intercom({ action: "list" })now showsCurrent sessionandOther sessions, includes short session IDs, and marks same-folder peers with[same cwd]so agents are less likely to mistake another session in the same repo for themselves. - Picker self anchor — The session picker now shows the current session as a disabled
[self]row at the top while keeping only peer sessions selectable.
- Reply flows skip approval —
sendcalls that includereplyTonow bypass the confirmation dialog so reply-hint conversations can continue without an extra approval step. - Overlay readability — The session picker now shows session name/model on the first line and the cwd on a second line with middle truncation, making long paths much easier to distinguish.
- Documentation clarity — The README now explains which sessions appear in the picker, how sessions become intercom-connected, and the difference between user-facing
/intercomusage and agent tool calls.
- Compose overlay crash — Replaced the invalid
tui.scheduleRender()calls withtui.requestRender(), fixing the compose overlay crash while typing or sending. - Overlay panel chrome — Restored bordered modal rendering for the session picker and compose overlay so they display as proper overlays instead of floating unboxed content.
- Added a
promptSnippetfor theintercomtool so Pi 0.59+ includes it in the default tool prompt section and improves session-to-session coordination discoverability.
- Pi compatibility refresh — Updated the extension to match current Pi lifecycle and custom UI APIs, including
session_start/session_shutdownand injectedctx.ui.custom()keybindings. - Overlay keybindings — The session picker and compose overlay now use injected, namespaced Pi keybindings instead of reading editor-global bindings directly.
- Session list correlation —
list/sessionsnow carry arequestId, so a delayed broker reply cannot be mistaken for a newer session-list request. - Reply sends skip approval —
sendcalls that includereplyTonow bypass the confirmation dialog so reply-hint flows work without an extra approval step. - Documentation accuracy — The README now matches the current implementation, including request correlation, persistence behavior, broker disconnect behavior, and the file layout.
- Protocol state handling — Broker and client now reject malformed, unknown, duplicate, and out-of-order protocol messages instead of silently accepting them.
- Duplicate-name routing — Sends to a duplicated session name now fail with an explicit error instead of routing to the first match.
- Delivery failure visibility —
delivery_failed.reasonnow flows through the client, tool results, and compose overlay error UI. - Disconnect and startup errors — Broker spawn failures, early broker exits, protocol failures, and disconnects now preserve the real error instead of collapsing to generic messages.
- Disconnect-time writes — Client operations now fail cleanly during disconnect instead of writing to a closing socket and triggering
write after enderrors. - Late-response handling — Timed-out send/list requests no longer disconnect the client, and delayed list responses can no longer contaminate a later request with stale data.
- Config validation — Invalid intercom config values are now reported and ignored instead of silently producing a broken runtime config.
askaction —intercom({ action: "ask", to, message })now sends a message and blocks until the recipient replies, returning the reply as the tool result. Includes a 10-minute timeout, abort handling, disconnect handling, and shutdown cleanup.- Exact reply hints — Incoming messages can now include a ready-to-run reply command that uses the sender's exact session ID as
toand the original message ID asreplyTo, making synchronousask/reply flows reliable. - Attachment body rendering for incoming messages — Incoming attachment contents are now appended to the agent-visible message body so recipients can read attached file/snippet/context content directly.
- Planner/worker workflow documentation — README now documents the intended planner-worker loop, including
sendvsask, clarification patterns, and reply-hint behavior.
- Session target resolution —
sendandasknow resolve a unique case-insensitive session name to its exact session ID before sending. Ambiguous names are rejected instead of guessed. - Duplicate-name presentation — Session labels are now disambiguated consistently across
list, the session picker, the compose overlay, and send notifications by appending a short session ID when names collide. - Send confirmation dialog — Confirmation text now includes attachment content previews and
replyTometadata so outgoing messages are reviewed accurately before sending. - Inline message rendering — The custom inline renderer now shows the fully rendered message body, optional reply command, attachment summaries, and reply metadata consistently with what the agent receives.
- False
askcompletions from unrelated messages — Reply matching now requires an exactreplyTomatch and the expected sender, preventing unrelated incoming messages from unblocking a waitingask. - Self-targeted messages —
sendandasknow reject attempts to message the current session instead of allowing loops or self-waits. - Undelivered
askcleanup — If anaskmessage is not delivered, the waiting state is torn down cleanly instead of lingering. - Inline renderer/body mismatch — The custom message renderer now matches the actual delivered message body for messages with attachments instead of showing a reduced view.
- Duplicate-name ambiguity when self shares a name — Duplicate-name detection now considers all connected sessions, so another session is still disambiguated when it shares a name with the current session.
broker/client.tssessionsswitch scoping — Braced thesessionscase to avoid block-scoping hazards in the message handler.