Skip to content

Subagent sessions created with model=undefined causing ProviderModelNotFoundError #33043

Closed as not planned

Description

@hariszaki17

Description

All built-in subagent types (general, explore, code-reviewer, etc.) fail with ProviderModelNotFoundError when spawned via the task tool. The subagent session is created with model=undefined instead of inheriting the agent's configured model.

Steps to Reproduce

  1. Use any built-in subagent type via the task tool:
    task(description="test", subagent_type="general", prompt="read a file")
    
  2. Observe the error: ProviderModelNotFoundError
  3. Check the opencode log at ~/.local/share/opencode/log/opencode.log

Log Evidence

message=created id=ses_... agent=general model=undefined ...
message="share subscriber failed" type=message.updated cause=Cause([Fail(ProviderModelNotFoundError)])

The model=undefined is visible in every subagent session creation log entry. The agent config correctly shows the model (e.g. deepseek/deepseek-v4-flash), but it is not passed to the spawned subagent session.

Agent Config (correct)

opencode debug agent general
  "native": true,
  "model": {
    "providerID": "deepseek",
    "modelID": "deepseek-v4-flash"

Environment

  • opencode version: 1.17.8 (also tested on 1.17.2 — same issue)
  • OS: macOS (darwin)
  • Provider: deepseek
  • Model: deepseek/deepseek-v4-flash

Workaround

All work must be done inline in the main thread — subagents cannot be used.

Activity

  1. github-actions commented on Jun 20, 2026

    @github-actions
    Contributor

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

  2. Necmttn commented on Jun 21, 2026

    @Necmttn

    Subagent spawn should record the model resolution chain before creating the child session: requested agent type, explicit override, parent model, agent config default, global default, final provider/model, and resolution source.

    If the chain resolves to undefined, fail before child creation with an actionable config error. Regression cases should cover built-in subagents inheriting the parent model, explicit per-agent overrides, missing provider config, and resume/continuation of a spawned child.


    Generated with ax.

  3. github-actions commented on Aug 21, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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