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
🔄 Re-spec — 2026-06-26 (consumes the router/pairs core from #521)
Land the substrate in runner/shared/ (beside #688's bootstrap.ts/types.ts/errors.ts). It consumesBootstrapResult/ProgramRun and the resolved pair's model from #521's resolver — it does not re-derive run context or pick a model itself. Stays runner-neutral so the pi runner (and any future
runner) needs no rework.
Build the runner-neutral surface the pi runner consumes, so it doesn't re-derive what anthropic already
has. No agent SDK here — just shared scaffolding any runner reuses.
Scope
Run context — working dir; gateway transport (baseURL from getLlmGatewayUrlFromHost, bearer =
posthog API key, Bedrock-fallback + metadata/flag headers — reuse buildAgentEnv/buildGatewayHeaders
semantics as a header map). Model is not chosen here — the runner receives model: string resolved
from the pair (MODELS[pair.model], see 01 — Selection surface: config map + insertion points (each flag its own middleware) #521).
System prompt — wizard commandments (+ skills) as the system-prompt string (Pi consumes it via DefaultResourceLoader({ systemPromptOverride })).
MCP wiring — posthog-wizard remote MCP (bearer) + wizard-tools, expressed so a runner can mount them.
Reuses the bits salvaged from the scrapped harness work (the seam, run-bridge, conclude, buildGatewayHeaders). The from-scratch Messages client and hand-rolled loop are not carried over — the
Pi SDK owns the loop.
🔄 Re-spec — 2026-06-26 (consumes the router/pairs core from #521)
Land the substrate in
runner/shared/(beside #688'sbootstrap.ts/types.ts/errors.ts). Itconsumes
BootstrapResult/ProgramRunand the resolved pair's model from #521's resolver — it doesnot re-derive run context or pick a model itself. Stays runner-neutral so the
pirunner (and any futurerunner) needs no rework.
Epic: #520 · Behavior change: none (defaults preserved) · Depends on: #521
Summary
Build the runner-neutral surface the
pirunner consumes, so it doesn't re-derive whatanthropicalreadyhas. No agent SDK here — just shared scaffolding any runner reuses.
Scope
getLlmGatewayUrlFromHost, bearer =posthog API key, Bedrock-fallback + metadata/flag headers — reuse
buildAgentEnv/buildGatewayHeaderssemantics as a header map). Model is not chosen here — the runner receives
model: stringresolvedfrom the pair (
MODELS[pair.model], see 01 — Selection surface: config map + insertion points (each flag its own middleware) #521).DefaultResourceLoader({ systemPromptOverride })).(
[STATUS]/[DASHBOARD_URL]/[NOTEBOOK_URL], collectedText); reusehandleSDKMessage's marker logic.AgentErrorType(ABORT/RATE_LIMIT/API_ERROR…).Acceptance criteria
buildAgentEnv.Files
src/lib/agent/runner/shared/(gateway, mcp, prompt, stream-bridge, errors)Notes
Reuses the bits salvaged from the scrapped harness work (the seam,
run-bridge,conclude,buildGatewayHeaders). The from-scratch Messages client and hand-rolled loop are not carried over — thePi SDK owns the loop.