Skip to content

Subtask commands do not inherit model #6928

@JUVOJustin

Description

@JUVOJustin

Description

If running a command as a subtask, the model is not inherited from the agent but from the config.

Config

{
    "$schema": "https://opencode.ai/config.json",
    "autoupdate": true,
    "model": "opencode/big-pickle",
    "agent": {
        "build": {
            "model": "github-copilot/claude-sonnet-4.5",
            "permission": {
                "external_directory": "deny",
                "context7*": "allow"
            }
        },
        "plan": {
            "model": "github-copilot/gpt-5.1",
            "permission": {
                "external_directory": "deny",
                "context7*": "allow"
            }
        },
        "explore": {
            "model": "opencode/big-pickle"
        }
    },
    "mcp": {
        "context7": {
            "type": "remote",
            "url": "https://mcp.context7.com/mcp"
        }
    }
}

Plugins

No response

OpenCode version

1.1.2

Steps to reproduce

  1. New session
  2. Switch to another model than the agents default model. e.g. GLM 4.7
  3. Run the command
  4. Switch in the session of the command and see that the default model is used despite the previous selection
  5. Be sad that your precious github copilot premium requests are used

Screenshot and/or share link

https://www.loom.com/share/3215afd3c9154a17b79b861b30c39cc8

https://opncd.ai/share/uzhsRzKm

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions