[Bug] bootstrap prompt 中的 workflow 示例有多处错误,新人照做会失败 #110

Closed
opened 2026-06-05 11:35:34 +00:00 by xiaonuo · 1 comment
Owner

环境

  • @united-workforce/cli 0.2.1-rc.0
  • @united-workforce/agent-hermes 0.1.2
  • 全新安装,按 uwf prompt bootstrap 的 Scenario A 步骤操作

问题

按 bootstrap prompt 的指示从头做到 Step 4,会在多个地方遇到阻塞。

1. examples/eval-simple.yaml 不存在

bootstrap Step 4 要求运行:

uwf thread start examples/eval-simple.yaml -p "Hello, test run"

但这个文件没有随 npm 包分发,也不在任何可发现的位置。用户无法完成 Step 4 的验证。

建议: 要么在 npm 包里包含示例文件,要么在 bootstrap prompt 里给出完整的内联 workflow YAML。

2. uwf prompt workflow-authoring 的示例缺少 capabilities 必填字段

parseWorkflowPayload() 中的 isRoleDefinition() 要求每个 role 必须有 capabilities 数组字段,但 workflow-authoring prompt 中的 workflow 示例没有包含这个字段:

roles:
  planner:
    description: "..."
    goal: "..."
    procedure: |
      ...
    output: "..."
    frontmatter: ...
    # 缺少 capabilities: []

用户照着写会报 invalid workflow YAML: expected WorkflowPayload shape

3. uwf prompt workflow-authoring$status 格式示例与 validate-semantic.js 不一致

workflow-authoring prompt 中推荐用 bare const 格式:

frontmatter:
  properties:
    $status: { const: "done" }

validate-semantic.jsparseFrontmatterSchema() 要求 $status 必须定义为 enumoneOf 中的 const。bare const 会被拒绝:

workflow validation failed:
  - role "responder" must define "$status" as an enum (or oneOf const) in frontmatter

正确写法应该是:

# flat schema
frontmatter:
  properties:
    $status:
      type: string
      enum:
        - done

# 或 oneOf 形式
frontmatter:
  oneOf:
    - properties:
        $status: { const: "done" }
      required: [$status]

4. hermes CLI 不在 PATH 中导致 uwf-hermes adapter 失败

uwf-hermes 通过 child_process.spawn("hermes", ["acp"]) 启动 Hermes ACP。但 Hermes 安装在 ~/.hermes/hermes-agent/.venv/bin/hermes,通常不在系统 PATH 中。用户装好 adapter 后直接 uwf thread exec 会得到:

agent run failed: hermes acp spawn failed: spawn hermes ENOENT

bootstrap prompt 应该在 Step 1 或 Step 2 中提示用户确保 hermes 命令在 PATH 中。

建议修复

  1. uwf prompt bootstrap 包含一个完整的、可直接使用的 eval workflow YAML(而不是引用不存在的文件)
  2. 所有 workflow 示例的 role 都加上 capabilities: [](或 capabilities: [...]
  3. 示例中的 $status 使用 enum 格式而非 bare const
  4. bootstrap Step 1 增加 PATH 检查提示:which hermes 应能找到 hermes 命令
## 环境 - `@united-workforce/cli` `0.2.1-rc.0` - `@united-workforce/agent-hermes` `0.1.2` - 全新安装,按 `uwf prompt bootstrap` 的 Scenario A 步骤操作 ## 问题 按 bootstrap prompt 的指示从头做到 Step 4,会在多个地方遇到阻塞。 ### 1. `examples/eval-simple.yaml` 不存在 bootstrap Step 4 要求运行: ```bash uwf thread start examples/eval-simple.yaml -p "Hello, test run" ``` 但这个文件没有随 npm 包分发,也不在任何可发现的位置。用户无法完成 Step 4 的验证。 **建议:** 要么在 npm 包里包含示例文件,要么在 bootstrap prompt 里给出完整的内联 workflow YAML。 ### 2. `uwf prompt workflow-authoring` 的示例缺少 `capabilities` 必填字段 `parseWorkflowPayload()` 中的 `isRoleDefinition()` 要求每个 role 必须有 `capabilities` 数组字段,但 `workflow-authoring` prompt 中的 workflow 示例没有包含这个字段: ```yaml roles: planner: description: "..." goal: "..." procedure: | ... output: "..." frontmatter: ... # 缺少 capabilities: [] ``` 用户照着写会报 `invalid workflow YAML: expected WorkflowPayload shape`。 ### 3. `uwf prompt workflow-authoring` 的 `$status` 格式示例与 `validate-semantic.js` 不一致 workflow-authoring prompt 中推荐用 bare `const` 格式: ```yaml frontmatter: properties: $status: { const: "done" } ``` 但 `validate-semantic.js` 的 `parseFrontmatterSchema()` 要求 `$status` 必须定义为 `enum` 或 `oneOf` 中的 `const`。bare `const` 会被拒绝: ``` workflow validation failed: - role "responder" must define "$status" as an enum (or oneOf const) in frontmatter ``` 正确写法应该是: ```yaml # flat schema frontmatter: properties: $status: type: string enum: - done # 或 oneOf 形式 frontmatter: oneOf: - properties: $status: { const: "done" } required: [$status] ``` ### 4. `hermes` CLI 不在 PATH 中导致 `uwf-hermes` adapter 失败 `uwf-hermes` 通过 `child_process.spawn("hermes", ["acp"])` 启动 Hermes ACP。但 Hermes 安装在 `~/.hermes/hermes-agent/.venv/bin/hermes`,通常不在系统 PATH 中。用户装好 adapter 后直接 `uwf thread exec` 会得到: ``` agent run failed: hermes acp spawn failed: spawn hermes ENOENT ``` bootstrap prompt 应该在 Step 1 或 Step 2 中提示用户确保 `hermes` 命令在 PATH 中。 ## 建议修复 1. 让 `uwf prompt bootstrap` 包含一个完整的、可直接使用的 eval workflow YAML(而不是引用不存在的文件) 2. 所有 workflow 示例的 role 都加上 `capabilities: []`(或 `capabilities: [...]`) 3. 示例中的 `$status` 使用 `enum` 格式而非 bare `const` 4. bootstrap Step 1 增加 PATH 检查提示:`which hermes` 应能找到 `hermes` 命令
Author
Owner

补充说明

本次测试使用的是 0.2.1-rc.0 版本。

小橘说 rc.1 已经修了一部分,等小橘这轮修完会是 rc.2

建议 rc.2 发布后,小糯(或其他 agent)用新版本重新走一遍 bootstrap 全流程,确认 4 个问题是否都已解决。如有遗漏再追加到本 issue。

## 补充说明 本次测试使用的是 **`0.2.1-rc.0`** 版本。 小橘说 **rc.1 已经修了一部分**,等小橘这轮修完会是 **rc.2**。 建议 rc.2 发布后,小糯(或其他 agent)用新版本重新走一遍 bootstrap 全流程,确认 4 个问题是否都已解决。如有遗漏再追加到本 issue。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/united-workforce#110