Sleeptalk

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

  1. Install Pi on the runtime host: npm install -g @earendil-works/pi-coding-agent@1.1.0. If pi is missing, the setup wizard offers to run this for you.
  2. Log Pi in to a model with Pi's own login.
  3. Run sleeptalk and choose Pi (built-in default), or let your agent run sleeptalk 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 eventSleeptalk handlingCaller experience
message_update with text_deltaText activity and sentence streaming; completed assistant text is a fallback.Incremental reply.
tool_execution_startTool narration and activity keyed by toolCallId.The tool being used.
tool_execution_updateChanged partial-result content, without replaying unchanged snapshots.Progress activity.
tool_execution_endResult activity and a completed or failed ToolEvent.Tool completion or failure.
extension_ui_request confirmationPermission request through the packaged extension.Allow once or deny, in pending mode.
agent_settledCompleted status and available usage.The turn is settled, including queued follow-ups.

Permissions

permission_modeWhat Sleeptalk passes to PiTool behavior
auto (used when the field is empty)--approveTools run without asking.
pending--no-approve --no-extensions plus the packaged permission extensionEach confirmation becomes a caller decision: allow once or deny.
denyThe same flags as pendingConfirmations 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

  • pi not found. Install it with the command above, or set pi_bin to 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.