omp packages

@restranger/repi-advisor0.0.1-1a48fc0

Advisor strategy pattern for pi-coding-agent with model fallback and subagents integration

restranger Published 5 hours ago MIT ~872 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

@restranger/repi-advisor

Advisor strategy pattern for Pi Coding Agent (@earendil-works/pi-coding-agent).

Enables the primary executor model to escalate its entire conversation to a second, stronger reviewer model (the advisor) and receive back a concrete plan, a correction, or a stop signal — then keep going.

Includes first-class integration with model fallback chains (@restranger/repi-model-fallback) and subagents (@restranger/repi-subagents).

Features

  • Zero-parameter advisor tool: The executor calls advisor() with no manual copying. The entire conversation context is serialized and forwarded.
  • Model Fallback Chain: If the primary advisor model is unavailable (rate-limited, overloaded, error, quota exhausted), it automatically falls back to secondary advisor models.
  • Subagents Integration: The advisor is informed of all declared declarative subagents via @restranger/repi-lib's re:subagents@1 contract and can instruct the executor to delegate specialized tasks (e.g. Explore, Plan, verification).
  • Service Seam Integration: Publishes re:advisor@1 (AdvisorService), allowing @restranger/repi-model-fallback to manage and persist advisor fallback models in the unified /fallback menu.
  • Dynamic Policy & Blocklist: Automatically hides or shows the advisor tool based on the executor's active model and reasoning level (disabledForModels).
  • Interactive TUI Picker: Clean native TUI menu for selecting the advisor model, reasoning effort, and fallback chains.

Installation

pi install npm:@restranger/repi-advisor

Quick Start

Run the /advisor command to open the interactive setup picker:

/advisor

Pick an advisor model and (if supported) the reasoning effort level. The tool becomes active immediately.

Slash Commands

  • /advisor — Open interactive configuration menu. It renders like Pi's native pickers (/models, /scoped-models, ctx.ui.select): an inline frame in the editor slot, a → cursor, muted descriptions and a key-hint line.
    • Settings roster: Lists Model, Reasoning effort, and Fallback models, with a preview of the fallback chain below.
    • Model picker: Press Enter on Model to select an advisor model with fuzzy search, or pick No advisor to disable it.
    • Effort picker: Press Enter on Reasoning effort to pick a reasoning effort level (model default, minimal, low, medium, high (recommended), xhigh, max).
    • Fallback picker: Press Enter on Fallback models to open a multi-select picker modelled on /scoped-models: Enter toggles a model, Ctrl+A/Ctrl+X enable or clear the list, Ctrl+P toggles provider, and Alt+↑/↓ reorders the chain (#n rank).
    • Press Ctrl+S (or s in settings) to save. Settings are written to the user config (<agentDir>/extensions/repi-advisor.json) so they work before trust; a trusted project that already owns a config is updated in place.
    • Press q or Esc to close (or back from a picker).
  • /advisor status — Inspect the active advisor model, reasoning effort, fallback chain, and subagents integration status.
  • /advisor list — List all available models suitable for acting as advisor.
  • /advisor off — Disable the advisor tool.
  • /advisor model <provider/id> — Quickly switch the advisor model.
  • /advisor effort <minimal|low|medium|high|xhigh|max|off> — Set reasoning effort.
  • /advisor fallback <model1,model2,...> — Set the fallback chain for the advisor.

Fallback Integration

When @restranger/repi-model-fallback is installed, the unified /fallback command automatically detects the advisor through the re:advisor@1 contract. You can configure fallback chains for the Main Agent, the Advisor, and Subagents in a single interface.

Subagents Integration

When @restranger/repi-subagents is installed, the advisor model receives the current roster of available subagents in its prompt context. If a complex multi-step task arises, the advisor will guide the executor to launch relevant subagents.

Configuration

Settings are saved in $PI_CODING_AGENT_DIR/extensions/repi-advisor.json (default ~/.pi/agent/extensions/repi-advisor.json); a trusted project can own .pi/extensions/repi-advisor.json.

{
  "version": 1,
  "modelKey": "anthropic/claude-3-7-sonnet",
  "effort": "high",
  "fallbackModels": [
    "openai/gpt-4o",
    "google/gemini-2.5-pro"
  ],
  "disabledForModels": [
    "anthropic/claude-3-7-sonnet",
    { "model": "openai/gpt-4.5-preview", "minEffort": "high" }
  ]
}

License

MIT