You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🔄 Reorientation — 2026-06-19 (depends on #688, #522 · THE headline deliverable)
This is the goal: a feature-flagged pi backend on the #688 abstraction, built on pi.dev
(@earendil-works/pi-coding-agent). The earlier @openai/agents build was a wrong turn and is scrapped
(PRs #586/#587/#590 closed). Re-spec:
Implement the pi backend on pi.dev (@earendil-works/pi-coding-agent) — a Claude-Code-style coding
agent that owns its own tool loop and ships Read/Write/Edit/Bash. It speaks the PostHog gateway directly via
a registered anthropic-messages provider, runs the same commandments + skills as anthropic, and streams
onto the shared TUI bridge. Selected at wizard-runner=pi.
Scope
Deps: @earendil-works/pi-coding-agent, @earendil-works/pi-ai. No@openai/agents, no aisdk adapter.
Gateway provider — registerProvider(name, { baseUrl: getLlmGatewayUrlFromHost(host), apiKey: <posthog token>, api: 'anthropic-messages', headers: <Bedrock-fallback + wizard metadata/flags> }) (reuse 02 — Shared runner contract + adapters (gateway, MCP, prompt, tools, stream→TUI) #522's header builder). Model via getModel(provider, id) from @earendil-works/pi-ai, same id as the anthropic backend for a clean A/B.
Session — createAgentSession({ model, resourceLoader: new DefaultResourceLoader({ systemPromptOverride: <commandments> }), customTools, cwd: <install dir>, sessionManager: <in-memory> }); run via session.prompt(prompt).
Skills load via Pi's native file-based discovery — drop the resolved framework SKILL.md into a Pi-scanned
dir (.pi/skills / .agents/skills) before the run (progressive disclosure, the context-mill model). Wizard
capabilities (env-file ops, wizard_ask, PostHog data ops) ride as defineTool custom tools. Per-tool
gating (canUseTool + YARA) is #525.
🔄 Reorientation — 2026-06-19 (depends on #688, #522 · THE headline deliverable)
This is the goal: a feature-flagged
pibackend on the #688 abstraction, built on pi.dev(
@earendil-works/pi-coding-agent). The earlier@openai/agentsbuild was a wrong turn and is scrapped(PRs #586/#587/#590 closed). Re-spec:
runner/backends/pi/, implementingAgentBackend.run(session, config, programConfig, boot)(the 01 — Runner seam + multivariate
wizard-runnerflag (anthropic | pi) #521 interface) — a drop-in forrunLinearProgram, consuming the 02 — Shared runner contract + adapters (gateway, MCP, prompt, tools, stream→TUI) #522 shared substrate +BootstrapResult.wizard-runner=pi, insidelinear.ts. v1 is linear-only; per-task backend selection inorchestrator mode is a later follow-up.
@openai/agents.Epic: #520 · Behavior change: none (flag off) · Depends on: #522
Summary
Implement the
pibackend on pi.dev (@earendil-works/pi-coding-agent) — a Claude-Code-style codingagent that owns its own tool loop and ships Read/Write/Edit/Bash. It speaks the PostHog gateway directly via
a registered
anthropic-messagesprovider, runs the same commandments + skills asanthropic, and streamsonto the shared TUI bridge. Selected at
wizard-runner=pi.Scope
@earendil-works/pi-coding-agent,@earendil-works/pi-ai. No@openai/agents, no aisdk adapter.registerProvider(name, { baseUrl: getLlmGatewayUrlFromHost(host), apiKey: <posthog token>, api: 'anthropic-messages', headers: <Bedrock-fallback + wizard metadata/flags> })(reuse 02 — Shared runner contract + adapters (gateway, MCP, prompt, tools, stream→TUI) #522's header builder). Model viagetModel(provider, id)from@earendil-works/pi-ai, same id as theanthropicbackend for a clean A/B.createAgentSession({ model, resourceLoader: new DefaultResourceLoader({ systemPromptOverride: <commandments> }), customTools, cwd: <install dir>, sessionManager: <in-memory> }); run viasession.prompt(prompt).session.subscribeevents (message_updatetext/thinking deltas,tool_execution_start|update|end,turn_*,agent_end) onto the 02 — Shared runner contract + adapters (gateway, MCP, prompt, tools, stream→TUI) #522 stream→TUI bridge (status, todos, dashboard/notebook markers) and the run log.AgentErrorType; honor[ABORT]. Degrade gracefully when a dependency (e.g. local MCP) is unavailable.Acceptance criteria
pi;anthropicunaffected.Open questions
/v1/messagestobaseUrl, or is the full path needed?defineTooltools? (see Epic: Pluggable model-agnostic agent runners (anthropic | pi) #520)Files
src/lib/agent/runner/backends/pi/Notes
Skills load via Pi's native file-based discovery — drop the resolved framework
SKILL.mdinto a Pi-scanneddir (
.pi/skills/.agents/skills) before the run (progressive disclosure, the context-mill model). Wizardcapabilities (env-file ops,
wizard_ask, PostHog data ops) ride asdefineToolcustom tools. Per-toolgating (canUseTool + YARA) is #525.