@restranger/repi-advisor0.0.1-1a48fc0
Advisor strategy pattern for pi-coding-agent with model fallback and subagents integration
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.
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
advisortool: The executor callsadvisor()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'sre:subagents@1contract 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-fallbackto manage and persist advisor fallback models in the unified/fallbackmenu. - Dynamic Policy & Blocklist: Automatically hides or shows the
advisortool 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, andFallback models, with a preview of the fallback chain below. - Model picker: Press
EnteronModelto select an advisor model with fuzzy search, or pickNo advisorto disable it. - Effort picker: Press
EnteronReasoning effortto pick a reasoning effort level (model default,minimal,low,medium,high (recommended),xhigh,max). - Fallback picker: Press
EnteronFallback modelsto open a multi-select picker modelled on/scoped-models:Entertoggles a model,Ctrl+A/Ctrl+Xenable or clear the list,Ctrl+Ptoggles provider, andAlt+↑/↓reorders the chain (#nrank). - Press
Ctrl+S(orsin 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
qorEscto close (or back from a picker).
- Settings roster: Lists
/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