Skip to content

Track: run Cloudflare's PiHarness (pi-durable) on do-runtime #90

Description

@MiguelsPizza

Cloudflare's Agents SDK now hosts pi-durable first party. agents/harness/pi shipped in agents@0.26.0 (cloudflare/agents#2424, #2451, #2452) alongside agents/models/pi-ai (#2446). It is beta. PiHarness opens Pi over the object's SQLite and plugs Pi's sessions into the Durable Object lifecycle (added in 0.22), which wakes sessions that still have work after an eviction. Pi owns the transcript, inbox, generation, tool calls, retries and crash recovery. The SDK supplies storage and the wake.

The extension host builds on @cloudflare/think today, and that stays. We may one day move from Think to Pi, because Pi's recovery is per task and has a per-tool replay policy (replay: "safe") that Think lacks. If we do, do-runtime has to run PiHarness the way workerd does. These issues establish that without changing the host:

Open questions outside do-runtime, recorded here so they are not lost:

  • Model provider. Pi needs a pi-ai Provider. agents/models/pi-ai targets Workers AI and AI Gateway, so a browser host needs its own provider over its model client. See the rfc-harness-model-provider-boundary design in cloudflare/agents.
  • Synchronization. Pi replaces Think, not the Agents SDK. State synchronization, callables and the client protocol stay where they are, and Pi's events() stream would need folding into the host's UI.
  • Released transcripts. A move needs a Think-to-Pi transcript migration, which is the host's problem, not this repository's.

The source was read at Pi v1.0.0 and agents@0.26.0. No code has been run yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions