Repository navigation
Description
Summary
Anthropic released the Advisor Strategy on April 9, 2026 — a server-side tool (advisor_20260301) that enables a cost-efficient executor model (Sonnet/Haiku) to consult a high-capability advisor model (Opus) within a single /v1/messages API call. This dramatically improves quality while reducing cost.
OpenCode does not currently support this tool type. This issue requests adding advisor_20260301 to the provider tool handling pipeline.
What is the Advisor Strategy?
- Tool type:
advisor_20260301(Anthropic server-side tool, likebashortext_editor) - How it works: The executor model (e.g., Sonnet 4.6) runs as usual. When it encounters a hard problem, it invokes the
advisortool. Anthropic's API transparently routes that call to Opus, returns guidance, and the executor continues — all within one API request. - Beta header:
anthropic-beta: advisor-tool-2026-03-01
API Schema
{
"tools": [
{
"type": "advisor_20260301",
"name": "advisor",
"model": "claude-opus-4-6",
"max_uses": 3
}
]
}Supported Model Combinations
| Executor | Advisor |
|---|---|
| Claude Haiku 4.5 | Claude Opus 4.6 |
| Claude Sonnet 4.6 | Claude Opus 4.6 |
| Claude Opus 4.6 | Claude Opus 4.6 |
Benchmarks (from Anthropic)
- SWE-bench Verified: Sonnet 4.6 + Opus advisor = +2.7% accuracy, 11.9% cheaper than Opus alone
- BrowseComp: Haiku 4.5 + Opus advisor = 19.7% → 41.2% (2x improvement)
- Advisor overhead: Typically 400–700 text tokens per consultation
Current State in OpenCode
After analyzing the OpenCode binary (v1.3.17–v1.4.3), the Anthropic provider tool types are handled via a switch/case pattern in the compiled Go binary:
case "anthropic.code_execution_20260120": { ... }
case "anthropic.text_editor_20250124": { ... }
case "anthropic.text_editor_20250429": { ... }
case "anthropic.text_editor_20250728": { ... }
case "anthropic.bash_20250124": { ... }
case "anthropic.web_search_20260209": { ... }
case "anthropic.memory_20250818": { ... }
// ❌ No case for "anthropic.advisor_20260301"
The advisor_20260301 type is not present in any released version, nor in the current dev branch (verified via GitHub code search).
What Needs to Change
- Add
advisor_20260301to the provider tool switch/case in the Anthropic provider implementation (likely inpkg/provider/anthropic/or equivalent) - Support the beta header
anthropic-beta: advisor-tool-2026-03-01— the existing beta header plumbing (providers.anthropic.options.headers["anthropic-beta"]) may already handle this, but it needs to be verified - Config support — allow users to configure the advisor tool in
opencode.json, e.g.:{ "provider": { "anthropic": { "models": { "sonnet": { "tools": { "advisor": { "type": "advisor_20260301", "model": "claude-opus-4-6", "max_uses": 3 } } } } } } }
Why This Matters
The advisor strategy is particularly valuable for OpenCode's use case:
- Cost savings: Run Sonnet as the primary agent, consult Opus only when stuck → same quality, lower cost
- Better architecture decisions: Executor handles routine code, advisor handles complex reasoning
- Native API support: No prompt engineering needed — Anthropic handles the model routing server-side
References
- Blog post: https://www.anthropic.com/engineering/the-advisor-strategy
- API documentation: https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/advisor-tool
- Announcement date: April 9, 2026
Environment
- opencode-ai: v1.3.17 (installed) / v1.4.3 (latest)
- OS: macOS (arm64)
Activity
github-actions commentedon Apr 10, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:(e.g.[FEATURE]: Support Anthropic Advisor Strategy)Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Apr 10, 2026
This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.
Feel free to open a new issue that follows our issue templates.
baob commentedon Apr 10, 2026
I'd like to request the maintainers reconsider this feature. While this issue was auto-closed by the bot for not following the template format, the underlying feature request is valuable and I believe deserves proper maintainer review.
My use case: I'm working on complex coding tasks where I need Opus-level intelligence for strategic planning, but Opus is too expensive to run for entire conversations. Anthropic's Advisor Tool (released April 9, 2026) solves this perfectly - it lets Sonnet consult Opus mid-generation for guidance, giving near-Opus quality at mostly-Sonnet cost.
I built a workaround script that uses the advisor tool externally, but it runs outside OpenCode's context so the advisor can't see my codebase. Native support would allow Opus to provide strategic guidance while still having full access to project files and OpenCode's tools.
Could the team please share why this was marked "not planned"? Is there a technical limitation, architectural decision, or is this feature simply not aligned with OpenCode's roadmap?
Reference: https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool
edgardleal commentedon May 12, 2026
@baob what about using an specialized advisor agent?
In my case I have a a @advisor sub agent and on strategic AGENTS.md I have instructions to use this advisor.
8sp4rk commentedon Jul 14, 2026
i would love to see this implemented