pi-actio0.2.0
pi extension: makes a pi coding agent a member of an Actio team (actio tool, /actio Explorer, prompt service)
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
pi-actio
A pi extension that makes a pi coding agent a member of an Actio team: it sees the team, calls other agents' capabilities, and can let the team send prompts into the session.
What it adds
| one tool | actio, with three commands: list-team, info, call |
| one command | /actio, the Actio Explorer overlay |
| optional | the prompt service: the capabilities prompt, cancel, retrieve, compact |
| optional | the team may command this agent: enable, ping, restart, stop (acceptCommands) |
| automatic | the agent reports its work: busy while pi runs or compacts, and the prompt counts |
| optional | activity notifications (reportActivity) |
| configuration | one JSON file, actio.json, read on load and on /reload |
Out of scope, on purpose: sending commands to other agents, attachments, a per-call timeout parameter,
history that survives /reload, settings UIs.
Install
pi install npm:pi-actio@0.2.0
From a source checkout, install the folder instead — pi install <absolute path>/pi-actio — and install the
checkout's dependencies first (internals.md §11).
- Node ≥ 22.
- Remove it with
pi uninstall <source>. For a folder, pi matches an installed extension by its resolved path, so use the same path you installed from. - Personal installs are recorded in
~/.pi/agent/settings.json. An install is loaded at the nextpistart or/reload.
Configuration (actio.json)
Location: the pi agent directory — $PI_CODING_AGENT_DIR/actio.json, by default ~/.pi/agent/actio.json.
Every key is optional, and those eleven keys are the whole language: a file that is not valid JSON, has an
unknown key, has a wrong type, or has a bad agent id (agentId, an acceptPrompt item, or an acceptCommands
item) registers nothing and shows one notification naming the file and the first error. Fix it and /reload.
A complete file, every key spelled out:
{
"agentId": "planner-4f2a",
"namespaces": ["planning"],
"actioDir": "~/.actio",
"exposePrompt": true,
"acceptPrompt": ["oracle-9c1e", "scribe-7b3d"],
"acceptCommands": ["oracle-9c1e"],
"disabled": false,
"json": false,
"reportActivity": true,
"cleanContext": false,
"compactThinking": "low"
}
What people usually write, leaving the id to the extension and the root to the environment:
{
"exposePrompt": true,
"acceptPrompt": ["oracle-9c1e", "scribe-7b3d"],
"acceptCommands": ["oracle-9c1e"],
"reportActivity": true
}
and the shortest file there is, which means the same as no file at all:
{}
| Key | Type | Default | Meaning |
|---|---|---|---|
agentId |
^[a-zA-Z0-9_-]{1,32}$ |
see below | the id this agent joins the team with |
namespaces |
string[] |
unset (actio-ts's default) | the namespaces this agent belongs to; "*" means all of them |
actioDir |
string |
unset → $ACTIO_DIR or ~/.actio |
the actio root folder; a leading ~ is expanded |
exposePrompt |
boolean | false |
offer the prompt service (§The prompt service) |
acceptPrompt |
string[] of agent ids |
[] |
who may call the prompt service; [] means every agent on the team — unlike acceptCommands |
acceptCommands |
string[] of agent ids |
[] |
who may send this agent the protocol commands enable, ping, restart, stop; [] means nobody, and a listed agent gets all four (§Commands the team may send) |
disabled |
boolean | false |
true: the extension is fully off — no agent, no tool, no command |
json |
boolean | false |
true: tool results are JSON instead of Markdown |
reportActivity |
boolean | false |
notify the pi user about received requests and finished calls |
cleanContext |
boolean | false |
what a prompt without clean_context means: true starts the run with no earlier conversation (§The prompt service) |
compactThinking |
off minimal low medium high xhigh max |
unset | the thinking level of every compaction summary of the session; unset leaves compaction exactly pi's |
The default agentId is the current folder's name, with characters outside [a-zA-Z0-9_-] replaced by _,
cut to 27 characters, plus - and four random hex characters. It stays the same across /reload, /new and
/fork in one process, and two pi sessions in the same folder get different ids.
A configuration change takes effect on /reload.
Commands the team may send
acceptCommands decides who may send this agent the four protocol commands. They are built into
actio-ts, and the extension cannot narrow them: an id listed there
gets all four.
enablesets or clears thedisabledflag of this agent'sspec.json. A disabled agent offers its capabilities to nobody — a peer's call to it is refused — and still takes commands, so the team can enable it again.pingre-announces the agent: a freshdatetimein itsspec.jsonandstatus.json, and a new announce in the team'snuntiumfolder. Nothing else changes.restartstops the agent and starts it again in the same pi process, after a delay in seconds (clamped to 60). The capabilities survive it; adisabledflag set byenabledoes not. A pi session that shuts down during that delay cancels the restart, and the agent stays down.stoptakes the agent off the team: itsstatus.jsonbecomesinactive, and after that it writes nothing more. Theactiotool answersthe actio agent is not runningfrom then on. Only a new pi session, or/reload, starts it again.
The pi user is notified of each of them, whatever reportActivity says: actio: disabled by the team,
actio: enabled by the team, actio: stopped by the team, actio: restarted by the team. A restart arrives
as stopped and then restarted — actio-ts performs it as a stop followed by a start, and nothing tells the
two apart until the agent is back.
The actio tool
The model uses it; parameters in italics are optional.
| Command | Does |
|---|---|
actio {command: "list-team"} |
a fresh scan of the team, one bullet per agent: id, description, capability names. No visible agents. when the team is empty |
actio {command: "info", id: "<agent>", capability: *"name"*} |
that agent's status, health and namespaces, and its capabilities with their parameters and result schemas. Without capability, all of them. An unknown name is an error that lists the real ones. It also shows what that agent reported about its own work (§The prompt service) |
actio {command: "call", target: "<id>/<capability>", params: *{…}*} |
calls a peer and waits for the answer. Press Escape to cancel it |
Before a call is sent, the target is checked against the team and the parameters against the published
schema, and the error says what to do next (use info <id>). A peer's error answer is a normal result —
it is the peer's answer — and is shown as → error <code>: <msg>. Only a local failure (unknown agent,
unknown capability, bad parameters, no answer) is an error from the tool.
With json: true every result is JSON instead of Markdown.
The prompt service
Set exposePrompt: true. The agent then publishes four capabilities. A peer calls prompt, gets a
prompt_id immediately, and polls it with retrieve.
| Capability | Parameters | Answers |
|---|---|---|
prompt |
{ msg_prompt, asap?, clean_context? } |
{ prompt_id } — 8 lower-case hex characters |
retrieve |
{ prompt_id } |
{ status: "queued" | "running" | "done", response } — response is the run's final text |
cancel |
{ prompt_id } |
null |
compact |
{} |
null, always |
Behavior worth knowing:
- When the session is busy, a new prompt is queued and sent when the run settles.
asap: trueinstead steers the running one, and a steered prompt shares that run's answer. - Clean and keep.
clean_context: truestarts the run with no earlier conversation: the model sees the system prompt and that prompt, and the session is cut at that point — everything before it is replaced by the one-line summaryThe earlier conversation was cleared for a new prompt.clean_context: falsecontinues the context as it is: everything since the last cut. An absentclean_contextmeanscleanContextfromactio.json(defaultfalse), and thepromptschema publishes that default, so a peer learns it frominfo. The cut is a real session boundary, not a filter: the context stays small enough that pi's own threshold compaction never fires for messages the model was never sent, and a later compaction summarizes only what came after the last cut — never an unrelated task. asap: truewithclean_context: trueis refused withActioError 1001: a steered prompt joins a run that is already going, so it cannot start clean. Nothing is queued and no id is drawn.asap: truewithclean_contextabsent is accepted and continues the context — the default applies only to a prompt that can honour it.- What the team sees while pi works. The agent reports itself
busyfrom the start of a run to its settle — whoever started it, the local user included — and while a compaction runs. With the prompt service on, itscapability_statussays how many prompts arerunningand how many arequeued, andmsgnames the oldest running one asprompt <id> from <peer>— the sender, never the content. A peer reads all of it from theinfocall it already makes: JSON gainscapability_status,contentionandmsg; Markdown gains oneWork:line, e.g.Work: prompt 1 running, 2 queued · msg: prompt 4f2a9c31 from oracle-9c1e. A run the local user typed reportsbusyand nothing else about it. A flip ofbusyis published at once; the counts are published at most once a second, so a peer's numbers can lag by up to that. - The compaction level. With
compactThinkingset, every summary pi writes for this session —/compact, the threshold, overflow recovery, and thecompactcapability — is produced at that level instead of the session's, and the session's own level is untouched. It changes nothing for a model registered withreasoning: false: pi sends a thinking level only to a reasoning model, and the switch for the others is model configuration (samplingParams,thinkingLevelMap), not a key of this extension. - Two prompts sent back to back while the session is idle: the second is queued.
retrieveof adoneprompt returns the answer and forgets the id; a secondretrieveof the same id isActioError 1000.cancelforgets it in any state. An unknown id is the same error 1000.- Cancelling a running prompt aborts the whole run, so another prompt riding the same run ends with the partial answer.
- A prompt may be answered by a run the local user started, and
promptcannot select a model or a mode. - The pi agent takes no protocol commands unless
acceptCommandslists the sender: with the default[]the prompt service is the only thing it offers (§Commands the team may send). acceptPromptlists the agent ids allowed to call these capabilities. The default[]means every agent on the team — and the pi agent publishes no capability at all unlessexposePromptis on.
With reportActivity: true the pi user sees, as notifications: actio: <src> → <capability> [<prompt_id>]
for each received request, and actio: <target> → confirmed | error <code> | cancelled | … when a call the
agent made finishes. Polling retrieve while a prompt is queued or running makes no noise.
/actio — the Actio Explorer
Opens an overlay with three tabs. It needs the interactive terminal; in another mode it reports that. The window never collapses below twelve rows, and it follows pi's theme colours.
╭──────────────────────────────────────────────────────────────────────────────────────────╮
│ Actio Explorer — <agentId> · <actio root> · prompt service: on|off │
│ [Team] Calls Prompts │
├──────────────────────────────────────────────────────────────────────────────────────────┤
│ Team: the agents (id, status/health, description); the selected agent's capabilities below
│ Calls: this agent's outgoing calls, newest first: <id>/<capability> in-flight | confirmed <ms> ms | error <code> | cancelled | abandoned | failed: <msg>
│ Prompts: received prompt-service requests, newest first: <time> <src> <capability> [<prompt_id>] <outcome>
│ tab switch · ↑↓ select · r refresh · esc close │
╰──────────────────────────────────────────────────────────────────────────────────────────╯
The list updates by itself when a call or a request arrives or finishes; r re-scans the team. The history is
in memory, per session: /reload, /new or /fork starts it empty again, which is what "live sessions"
means.
Limits
- One tool, three commands, one command, four capabilities: nothing else, on purpose.
- No per-call timeout parameter; a call waits for the peer and Escape cancels it.
- History is not persisted, and there is no way to ask about a session that is not running.
- The prompt service answers with the run's final text: no streaming, no mid-run output, no model choice.
- The Explorer cannot show the resolved actio root when
actioDiris unset; setactioDirto see the path in the header. - A compaction started by the pi user (
/compact) is outside the prompt service's queue: a prompt queued during it waits for the next run, and anasapprompt sent during it never reaches the model and is later reporteddonewith the next run's answer. The team does at least see the agentbusywhile it runs. Every compaction requested through the prompt service is waited for and then run. compactThinkingdoes nothing for a model registered withreasoning: false, and pi keeps the lastsession_before_compactresult it is given: with another compaction extension loaded, the extension order decides which one wins.- A clean prompt's cut is a session boundary, not a filter: nothing a peer can undo, and a cut that had not
reached its
turn_endwhen the session reloaded is lost with the rest of the prompt service's state. - It sends no protocol commands of its own, and there are no attachments and no retries.
acceptPromptandacceptCommandscheck thesrca peer writes in its own envelope: the protocol has no authentication yet, and write access to the shared actio root is peer authority.acceptPromptis a guard, not a wall — andacceptCommandsis stronger still, since a listed agent can stop or disable this session. List in it only agents you trust with that.
Where the details are
internals.md— how it works, the decisions behind each behaviour, tests, packaging.- The Actio protocol — the wire format,
which this extension implements through
actio-ts. The protocol is public but still a draft: its security layer is unspecified, and write access to the shared actio folder is peer authority. Do not point two teams' folders at each other.