Skip to content

Feature Request: Support Anthropic Advisor Strategy (advisor_20260301) #21789

Closed as not planned

Description

@ChungHwemo

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, like bash or text_editor)
  • How it works: The executor model (e.g., Sonnet 4.6) runs as usual. When it encounters a hard problem, it invokes the advisor tool. 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

  1. Add advisor_20260301 to the provider tool switch/case in the Anthropic provider implementation (likely in pkg/provider/anthropic/ or equivalent)
  2. 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
  3. 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

Environment

  • opencode-ai: v1.3.17 (installed) / v1.4.3 (latest)
  • OS: macOS (arm64)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 10, 2026
  2. github-actions commented on Apr 10, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The title should start with [FEATURE]: (e.g. [FEATURE]: Support Anthropic Advisor Strategy)
    • The feature request template requires a verification checkbox confirming the feature hasn't been suggested before — this is missing
    • The issue contains an extensive AI-generated description (binary disassembly analysis, benchmark tables, full API schemas, implementation walkthroughs). Please trim this down to a concise, human-written description of the problem you want solved and why it matters to you

    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.

  3. github-actions commented on Apr 10, 2026

    @github-actions
    Contributor

    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.

  4. baob commented on Apr 10, 2026

    @baob

    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

  5. edgardleal commented on May 12, 2026

    @edgardleal

    @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.

  6. 8sp4rk commented on Jul 14, 2026

    @8sp4rk

    i would love to see this implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions