@juicesharp/rpiv-advisor

1.18.2 • Public • Published

rpiv-advisor

Let the model ask a stronger model for a second opinion before it acts. rpiv-advisor adds the advisor tool and /advisor slash command to Pi Agent - the working model can hand the full conversation to a reviewer (e.g. Opus) and resume with its plan, correction, or stop signal.

Advisor model selector

Features

  • Reviewer model selector - /advisor opens a picker over any model in Pi's registry, plus a reasoning-effort picker for reasoning-capable models. Start typing to fuzzy-filter the list by model name or provider/id.
  • Persisted across sessions - selection saved at ~/.config/rpiv-advisor/advisor.json (chmod 0600).
  • Off by default - the advisor tool is excluded until you pick a model; choose "No advisor" to disable.
  • Per-executor blocklist - list executor models in disabledForModels (in advisor.json) to strip the advisor tool when those models drive the session. Entries can be plain strings (block at any effort) or { "model": "<provider:id>", "minEffort": "<level>" } to block only when the executor's effort meets or exceeds the threshold. Available levels, lowest to highest: minimal, low, medium, high, xhigh.
  • Zero-parameter handoff - calling advisor forwards the full serialized conversation branch; no manual prompt needed.

Install

pi install npm:@juicesharp/rpiv-advisor

Then restart your Pi session.

Usage

Configure an advisor model with /advisor - the command opens a selector for any model registered with Pi's model registry, plus a reasoning-effort picker for reasoning-capable models. Selection persists across sessions at ~/.config/rpiv-advisor/advisor.json (chmod 0600).

The advisor tool is registered at load but excluded from active tools by default; selecting a model via /advisor enables it. Choose "No advisor" to disable.

advisor takes zero parameters - calling it forwards the full serialized conversation branch to the advisor model, which returns guidance (plan, correction, or stop signal) that the executor consumes.

Tool

  • advisor - escalate the current conversation branch to the configured reviewer model. Inactive until a model is selected via /advisor.

Schema

advisor() // zero parameters

The full conversation branch is auto-serialized from ctx.sessionManager - the LLM does not (and cannot) pass it explicitly.

Returns:

{
  content: [{ type: "text", text: string }], // reviewer's guidance, or error message
  details: {
    advisorModel?: string,        // "<provider>:<modelId>"
    effort?: ThinkingLevel,       // reasoning effort, when applicable
    usage?: Usage,                // token usage from the side-call
    stopReason?: StopReason,      // pi-ai stop reason
    errorMessage?: string,        // populated on auth/abort/error/empty paths
  }
}

License

npm version License: MIT

MIT