Skip to content

feat(pi): make pi() the Pi Durable agent - #335

Merged
eersnington merged 4 commits into
mainfrom
pi-durable-as-pi
Oct 7, 2026
Merged

eersnington merged 4 commits into
mainfrom
pi-durable-as-pi

Conversation

@eersnington

@eersnington eersnington commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

@rivet-dev/pi now has one agent: pi() runs Pi Durable. The actor built on pi-coding-agent's AgentSession is removed.

import { createRegistry } from "@earendil-works/pi-durable";
import { pi } from "@rivet-dev/pi";

// No sandbox: Pi's read, write, and edit tools work on files in the actor's own SQLite database.
const agent = pi({ model: "anthropic/claude-opus-5-5", registry: createRegistry() });
  • One agent. pi() is the former piDurable() and imports from @rivet-dev/pi. Types drop the Durable part: PiOptions, PiActions, PiPromptResult.
  • Deprecated alias. @rivet-dev/pi/durable still exports piDurable (the same function as pi) and the old PiDurable* type names, marked @deprecated.
  • Old actors keep their data. An actor stored by the removed pi() starts under the new one. pi_sandbox is created only when it is missing, so the actor keeps its sandbox, and pi_session and pi_entry stay as they are.
  • Pi Durable 1.0.3 sandbox env. The sandbox ExecutionEnv moves to @rivet-dev/sandbox-adapter/pi and implements 1.0.3's interface (openBinaryReader with scanLines, argv exec, the onOutput stream info). On 0.5.0, read and bash fail in a sandbox once Pi Durable 1.0.3 or later is installed.
  • Sandbox on first use. Pi Durable builds the env for every model request and tool call. The sandbox now connects only when a sandbox tool runs, so a plain chat turn or a custom tool never creates one, and a sandbox outage fails only the calls that need it.
  • Any Pi Durable 1.x. The @earendil-works/pi-durable and @earendil-works/chord peers are ^1.0.0. The adapter depends on Pi Durable directly, so users install only one copy.
  • Files without a sandbox. With no sandbox, files live in the actor's database (databaseEnv, table pi_file). A ranged read loads only the bytes it needs. There is no shell, so bash returns shell_unavailable.
  • Fresh credentials. The app's credentials source is read on every model call, so a login, logout, or new key applies to the next call instead of after the actor sleeps.

This is part 1 of 2 in a stack:

@railway-app

railway-app Bot commented Oct 7, 2026

Copy link
Copy Markdown

This PR was not deployed automatically as @eersnington does not have access to the Railway project.

In order to get automatic PR deploys, please add @eersnington to your workspace on Railway.

@eersnington
eersnington merged commit 271c096 into main Oct 7, 2026
0 of 3 checks passed
@eersnington
eersnington deleted the pi-durable-as-pi branch October 7, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant