Skip to content

fix: workflow worker_type list excludes build and plan #507

Description

@LeXwDeX

Why

registry.ts:331-337 为 workflow 工具生成的 "Available workflow worker_type values" 动态列表用 mode !== "primary" 过滤(:281),把 buildplan 排除在外;但两个运行时权威恰恰依赖它们:

  • blocks 编译器默认映射 coding/prototype → build、plan 块 → planpackages/opencode/src/dag/blocks.ts:403-407
  • NodeSchema.worker_type 描述写明 "Agent type (explore, build, general, plan, or custom)"(packages/opencode/src/dag/validation.ts:191

三方矛盾:模型按列表无法得知可显式指定 build/plan,而 blocks.md 的 "Omit worker_type unless the exact configured agent name is already known" 让模型更不敢使用列表外名字——显式覆盖 coding 块 worker 的合法路径被文档堵死。

#499 划界#499 修的是 acceptance checklist 白名单与 runtime-compat catalog 对账(验收 harness);本 issue 修运行时工具描述生成(registry.ts)。不同 WHY、不同文件,互不重叠。

Scope

  • packages/opencode/src/tool/registry.tsdescribeAgents(:280-291)与 WorkflowTool 分支(:331-337)

Approach

describeAgents 增加显式选项(如 includePrimary),仅 WorkflowTool 分支启用;hidden 过滤保留(compaction/title/summary 仍被排除,primary+hidden 双重身份不泄漏);task 工具的列表行为不变。

Acceptance

  • 单测:workflow 工具描述的 worker_type 列表包含 buildplanexploregeneral(hidden 的 primary 不出现)
  • task 工具描述列表不含 build/plan(行为不变)
  • bun typecheck(packages/opencode)与相关测试全绿

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions