Repository navigation
feat(pi): pi 1.5 + agents 0.33 (watch bridge, restart limit ends work, browser.cdp, models as a function, createAI 0.29 wire) - #153
jonnyparris wants to merge 8 commits into
Conversation
…as a function - @earendil-works/pi-durable, pi-ai, chord ~1.4.0; agents ^0.30.1 (lockstep: agents 0.30 peers pin pi ~1.4.0). pi 1.4 migrates pi_ tables to schema v2, which 1.3 can't open: no rollback past this deploy. - PiEngine reads onReport's typed info. A task pi's crash-loop guard parks (5 restarts without progress) no longer leaves the turn waiting for the 15-min stall guard: a recovered prompt whose run is parked is aborted and fails with PiTaskParkedError; a new prompt aborts work an earlier turn left parked, then runs. - HarnessOptions.models is a function (PiEngineHost.models()); CodingAgent rebuilds Models only when the gateway config changes. Closes the ADR 0002 Upstream workaround. - createAI (agents >=0.29) dropped the universal endpoint: main-session Anthropic resolves by AI Gateway's catalog spelling (anthropic/claude-*-4.6) and runs on env.AI.run, with Dodo's id kept on the model for persisted refs; subagent routed models use env.AI.fetch, now wrapped to keep the AbortSignal local. Fake AI binding covers both. - Tests: parked-turn recovery, stale-park clearing, adapter fetch; attach the rejection handler before close() in mid-run eviction tests (pi 1.4's close rejects pending waits).
…park listener (parks are only counted at open)
…t, keep served models registered mid-run; docs
…del/gateway are frozen while a prompt runs); comments
… that outlasts its prompt
|
Preview deployed: https://dodo-preview.jonnyparris.club Serves The preview is shared: the next PR push replaces this build, and this PR gets a new comment when that happens. Add the Replaced |
|
beep-boop-🤖 Preview check on
Not tested live: a real park. It needs 5 resets with no progress, and Dodo's fiber gives up after 3. The workerd tests in |
|
Preview replaced: https://dodo-preview.jonnyparris.club now serves A live check on this PR that started before now is no longer testing this branch. Re-run this PR's deploy-preview job to take the preview back, or add the |
…mit ends work, browser.cdp tool API) - @earendil-works/pi-durable, pi-ai, chord ~1.5.0, + pi-schema; agents ^0.33.0; @modelcontextprotocol/server (+ sdk 1.32.2): optional peers since agents 0.31, agents/mcp imports the server package. - PiEngine: watchEvents is gone. run() attaches Conversation.watch() before it submits; LiveBridge (src/pi/live-bridge.ts) renders each view: transcript entries drive text, tool_call/tool_result, steps and usage; pi.live drives the streaming partial, the stall guard snapshot and logs. finish() reads what no delivered view showed. - Parked-task handling removed (pi 1.5 ends restart-limited work). restart_limit / interrupted map to a plain 'send the prompt again' error (piUnansweredMessage). onReport(report) and SessionEnd use the tagged kind. - SETTINGS.progress: partials are deferred now; comment fixed, persistWithinMs explicit. - Turn stall guard takes a full live snapshot per watch call. - browser_execute (agents 0.31): no ctx, structuredOutput passed through; system prompt, browser-cdp-perf skill and README teach browser.cdp / notice. - Docs: ADR 0002 'Pi 1.5 / agents 0.33', file map.
|
Preview replaced: https://dodo-preview.jonnyparris.club now serves A live check on this PR that started before now is no longer testing this branch. Re-run this PR's deploy-preview job to take the preview back, or add the |
feat(mcp): agents 0.34 + pi 1.6; MCP step-up via MCPAuthorizationRequiredError (stacked on #153)
Upgrades Dodo from pi 1.3 / agents 0.28 to pi 1.5 (
@earendil-works/pi-durable,pi-ai,chord~1.5.0, plus the new peer@earendil-works/pi-schema) and agents 0.33. They move together: agents 0.33 pins pi~1.5.0. This PR first targeted pi 1.4 / agents 0.30. It was retargeted before merge so prod takes one storage migration instead of two (see the 1.5 launch note).What changed
src/pi/live-bridge.ts, new). pi 1.5 removedwatchEvents().PiEngine.run()now attachesConversation.watch()before it submits the prompt, or before it resumes a recovered run.LiveBridgeturns each view into Dodo's SSE events. A watch folds together the commits made while its listener runs, and the view's entries are a window. So the bridge renders the current state instead of replaying events:tool_call(from the answer'stoolCallblocks),tool_result, the step count and token usage.pi.livedrives only the streaming partial text, the turn stall guard's snapshot and the log lines.finish()reads any entries that no delivered view showed.restart_limit.interrupted.piUnansweredMessage).onReportnow takes one report tagged bykind, andSessionEndusesend.kind.SETTINGS.progress. Streamed text is now stored in batches. Watches see each update at once, and storage gets them withinpersistWithinMs(1 s, now set explicitly). The old comment, "250 ms keeps write volume modest", was wrong;partialIntervalMsnow only sets how often the chat updates. A crash can lose up to ~1 s of streamed text.browser_execute(agents 0.31). The model's code runs in its own Dynamic Worker and calls abrowserglobal (browser.cdp(...)).noticereplacesrestarted/newTabs.ctxis gone from the tool options. The wrapper passesstructuredOutputthrough, because the tool now declares a schema for it. The system prompt, thebrowser-cdp-perfskill and the README teach the new API.@modelcontextprotocol/server(2.4.0) andsdk(1.32.2) are listed explicitly.agents/mcpimports the server package, and without it the bundle failed to build. Bumpingviteto 8.3.5 cleared a peer conflict on esbuild 0.28.HarnessOptions.modelsas a function.env.AI.run, androutedmodels go overenv.AI.fetchthroughadaptBindingForCreateAI.docs/file-map.mdis updated.Checks
tsc(app + bench),biome lint, full vitest: 1419/1419 passed locally. The first full runs had hook timeouts in facet/OAuth tests at load average ~90; those files pass on a re-run.dodo-verifypassed on 89cee41.preview-lock):tool_call(with args),tool_result, and 3text_deltaframes that add up to exactly the final text.browser_executewithbrowser.cdpreturned the page title. A screenshot came back as an image attachment, in the same tab as the previous call.Known, not fixed here
{}as input. Its results still show.