pi-advisor

A second, independent set of eyes on every agent session.

TypeScript AI agentsCode reviewGuardrailsPi View the code

Oh My Pi pairs a reviewer model to the advisor role. It reads every turn the main agent takes and injects notes inline — a quiet aside, a concern, or a hard blocker. It runs on its own context and its own model, so it catches what the executor rushed past. The main agent sees the note and course-corrects, or explains why it will not.

Pi is our daily harness. We came across OMP and its advisor feature separately — and liked the idea enough to build our own version for Pi. Pi Advisor brings a similar second opinion into Pi sessions as an extension, without asking anyone to switch stacks.

An isolated advisor session that does not inherit the executor's blind spots. Silence when the work is sound; speak up only for material correctness, safety, verification, or workflow issues. Bounded, actionable output instead of a wall of commentary.

The familiar WATCHDOG configuration shape — model, reasoning level, read-only investigative tools, and instructions — carried over because it already encodes the right defaults for a passive reviewer.

Read-only by construction. The advisor can read, grep, find, and list, but never edits files or runs mutating commands — so the reviewer cannot break your build. OMP allows optional mutating tools behind approval; we chose to remove that surface entirely.

Token and cost governors, local redacted activity records, and explicit opt-in keep the second opinion cheap and auditable. A single focused advisor per session instead of a large roster — enough for daily work without multiplying model loops.

Shipped as npm:@ribbons-digital/pi-advisor for Pi 0.81+, with a Vitest suite around delivery states, branch handling, and the read-only tool boundary.

OMP's advisor is built into the harness. It shares the session host, sees transcript deltas as they happen, and can steer or pause the primary agent from inside that loop. Pi Advisor is an extension: it watches the executor through Pi's public hooks and runs its reviewer in a separate nested session. That architectural gap means some OMP behaviours are simply unavailable — not because we chose to skip them, but because Pi does not expose the primitives an extension would need.

Timing is the most visible difference. OMP can raise a concern or blocker while the main agent is still streaming, or make the executor wait (up to 30 seconds) until review catches up via syncBacklog. Pi Advisor delivers advice at Pi's next assistant boundary — when the executor reaches a natural pause in its loop. It will not hard-interrupt a tool that is already running. If review falls behind, Pi Advisor coalesces the backlog and lets the executor keep moving rather than blocking it.

Context management diverges too. When the advisor's private history grows too large, OMP can use its own in-memory summarisation. Pi Advisor must call Pi's public AgentSession.compact() API — and if that fails, clear its nested history and retry. OMP also has internal context-model promotion policies that Pi does not expose publicly, so Pi Advisor cannot replicate that path.

Scope is narrower by design and by API. One advisor, not OMP's multi-advisor roster. Pi's find tool instead of OMP's glob. Pi-native WATCHDOG paths under ~/.pi/agent/, not OMP's ~/.omp/ layout — configs are not interchangeable. No mutating advisor tools, no fullscreen multi-pane configure UI, and no OMP-style @import expansion in watchdog files.

These are intentional trade-offs for portability: install one npm package on any Pi session and get a useful second opinion without switching harnesses. The goal is the same discipline we saw in OMP's advisor — an independent reviewer that speaks only when it matters — adapted to what a Pi extension can actually do.

One AI agent grading its own homework is a known failure mode: it is fast, confident, and occasionally wrong in ways it cannot see. Nobody checks the checker.

We work in Pi every day. When we came across Oh My Pi (OMP) and its built-in advisor — a second model that watches each turn the primary agent takes, runs on its own context and model, and injects a short note when something looks wrong — the pattern clicked immediately.

Pi Advisor is our take on bringing that discipline to Pi: an independent reviewer in the loop, packaged as an extension anyone can install.

  • Reviews the primary agent's completed work automatically in the background, using a separate model with its own isolated conversation - so it does not inherit the executor's blind spots.
  • Silence-first by design: it stays quiet when the work is sound and speaks up only when there is a real, actionable issue.
  • Read-only by construction - it can read, grep, find, and list, but never edits files or runs mutating commands, so the reviewer can never break your build.
  • Token and cost governors keep the second opinion cheap, with local redacted activity records on by default.
  • A TypeScript extension for the Pi coding agent (Node 22+), running the advisor as a nested session with its own state so its judgement stays genuinely independent of the executor.
  • Built with the guardrails we bring to every AI system: a strict read-only tool surface, bounded and actionable output instead of a wall of comments, and a Vitest suite around the behaviour.

This is how we treat AI in production: never trust a single model's confidence — add an independent check with real guardrails and a tight cost budget. The same review discipline goes into the agents and workflows we build for clients.

Need this kind of thinking on your project?

Start a project