Skip to content

feat(pi): configure common agents without a registry - #401

Draft
NathanFlurry wants to merge 3 commits into
mainfrom
stack/feat-pi-configure-common-agents-without-a-registry
Draft

NathanFlurry wants to merge 3 commits into
mainfrom
stack/feat-pi-configure-common-agents-without-a-registry

Conversation

@NathanFlurry

@NathanFlurry NathanFlurry commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

A typical agent built a Pi Durable registry only to install CodingTools and set its instructions, and a sandbox without CodingTools did nothing. pi() now covers those cases directly; registry stays for everything else.

  • sandbox brings the coding tools. With a sandbox, read, write, edit, and bash are installed by default, unless the app's registry already has any of them; a registry that picked only read and bash keeps exactly those. codingTools: false turns them off, a list such as ["read", "bash"] installs only those, and codingTools: true turns them on without a sandbox. Tools the registry already has are never installed twice.
  • Starting agent options. instructions, cwd, and maxTurns start every new conversation, like model and thinkingLevel; a fork keeps what its parent set.
  • compaction sets settings.compaction; toolSearch: true installs Pi's tool search.
  • Typing. The actor's context in tools, hooks, and onAnswer is NoInfer. A tool typed against the registry that holds its actor made TypeScript infer the actor's state and events as any, so useEvent("pi.view") in @rivetkit/react expected never.
  • Docs. The quickstart, sandbox, and built-in tools examples use codingTools instead of a registry.
export const coder = pi({
  model: "anthropic/claude-opus-5-5",
  instructions: "Fix one project, then open a merge request.",
  cwd: "/workspace",
  sandbox: dockerProvider({ image: "node:22-bookworm" }),
  tools: { open_merge_request: openMergeRequest },
});

Stacked on #400. codemode is not included: createCodemodeExtension needs a script sandbox and its import costs about 128 ms, so it stays a registry extension for now.

Tests

  • tests/options.test.ts: a sandbox without a registry writes a file through the coding tools; codingTools: ["read"] refuses write; a sandbox next to a registry with only read and bash refuses write (fails before the fix); instructions, cwd, and maxTurns are on a new conversation's agent.
  • The useEvent("pi.view") typing was checked against an app with a tool typed against its own registry, with rivetkit and @rivetkit/react 3.1.1: it fails before the NoInfer change and passes after.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

📟 Pip-Boy · d2ef069

📦 Packages · fresh npm install resolve, no lockfile · this PR vs base

package (linux-x64-gnu) @latest base this PR Δ vs base packages
@rivet-dev/pi 392.6 MB 392.6 MB 392.6 MB +7.1 KB (+0.0%) 220 (0)
`@rivet-dev/pi` details
platform base this PR Δ
linux-x64-gnu 392.6 MB 392.6 MB +7.1 KB (+0.0%)
linux-arm64-gnu 371.8 MB 371.8 MB +7.1 KB (+0.0%)
darwin-arm64 269.5 MB 269.5 MB +7.1 KB (+0.0%)
darwin-x64 280.5 MB 280.5 MB +7.1 KB (+0.0%)
win32-x64 188.6 MB 188.6 MB +7.1 KB (+0.0%)

Entrypoints (own code, minified; third-party imports excluded)

entrypoint base this PR Δ imports exports
. 38.9 KB 39.9 KB +1.0 KB (+2.6%) — +CodingToolName
./durable 38.9 KB 39.9 KB +1.0 KB (+2.6%) — +CodingToolName
All 10 packages · linux-x64-gnu
package (linux-x64-gnu) @latest base this PR Δ vs base packages
@rivet-dev/pi 392.6 MB 392.6 MB 392.6 MB +7.1 KB (+0.0%) 220 (0)
@rivet-dev/sandbox-adapter 114.5 KB 114.5 KB 114.5 KB 0 1 (0)
@sandbox-agent/cli-shared 27.2 KB 27.2 KB 27.2 KB 0 1 (0)
@sandbox-agent/persist-indexeddb 12.4 KB 12.4 KB 12.4 KB 0 1 (0)
@sandbox-agent/persist-postgres 12.3 KB 12.3 KB 12.3 KB 0 1 (0)
@sandbox-agent/persist-rivet 12.2 KB 12.2 KB 12.2 KB 0 1 (0)
@sandbox-agent/persist-sqlite 12.3 KB 12.3 KB 12.3 KB 0 1 (0)
@sandbox-agent/react 41.6 MB 41.9 MB 41.9 MB 0 15 (0)
acp-http-client 6.7 MB 6.7 MB 6.7 MB 0 3 (0)
sandbox-agent 31.0 MB 31.0 MB 31.0 MB 0 8 (0)

🧹 Rust dependencies

Skipped: this PR doesn't change any Rust code or dependencies.

🦀 Binaries

Skipped: this PR doesn't change any Rust code.

⏱ Timing

job wall time slowest step
zizmor 14s checkout · 9s
changes 20s checkout · 15s
footprint 2m22s Run pnpm --dir sandbox-agent install --frozen-lockfile · 1m04s
⏭ self-test — skipped
⏭ native · ${{ matrix.platform }} — skipped
⏭ hygiene — skipped
report 24s checkout · 10s
🔭 Full CI trace for this commit

One OpenTelemetry trace of CI and Pip-Boy for d2ef069: every job and step, with the sizes above attached. Run after CI finishes.

pnpm install --frozen-lockfile --filter 'pipboy...'
pnpm --filter pipboy pipboy trace --sha d2ef06922d36f01e4d22f7c7b5f85a5661751095

Add --otlp <url> to send it to any OTLP/HTTP collector.

Agent instruction: From a rivet-dev/agents checkout, run the commands above, then read the trace file the last command prints. List the slowest jobs and steps and explain where CI time went.

@NathanFlurry
NathanFlurry force-pushed the stack/feat-pi-configure-common-agents-without-a-registry branch from 344bdba to 05388d3 Compare November 16, 2026 12:46
@NathanFlurry
NathanFlurry changed the base branch from stack/fix-pi-schedule-a-recovery-wake-while-pi-work-is-active-ponmmwro to stack/fix-pi-type-onanswer-s-context-with-c-pi-and-the-actor-s-state-ouynwsuk November 16, 2026 12:46
@eersnington
eersnington force-pushed the stack/fix-pi-type-onanswer-s-context-with-c-pi-and-the-actor-s-state-ouynwsuk branch from 7ec7030 to b0ed8a4 Compare November 17, 2026 14:12
@eersnington
eersnington force-pushed the stack/feat-pi-configure-common-agents-without-a-registry branch from 05388d3 to 33d2f66 Compare November 17, 2026 14:12
@eersnington
eersnington force-pushed the stack/fix-pi-type-onanswer-s-context-with-c-pi-and-the-actor-s-state-ouynwsuk branch 2 times, most recently from 27e5cb7 to 08f8838 Compare November 17, 2026 17:07
Base automatically changed from stack/fix-pi-type-onanswer-s-context-with-c-pi-and-the-actor-s-state-ouynwsuk to main November 17, 2026 18:09
NathanFlurry and others added 3 commits November 17, 2026 22:17
A sandbox now brings Pi's coding tools (read, write, edit, and bash), so
a typical agent no longer builds a registry just to install CodingTools.
`codingTools: false` turns them off, a list such as ["read", "bash"]
installs only those tools, and `codingTools: true` turns them on without
a sandbox. A registry that already has CodingTools does not get them
twice.

New pi() options start every new conversation the way model and
thinkingLevel do: instructions, cwd, and maxTurns. compaction sets
settings.compaction, and toolSearch: true installs Pi's tool search.
registry stays for everything else, merged with what pi() installs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m tools

A sandbox brought Pi's coding tools even when the app's registry already
had some of them under its own extension, so an agent that installed
only read and bash also got write and edit. The sandbox now brings them
only when the registry has none, and an explicit codingTools setting
skips the tools the registry already has.

The actor's context in tools, hooks, and onAnswer is now NoInfer. A tool
typed against the registry that holds its actor made TypeScript infer
the actor's state and events as any, so a client's useEvent("pi.view")
expected never.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eersnington
eersnington force-pushed the stack/feat-pi-configure-common-agents-without-a-registry branch from 33d2f66 to d2ef069 Compare November 17, 2026 18:26

This branch has not been deployed

No deployments
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