Agent integrations
Pi
Sleeptalk's built-in default agent, run as a persistent RPC subprocess that streams replies, reports tools, and controls the active turn.
Setup
- Install Pi on the runtime host:
npm install -g @earendil-works/pi-coding-agent@1.1.0. Ifpiis missing, the setup wizard offers to run this for you. - Log Pi in to a model with Pi's own login.
- Run
sleeptalkand choose Pi (built-in default), or let your agent runsleeptalk host ensure --agent pi.
If Pi already uses OpenRouter, Venice, Groq, or Together, setup can offer that key for speech. It is used only if you say yes. It looks in ~/.pi/agent/auth.json and the custom providers in models.json beside it. A key given as a shell command in models.json is never run.
The 0.1.0 harness inventory recommends Pi 1.1.0 for a fresh installation and retains protocol checks for 0.84.0. Keep an existing installation unless you deliberately choose to upgrade. sleeptalk adapter versions --json shows the inventory.
The profile's model and provider fields pass --model and --provider to Pi. Leave them empty to use Pi's own defaults. pi_bin points at a different executable.
Connection and session
The adapter starts pi --mode rpc and exchanges newline-delimited JSON. Prompts are acknowledged before their events are processed. The process keeps conversation context across turns within a call. Sleeptalk starts Pi with --no-session, so nothing persists across restarts.
Event mapping
| Upstream event | Sleeptalk handling | Caller experience |
|---|---|---|
message_update with text_delta | Text activity and sentence streaming; completed assistant text is a fallback. | Incremental reply. |
tool_execution_start | Tool narration and activity keyed by toolCallId. | The tool being used. |
tool_execution_update | Changed partial-result content, without replaying unchanged snapshots. | Progress activity. |
tool_execution_end | Result activity and a completed or failed ToolEvent. | Tool completion or failure. |
extension_ui_request confirmation | Permission request through the packaged extension. | Allow once or deny, in pending mode. |
agent_settled | Completed status and available usage. | The turn is settled, including queued follow-ups. |
Permissions
permission_mode | What Sleeptalk passes to Pi | Tool behavior |
|---|---|---|
auto (used when the field is empty) | --approve | Tools run without asking. |
pending | --no-approve --no-extensions plus the packaged permission extension | Each confirmation becomes a caller decision: allow once or deny. |
deny | The same flags as pending | Confirmations are refused. |
Pi's --approve concerns project trust, not tool permission. In pending and deny, only the packaged extension loads. If its startup proof is missing or does not match, no prompt is sent. Setup probes refuse auto.
Pi does not advertise a worker lifecycle. A generic tool event is not treated as a sub-agent.
Voice and interruption
Assistant text passes through the shared sentence streamer before speech. Tool activity follows your narration setting; a tool result is not read aloud in full.
Abort sends {"type":"abort"} for the owned prompt and stops its stream. The client avoids aborting unrelated work ahead of a queued prompt. Steering uses the RPC steer operation. An agent_end alone does not mean the turn is settled; retries or follow-ups may still run.
Limits and troubleshooting
pinot found. Install it with the command above, or setpi_binto the executable.- Pi cannot reach a model. Log Pi in with its own login; Sleeptalk does not hold Pi's model credential.
- Earlier conversation is gone after a restart. Expected: each Pi process starts with
--no-session.
Implementation: Pi RPC, permission extension.