Preface¶
When using a model for coding tasks, you’ll often run into approaches that carry hidden risks, recurring errors that keep reappearing, or tasks that aren’t truly completed. The main model finds it difficult to step outside its own context and lack a global view of overall risks or omissions.
OpenAdvisor is an open-source “advisor model” plugin: the main model can invoke a second model to review critical decisions whenever needed, receive suggestions, and then proceed. It works with both Pi and DeepSeek Harness (dsh) out of the box, requires no vendor-specific Advisor API, and can call any model across providers.
What It Is¶
OpenAdvisor is a plugin that gives a coding Agent a second opinion. The core idea: when the main model needs to plan an approach, debug recurring errors, or verify that a task is truly done, it calls the advisor tool to hand the current conversation to another model for review, then continues working based on the feedback.
Maintainer: TryLoveMe. Hosted on GitHub, licensed under MIT.
Core Features¶
The main model decides for itself when to consult — it won’t ask every turn. You can explicitly request a consultation in your prompt, for example:
Consult the advisor first to check the risks in this migration plan, then continue implementing. When done, ask the advisor to review the test evidence and point out any gaps.
When the main model invokes the advisor, it can pass a context parameter to attach evidence that isn’t in the conversation (diffs, relevant code, full error output) — the advisor can’t read files, so this significantly improves the quality of its suggestions.
Auto Review & Auto Escalation¶
Both features are off by default; once enabled, they apply to subsequent requests:
/advisor review on # Auto review before completion
/advisor failures 3 # Auto-consult after 3 consecutive tool failures
/advisor limit 20 # Set a cap on consultations to control cost
Pre-completion Review: When the main model is about to end the current request, the advisor determines whether the request is truly complete and outputs VERDICT: COMPLETE or VERDICT: NEEDS_WORK on the first line.
COMPLETE: End immediately. Pi will display “Review passed.”NEEDS_WORK: The gap list is handed back to the main model, which verifies, fills in the missing pieces, and then finishes.
Each request is reviewed at most once to prevent infinite loops; simple requests with fewer than reviewMinToolCalls (default 3) tool calls, errored or interrupted requests, and dsh sub-Agents are skipped.
Post-failure Escalation: When tool failures reach the configured threshold, the advisor analyzes the root cause based on the conversation and the latest error, and its suggestion is appended directly to the failed result (as immediately-following context in dsh) so the main model sees it on the next step. The counter resets after one success and after each consultation.
Ask the Advisor Directly¶
/advisor ask Is it going off track? What risks does the current approach have?
The advisor sees the full current conversation and answers you as an outside observer. The answer is shown only to you — it doesn’t enter the main model’s context and doesn’t interrupt its work.
Configuration & Limits¶
Configuration is stored in a JSON file:
| Host | Location |
|---|---|
| Pi | ~/.pi/agent/advisor.json (or under that directory if PI_CODING_AGENT_DIR is set) |
| dsh | ~/.dsh/advisor.json (or under that directory if DSH_HOME is set) |
{
"model": "anthropic/claude-opus-4-6",
"maxTokens": 4096,
"timeoutMs": 120000,
"reasoning": "high",
"autoReview": true,
"reviewMinToolCalls": 3,
"autoOnFailures": 3,
"maxConsultations": 20
}
All fields except model are optional. Each /advisor subcommand modifies only its corresponding field; all others are preserved. If the config file is invalid, a warning is shown and the advisor stays disabled — rerun /advisor to save a valid configuration.
Usage & Cost¶
Each consultation incurs additional model usage, separate from the main model’s stats. Usage is recorded in the tool result (Pi: details.usage), and /advisor status displays cumulative totals (cost is also shown when the vendor returns pricing info).
Security & Privacy¶
- Reuses the host’s model registry, authentication (including OAuth), custom providers, and request configuration — no extra credentials are stored.
- Choosing a model from a different provider as your advisor means the conversation content will be sent to that provider.
- The advisor only provides suggestions — it has no file, terminal, or tool access.
Installation & Setup¶
dsh Installation¶
Requires dsh 0.2.x, Node.js 24.22.3+, and pnpm:
git clone https://github.com/TryLoveMe/openadvisor.git
cd openadvisor && npm install # generates dist/
dsh plugin --profile web add ./openadvisor
dsh web
Then in the session:
/advisor list
/advisor <provider>/<model-id>
Pi Installation¶
Requires Node.js 22.19+:
# In this project directory
pi install .
Restart Pi or run /reload, then:
/advisor
Pick a model from the list.
You can also load it temporarily without installing: pi -e ./extensions/index.ts.
Typical Usage¶
Once the advisor is enabled, the main model decides on its own when to call it based on context. You can also explicitly request a consultation in your prompt:
Consult the advisor first to check the risks in this migration plan, then continue implementing. When done, ask the advisor to review the test evidence and point out any gaps.
When the main model invokes the advisor, the tool result is marked Reviewed (reviewed), Declined (advisor declined to answer), or Advisor unavailable (invocation failed) — expand to view the full suggestion. In Pi, the status bar shows Advising during the consultation.
Command Reference¶
| Command | dsh Behavior |
|---|---|
/advisor |
Show status and usage |
/advisor <provider>/<model-id> |
Select and save an advisor model |
/advisor <model-id> |
Provider can be omitted if the ID is unambiguous |
/advisor list [filter] |
List available models |
/advisor ask <question> |
Ask the advisor directly; answer is shown only to you |
/advisor review on\|off |
Toggle auto pre-completion review |
/advisor failures <n>\|off |
Auto-consult after n consecutive failures |
/advisor limit <n>\|off |
Cap consultations at n per session |
/advisor status |
Current model, auto features, limits & cumulative usage |
/advisor off |
Disable the advisor |
Use Cases & Caveats¶
Well-suited for scenarios requiring a second opinion, risk review, or automatic safety net, such as:
- Calling models across providers to avoid lock-in to a single vendor’s Advisor API.
- Automatically verifying task completion at the end of a workflow.
- Analyzing root causes and suggesting fixes when tools fail repeatedly.
Note: The plugin runs with the current dsh process permissions — review the source code and license before installing. Costs are billed by the advisor model’s provider; set a limit to avoid unexpected overage.
Brief Closing¶
OpenAdvisor gives a coding Agent an advisor model, enabling the main model to get a second opinion at critical moments — ideal for plan review, error debugging, and completion checks. Open-source under MIT, compatible with Pi and DeepSeek Harness.
- Directory page: https://www.skillhub.cn/plugins/TryLoveMe/openadvisor
- GitHub: https://github.com/TryLoveMe/openadvisor