Skip to content

feat(backend): upgrade Pi to 0.99.1 and load codemode, tool_search and MCP - #412

Merged
bubbleptr merged 2 commits into
mainfrom
feat/pi-099-builtin-extensions
Sep 30, 2026
Merged

bubbleptr merged 2 commits into
mainfrom
feat/pi-099-builtin-extensions

Conversation

@bubbleptr

@bubbleptr bubbleptr commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Upgrade @earendil-works/pi-ai / @earendil-works/pi-coding-agent from 0.87.1 to 0.99.1 (exact pins). Only API break: steer/followUp now resolve to a disposition; Pace ignores it, so the structural type is widened to Promise<unknown>.
  • Pi 0.99 ships codemode, tool_search and MCP as CLI built-in extensions that SDK sessions do not load. New createPaceBuiltInExtensions() supplies them in the CLI's { builtin: true, replaceable: true } shape, wired into both sessionOptionsFor sites (service.ts, session-process-entry.ts), so -builtin:<name> and third-party replacement behave as in the CLI. llama.cpp is intentionally not loaded.
  • Bundling (electron.vite.config.ts): emit Pi's codemode worker entry as chunks/codemode-worker.js, rewrite Pi's createRequire(...).resolve("quickjs-wasi/quickjs.wasm") to the copy in chunks/quickjs.wasm, and fail the build if that text changes or Pi's config chunk leaves chunks/.
  • Pi 0.99 bash results always carry up to 1 MiB of full output in structuredContent for codemode scripts; the normalizer now drops it so it never reaches the Session Event Journal or IPC (Pace displays the model-facing content).
  • ADR-0046 records the decision and the known gaps.

Known gaps (follow-up PRs in this stack): MCP status/errors go through ctx.ui.notify and OAuth sign-in needs ctx.hasUI, which Pace does not provide yet, so they are dropped and /mcp login does not work in Pace (use pi mcp login in a shell). Nested tool calls (parentToolCallId) are not projected yet.

Test plan

  • pi-builtin-extensions.test.ts: all three built-ins load; -builtin:mcp disables only MCP (red → green)
  • test:bundled-runtime new case: out/main-only backend, empty PATH, model calls codemode, script calls a stdio MCP probe server, result contains ECHO:bundled (red before the packaging fix with Cannot find module 'quickjs-wasi/quickjs.wasm', green after)
  • Normalizer test: structuredContent stripped from tool update/end results (red → green)
  • Same probe against packaged Pace.app (ELECTRON_RUN_AS_NODE, backend inside app.asar): passes
  • bun run typecheck, bun run lint, bun run build, bun run test:bundled-runtime green
  • bun run test: green except .cursor/skills/verify-pace/drive/changes.spec.ts, which already fails on main and is fixed in a separate PR

…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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

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.
@bubbleptr
bubbleptr added this pull request to stack #415 September 30, 2026 12:59
@bubbleptr
bubbleptr merged commit e7fd5be into main Sep 30, 2026
1 check passed
@bubbleptr
bubbleptr deleted the feat/pi-099-builtin-extensions branch September 30, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant