You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: minimax-coding-plan provider fails with ProviderModelNotFoundError when used as subagent model via Task tool #24514
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
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'."
}
}
}
Connect minimax-coding-plan via /connect — key stored in auth.json
From a primary agent that has Task tool access, invoke the subagent via Task tool
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
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.
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.
Activity
github-actions commentedon Apr 26, 2026
This issue might be a duplicate of existing issues. Please check:
model: inheritin agent frontmatter causesProviderModelNotFoundErrorwhen subagent is invoked via Task tool — same error, same execution path, provider resolution failing for subagents@ai-sdk/openai-compatible) falls back to the wrong provider in sub-sessions — very similar root cause (provider config not carried into sub-session context)If your issue is distinct from the above (e.g. it specifically affects
minimax-coding-planwhich uses@ai-sdk/anthropicas 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.quirozino commentedon Apr 26, 2026
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.
lexmin0412 commentedon May 12, 2026
Same issue, is there any progress?
rogoit commentedon May 18, 2026
Same issue, would be great how can we help?
nexxeln commentedon May 19, 2026
are you using oh-my-openagent by any chance?
rekram1-node commentedon May 26, 2026
Cant reproduce, maybe a bug w/ ur plugins