Skip to content

Bug: minimax-coding-plan provider fails with ProviderModelNotFoundError when used as subagent model via Task tool #24514

Closed as not planned

Description

@quirozino

Bug Description

When minimax-coding-plan/MiniMax-M2.7 is configured as the model for a custom subagent, launching that subagent via the Task tool throws ProviderModelNotFoundError. The same model works perfectly when used directly from CLI or TUI.

Steps to Reproduce

  1. Configure a subagent in ~/.config/opencode/opencode.json with minimax-coding-plan/MiniMax-M2.7:
{
  "agent": {
    "my-subagent": {
      "description": "Test subagent",
      "hidden": true,
      "mode": "subagent",
      "model": "minimax-coding-plan/MiniMax-M2.7",
      "prompt": "You are a test agent. Reply with 'working'."
    }
  }
}
  1. Connect minimax-coding-plan via /connect — key stored in auth.json
  2. From a primary agent that has Task tool access, invoke the subagent via Task tool
  3. Observe ProviderModelNotFoundError

Expected Behavior

Subagent launches successfully using minimax-coding-plan/MiniMax-M2.7, same as when invoked from CLI.

Actual Behavior

ProviderModelNotFoundError

The error occurs regardless of whether the API key is in auth.json (via /connect) or explicitly set in provider.minimax-coding-plan.api_key in the config.

What Works

  • opencode run --model "minimax-coding-plan/MiniMax-M2.7" "hello" — works fine
  • Selecting MiniMax M2.7 as the active model in TUI — works fine
  • Other providers (anthropic, openai) as subagent models — work fine

What Does NOT Work

  • minimax-coding-plan/MiniMax-M2.7 as subagent model invoked via Task tool
  • Same failure with minimax-cn/MiniMax-M2.7 (minimaxi.com variant)

Root Cause Hypothesis

minimax-coding-plan uses @ai-sdk/anthropic as its SDK adapter with https://api.minimax.io/anthropic/v1 as base URL (per models.dev). The Task tool's subagent model resolution may fail when the provider uses a non-standard SDK adapter (Anthropic SDK pointing to a non-Anthropic endpoint), while direct CLI invocation uses a different code path that succeeds.

Environment

  • OpenCode version: 1.14.25
  • Platform: Windows 11 (win32)
  • Shell: PowerShell 5.1
  • Provider: minimax-coding-plan (Token Plan Plus, minimax.io)
  • Auth: key registered via /connect stored in auth.json

Activity

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

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct from the above (e.g. it specifically affects minimax-coding-plan which uses @ai-sdk/anthropic as its adapter pointing to a non-Anthropic endpoint), it may be worth keeping open, but please review those issues first and add any additional context if helpful.

  3. quirozino commented on Apr 26, 2026

    @quirozino
    Author

    Confirmed distinct case from the suggested duplicates, but same root cause as #20725.

    Specific adapter: minimax-coding-plan uses @ai-sdk/anthropic (not @ai-sdk/openai-compatible) pointing to https://api.minimax.io/anthropic/v1. The sub-session doesn't carry the provider config, so the Anthropic adapter gets initialized without the custom base URL and key, causing ProviderModelNotFoundError.

    The analysis in #20725 nails it: provider resolution in sub-sessions doesn't look up the opencode.json provider config. The same fix should cover both @ai-sdk/openai-compatible (#20725) and @ai-sdk/anthropic-based custom providers (this issue).

    Keeping open to track the @ai-sdk/anthropic adapter path specifically.

  4. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. lexmin0412 commented on May 12, 2026

    @lexmin0412

    Same issue, is there any progress?

  6. rogoit commented on May 18, 2026

    @rogoit

    Same issue, would be great how can we help?

  7. nexxeln commented on May 19, 2026

    @nexxeln
    Contributor

    are you using oh-my-openagent by any chance?

  8. rekram1-node commented on May 26, 2026

    @rekram1-node
    Contributor

    Cant reproduce, maybe a bug w/ ur plugins

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions