Repository navigation
feat(backend): upgrade Pi to 0.99.1 and load codemode, tool_search and MCP - #412
Merged
Merged
Conversation
…d MCP Pi 0.99 ships codemode, tool_search and MCP as CLI built-in extensions that SDK sessions do not load. Pace now supplies them in the CLI's builtin shape so -builtin:<name> and third-party replacement behave as in the CLI, and emits the codemode worker and QuickJS wasm beside Pi's config chunk so the bundled and packaged backend can run codemode scripts without node_modules.
Pi 0.99 bash results always carry up to 1 MiB of output in structuredContent for codemode scripts. Pace only displays the model-facing content, so the normalizer drops it before the event is journaled or sent to the renderer.
8 tasks done
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@earendil-works/pi-ai/@earendil-works/pi-coding-agentfrom 0.87.1 to 0.99.1 (exact pins). Only API break:steer/followUpnow resolve to a disposition; Pace ignores it, so the structural type is widened toPromise<unknown>.createPaceBuiltInExtensions()supplies them in the CLI's{ builtin: true, replaceable: true }shape, wired into bothsessionOptionsForsites (service.ts,session-process-entry.ts), so-builtin:<name>and third-party replacement behave as in the CLI. llama.cpp is intentionally not loaded.electron.vite.config.ts): emit Pi's codemode worker entry aschunks/codemode-worker.js, rewrite Pi'screateRequire(...).resolve("quickjs-wasi/quickjs.wasm")to the copy inchunks/quickjs.wasm, and fail the build if that text changes or Pi's config chunk leaveschunks/.structuredContentfor codemode scripts; the normalizer now drops it so it never reaches the Session Event Journal or IPC (Pace displays the model-facingcontent).Known gaps (follow-up PRs in this stack): MCP status/errors go through
ctx.ui.notifyand OAuth sign-in needsctx.hasUI, which Pace does not provide yet, so they are dropped and/mcp logindoes not work in Pace (usepi mcp loginin a shell). Nested tool calls (parentToolCallId) are not projected yet.Test plan
pi-builtin-extensions.test.ts: all three built-ins load;-builtin:mcpdisables only MCP (red → green)test:bundled-runtimenew case: out/main-only backend, empty PATH, model callscodemode, script calls a stdio MCP probe server, result containsECHO:bundled(red before the packaging fix withCannot find module 'quickjs-wasi/quickjs.wasm', green after)structuredContentstripped from toolupdate/endresults (red → green)Pace.app(ELECTRON_RUN_AS_NODE, backend insideapp.asar): passesbun run typecheck,bun run lint,bun run build,bun run test:bundled-runtimegreenbun run test: green except.cursor/skills/verify-pace/drive/changes.spec.ts, which already fails onmainand is fixed in a separate PR