Skip to content

[OpenCode v1.16.42] task 工具派发 subagent 时不使用 agent.md 配置的 model,继承父 session model #44680

Closed as not planned

Description

@Ethan918ye

Description

核心问题:task 工具创建子 agent session 时不读取 agent.md frontmatter 的 model 字段,而是继承 primary agent 的 model。导致 per-agent model 配置完全失效。

复现步骤:

配置 supervisor.md model: provider/GLM-5.2,data-engineer.md model: provider/Qwen3.8-27B
opencode debug agent data-engineer 确认配置被正确解析(modelID=Qwen3.8-27B)
supervisor 通过 task 工具派发 data-engineer
检查 workspace dat 的 workspace:model-selection,子 session 实际用 GLM-5.2
根因:task 工具创建新 session 时不传递 agent 配置的 model,继承父 session model 选择。

期望行为:task 工具应使用子 agent 配置的 model,仅在未配置时回退到父 session model。

证据文件:opencode.workspace..dat 中的 workspace:model-selection 字段

环境影响:无法为不同专业 agent 分配不同模型(如推理模型给 supervisor、代码生成模型给 simulation-agent)

Plugins

No response

OpenCode version

OpenCode v1.16.42

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Aug 24, 2026

    @github-actions
    Contributor

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

    Please review those issues to see if your report is already tracked there.

  2. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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