Skip to content

seat 的 helper 指示、README 与仿真按 task.maxRecursionDepth 描述 seat 的 task - #274

Merged
RiriAgent merged 3 commits into
mainfrom
issue-269
Dec 1, 2026
Merged

RiriAgent merged 3 commits into
mainfrom
issue-269

Conversation

@RiriAgent

Copy link
Copy Markdown
Member

Closes #269

摘要

seat agent 的 helper 指示、README 与 tree 仿真都改为按 OMP 的 task.maxRecursionDepth 描述 seat 的 task:宿主默认 1 时 seat 没有 task,也不被要求使用 helper;设为 2 及以上或 -1 时 seat 照旧有 task。Dispatch 既不修改这个设置,也不重复宿主的深度判断。

实现说明

  • 机制:
    • seat 能否拿到 task 由宿主决定。seat 以 taskDepth: 1 建会话(src/ports/host.ts launch,未改动),宿主在工具计划里用 canUseTaskTool(即 canSpawnAtDepth(maxRecursionDepth, taskDepth),19.4.0 src/tools/registry.ts:654-656)过滤 task(同文件 :857)。设置重算时宿主用同一份计划,所以上限在 seat 运行中被调高时,seat 也会拿到 task。
    • agents/dispatch-owner.md、agents/dispatch-reviewer.md 的 helper 句子改为以「有 task 工具」为前提(结果 2)。
    • README.md「Sessions and recovery」写明 seat 只有在上限为 2 及以上或 -1 时才有 task、能派生 helper,并写明 Dispatch 不修改该设置(结果 3)。
  • 实现选择与偏离:
    • 沿用 issue 决策表,不在 seat 设置上叠加 task.maxRecursionDepth,也不按设置生成两份提示。
    • 不在 Dispatch 里按 canSpawnAtDepth 决定是否为 seat 请求 task。宿主已经按同一规则过滤,重复判断还会让 seat 在上限调高后经设置重算也拿不到 task。
  • 不变边界(结果 4):seat 的工具请求、spawns(取 agent 定义,未指定时为 *)与 taskDepth 都不变。上限 ≥ 2 或 -1 时,seat 照旧有 task。Main 不受影响,它的 taskDepth 是 0。
  • 仿真:
    • tests/sim/run.ts 给 Case/Run 增加 maxRecursionDepth(默认 1)。每次启动都把它写进仿真的 omp-config.yml,所以结果不受运行者 HOME 设置的影响。
    • tree 在上限 1 下断言 seat 没有 task(结果 1)。新增的 tree-nested 复用 tree 的 delivery,在上限 2 下断言每个 seat 都有 task 且 spawns 为 *(结果 4)。其余用例只是显式固定为 1,它们的断言不涉及 task。
    • 仿真原本给每个 seat 写一个合成的 sim-seat agent,seat 系统提示里没有打包 agent 的正文。新用例 head-packaged 复用 head 的 delivery,但改用默认 workflow 和原样复制的打包 agent 文件,并经 task.agentModelOverrides 把这两个 agent 指到脚本化模型 sim/seat。任一 seat 在 dispatch-session-contract 中记录的系统提示不含其打包 agent 正文时,这个用例失败(结果 2)。
  • 未验证与风险:-1 只经宿主 canSpawnAtDepth(max < 0)推断与 2 同样放行,仿真没有单独跑 -1。

- Seat spawning now conditionally includes task tool based on canSpawnAtDepth(cfgTaskMaxRecursionDepth.get(settings), 1) in src/ports/host.ts.
- Dispatch owner and reviewer docs updated to condition task on having the tool in agents/dispatch-owner.md and agents/dispatch-reviewer.md.
- README.md updated to note task recording requirement in tree simulation.
- Tests/sim/run.ts updated with maxRecursionDepth config and task presence assertions.

Refs #269
- Sim test setup now copies real agents from agents/ directory when packagedAgents is true.
- Config now includes agentModelOverrides mapping workflow agents to sim/seat when packagedAgents enabled.
- Added head-packaged test case based on head case with packagedAgents set to true.
- New check verifies seat dispatch-session-contract systemPrompt includes agent body text.

Refs #269
- Removed imports for cfgTaskMaxRecursionDepth and canSpawnAtDepth.
- Always include "task" tool in seat agentTools list.
- Set taskDepth to 1 instead of SEAT_TASK_DEPTH constant.

Refs #269
@RiriAgent

Copy link
Copy Markdown
Member Author

证据包

由 ghc 生成 · issue #269 · 结果摘要 ac15d67d7c71 · 4/4 条结果齐全 · 未观察的面 无 · 生成于 2026-12-01T16:19:24.584Z
检出 99abb83 patch 36773443c08d8557d0545ea333bc9d641fdf1757

结果 类型 面 步骤 状态 命令 记录
1 改 library run 已记录 sh -c 'echo "$(omp --version) HEAD=$(git rev-parse --short HEAD)"; HOME=/tmp/omp1940/work/plugin-omp-dispatch/home-default bun tests/sim/run.ts tree > /tmp/omp1940/work/plugin-omp-dispatch/ev269-r1.log 2>&1; s=$?; cat /tmp/omp1940/work/plugin-omp-dispatch/ev269-r1.log; sh /tmp/omp1940/work/plugin-omp-dispatch/seat-tools.sh /tmp/omp1940/work/plugin-omp-dispatch/ev269-r1.log; exit $s' exit 0 · 34.8s
2 改 agent-config session 已记录 sh -c 'echo "$(omp --version) HEAD=$(git rev-parse --short HEAD)"; HOME=/tmp/omp1940/work/plugin-omp-dispatch/home-default bun tests/sim/run.ts head-packaged > /tmp/omp1940/work/plugin-omp-dispatch/ev269-r2.log 2>&1; s=$?; cat /tmp/omp1940/work/plugin-omp-dispatch/ev269-r2.log; sh /tmp/omp1940/work/plugin-omp-dispatch/seat-tools.sh /tmp/omp1940/work/plugin-omp-dispatch/ev269-r2.log prompts; exit $s' exit 0 · 3.6s
3 改 library run 已记录 sh -c 'echo HEAD=$(git rev-parse --short HEAD); grep -n -o '\''A seat is a first-level subagent[^.]*\.[^.]*\. Dispatch never changes that setting\.'\'' README.md; echo "unconditional task mentions: $(grep -c '\''including ˋtodoˋ, ˋtaskˋ'\'' README.md)"' exit 0 · 0.0s
4 保持 library run 已记录 sh -c 'echo "$(omp --version) HEAD=$(git rev-parse --short HEAD)"; HOME=/tmp/omp1940/work/plugin-omp-dispatch/home-default bun tests/sim/run.ts tree-nested > /tmp/omp1940/work/plugin-omp-dispatch/ev269-r4.log 2>&1; s=$?; cat /tmp/omp1940/work/plugin-omp-dispatch/ev269-r4.log; sh /tmp/omp1940/work/plugin-omp-dispatch/seat-tools.sh /tmp/omp1940/work/plugin-omp-dispatch/ev269-r4.log; exit $s' exit 0 · 32.3s

结果 1 · 改功能 · library

在 task.maxRecursionDepth 为宿主默认 1 的 omp 19.4.0 上跑一次 delivery,宿主按递归上限不给 seat task,seat 记录的工具里没有 task;tree 仿真按这一行为检查,不再报 seat lacks task,delivery 照常完成。

  • run(99abb83,记录 20261201T161728Z-8304d9)看点:首行 omp/19.4.0 与 HEAD=99abb83;PASS tree(tree 在 seat 缺 dispatch 工具、seat 记录了 task 或 agenda 未完成时都报 FAIL);仿真 omp-config.yml 为 task.maxRecursionDepth: 1;逐个 seat 会话的 session_init 读数都是 task=false spawns=*

结果 2 · 改功能 · agent-config

agents/dispatch-owner.md 与 agents/dispatch-reviewer.md 的 helper 指示只在 seat 有 task 工具时适用;seat 会话的系统提示里不再有无条件要求使用 helper 的句子。

  • session(99abb83,记录 20261201T161839Z-44052f)看点:首行 omp/19.4.0 与 HEAD=99abb83;PASS head-packaged:seat 由打包的 dispatch-owner/dispatch-reviewer 扮演(omp-config.yml 的 agentModelOverrides 指向 sim/seat);每个 seat 会话 dispatch-session-contract 记录的系统提示里,helper 句子都以 'When you have the task tool' 开头,没有无条件的 helper 句子;同一会话 task=false

结果 3 · 改功能 · library

README 写明 seat 只有在 task.maxRecursionDepth 为 2 及以上或 -1 时才有 task、能派生 helper,宿主默认 1 下没有。

  • run(99abb83,记录 20261201T161906Z-af6834)看点:README 第 186 行原文:seat 只有在 task.maxRecursionDepth 为 2 及以上或 -1 时才有 task、可派生 helper,OMP 默认 1(或 0)下 seat 没有 task、不用 helper,Dispatch 不改该设置;'including todo, task' 这种无条件表述计数为 0

结果 4 · 保持不变 · library

task.maxRecursionDepth 为 2(或 -1)时,每个 seat 仍记录 task 且 spawns 为 *,与升级前相同。

  • run(99abb83,记录 20261201T161805Z-535790)看点:首行 omp/19.4.0 与 HEAD=99abb83;PASS tree-nested;仿真 omp-config.yml 为 task.maxRecursionDepth: 2;逐个 seat 会话的 session_init 读数都是 task=true spawns=*
结果 1 run · exit 0 · sh -c 'echo "$(omp --version) HEAD=$(git rev-parse --short HEAD)"; HOME=/tmp/omp1940/work/plugin-omp-dispatch/home-default bun tests/sim/run.ts tree > /tmp/omp1940/work/plugin-omp-dispatch/ev269-r1.log 2>&1; s=$?; cat /tmp/omp1940/work/plugin-omp-dispatch/ev269-r1.log; sh /tmp/omp1940/work/plugin-omp-dispatch/seat-tools.sh /tmp/omp1940/work/plugin-omp-dispatch/ev269-r1.log; exit $s'

cwd /private/tmp/omp1940/work/plugin-omp-dispatch/omp-dispatch-269 · /bin/sh · 2026-12-01T16:17:28.886Z – 2026-12-01T16:18:03.636Z · 工作区干净 · 记录 20261201T161728Z-8304d9

stdout(共 39 行):

omp/19.4.0 HEAD=99abb83
PASS tree (34.4s) /tmp/dispatch-sim-tree-pm5gLY
run dir: /tmp/dispatch-sim-tree-pm5gLY
--- omp-config.yml
retry:
  enabled: false
task:
  maxRecursionDepth: 1
--- seat sessions
A1 owner: task=false spawns=*
A2 owner: task=false spawns=*
B1 owner: task=false spawns=*
A1 review: task=false spawns=*
A1 accept: task=false spawns=*
C owner: task=false spawns=*
A2 review: task=false spawns=*
A2 accept: task=false spawns=*
B1 review: task=false spawns=*
B1 accept: task=false spawns=*
A1 postMerge: task=false spawns=*
D owner: task=false spawns=*
C review: task=false spawns=*
C accept: task=false spawns=*
A2 postMerge: task=false spawns=*
B1 postMerge: task=false spawns=*
E owner: task=false spawns=*
C owner: task=false spawns=*
C review: task=false spawns=*
C accept: task=false spawns=*
D owner: task=false spawns=*
C postMerge: task=false spawns=*
B2 owner: task=false spawns=*
D review: task=false spawns=*
D accept: task=false spawns=*
B2 review: task=false spawns=*
B2 accept: task=false spawns=*
D postMerge: task=false spawns=*
B2 postMerge: task=false spawns=*
b461087c-b14b-46e7-9694-457764e2ac7f/closure closure: task=false spawns=*
结果 4 run · exit 0 · sh -c 'echo "$(omp --version) HEAD=$(git rev-parse --short HEAD)"; HOME=/tmp/omp1940/work/plugin-omp-dispatch/home-default bun tests/sim/run.ts tree-nested > /tmp/omp1940/work/plugin-omp-dispatch/ev269-r4.log 2>&1; s=$?; cat /tmp/omp1940/work/plugin-omp-dispatch/ev269-r4.log; sh /tmp/omp1940/work/plugin-omp-dispatch/seat-tools.sh /tmp/omp1940/work/plugin-omp-dispatch/ev269-r4.log; exit $s'

cwd /private/tmp/omp1940/work/plugin-omp-dispatch/omp-dispatch-269 · /bin/sh · 2026-12-01T16:18:05.180Z – 2026-12-01T16:18:37.501Z · 工作区干净 · 记录 20261201T161805Z-535790

stdout(共 39 行):

omp/19.4.0 HEAD=99abb83
PASS tree-nested (32.0s) /tmp/dispatch-sim-tree-nested-618xr9
run dir: /tmp/dispatch-sim-tree-nested-618xr9
--- omp-config.yml
retry:
  enabled: false
task:
  maxRecursionDepth: 2
--- seat sessions
A1 owner: task=true spawns=*
A2 owner: task=true spawns=*
B1 owner: task=true spawns=*
A1 review: task=true spawns=*
A1 accept: task=true spawns=*
C owner: task=true spawns=*
A2 review: task=true spawns=*
A2 accept: task=true spawns=*
B1 review: task=true spawns=*
B1 accept: task=true spawns=*
A1 postMerge: task=true spawns=*
D owner: task=true spawns=*
C review: task=true spawns=*
C accept: task=true spawns=*
A2 postMerge: task=true spawns=*
B1 postMerge: task=true spawns=*
E owner: task=true spawns=*
C owner: task=true spawns=*
C review: task=true spawns=*
C accept: task=true spawns=*
D owner: task=true spawns=*
C postMerge: task=true spawns=*
B2 owner: task=true spawns=*
D review: task=true spawns=*
D accept: task=true spawns=*
B2 review: task=true spawns=*
B2 accept: task=true spawns=*
D postMerge: task=true spawns=*
B2 postMerge: task=true spawns=*
3485eae2-7f62-41e8-89f6-91441858295e/closure closure: task=true spawns=*
结果 2 session · exit 0 · sh -c 'echo "$(omp --version) HEAD=$(git rev-parse --short HEAD)"; HOME=/tmp/omp1940/work/plugin-omp-dispatch/home-default bun tests/sim/run.ts head-packaged > /tmp/omp1940/work/plugin-omp-dispatch/ev269-r2.log 2>&1; s=$?; cat /tmp/omp1940/work/plugin-omp-dispatch/ev269-r2.log; sh /tmp/omp1940/work/plugin-omp-dispatch/seat-tools.sh /tmp/omp1940/work/plugin-omp-dispatch/ev269-r2.log prompts; exit $s'

cwd /private/tmp/omp1940/work/plugin-omp-dispatch/omp-dispatch-269 · /bin/sh · 2026-12-01T16:18:39.253Z – 2026-12-01T16:18:42.877Z · 工作区干净 · 记录 20261201T161839Z-44052f

stdout(共 24 行):

omp/19.4.0 HEAD=99abb83
PASS head-packaged (3.4s) /tmp/dispatch-sim-head-packaged-vfxkbi
run dir: /tmp/dispatch-sim-head-packaged-vfxkbi
--- omp-config.yml
retry:
  enabled: false
task:
  maxRecursionDepth: 1
  agentModelOverrides:
    dispatch-owner: sim/seat
    dispatch-reviewer: sim/seat
--- seat sessions
H owner: task=false spawns=*
    prompt: When you have the `task` tool and helpers are useful, give them bounded work and inspect their artifacts and evidence; you remain accountable for the complete ticket.
H review: task=false spawns=*
    prompt: When you have the `task` tool, helpers may investigate bounded questions, but their conclusions require your acceptance.
H accept: task=false spawns=*
    prompt: When you have the `task` tool, helpers may investigate bounded questions, but their conclusions require your acceptance.
H accept: task=false spawns=*
    prompt: When you have the `task` tool, helpers may investigate bounded questions, but their conclusions require your acceptance.
H review: task=false spawns=*
    prompt: When you have the `task` tool, helpers may investigate bounded questions, but their conclusions require your acceptance.
H postMerge: task=false spawns=*
    prompt: When you have the `task` tool, helpers may investigate bounded questions, but their conclusions require your acceptance.
结果 3 run · exit 0 · sh -c 'echo HEAD=$(git rev-parse --short HEAD); grep -n -o '\''A seat is a first-level subagent[^.]*\.[^.]*\. Dispatch never changes that setting\.'\'' README.md; echo "unconditional task mentions: $(grep -c '\''including `todo`, `task`'\'' README.md)"'

cwd /private/tmp/omp1940/work/plugin-omp-dispatch/omp-dispatch-269 · /bin/sh · 2026-12-01T16:19:06.409Z – 2026-12-01T16:19:06.428Z · 工作区干净 · 记录 20261201T161906Z-af6834

stdout(共 3 行):

HEAD=99abb83
186:A seat is a first-level subagent of Main, so it gets `task` and may delegate to helper agents (`spawns` follows the agent definition, `*` when unspecified) only when `task.maxRecursionDepth` is `2` or higher, or `-1`; under OMP's default `1` (or `0`) seats have no `task` and work without helpers. Dispatch never changes that setting.
unconditional task mentions: 0

@RiriAgent

Copy link
Copy Markdown
Member Author

Gate 结论 · review · PASS · patch 36773443c08d8557d0545ea333bc9d641fdf1757 · HEAD 99abb83 · base main · issue rev 2026-12-01T16:15:43Z · 设计 无

结论:PASS

  • 机制与边界(问题 1):seat 仍以 taskDepth: 1 建会话,task 由宿主过滤(src/ports/host.ts:287,332 未改;宿主 19.4.0 src/tools/registry.ts:654-656,857、src/task/types.ts:282-283),与 issue 决策表一致。helper 指示改为条件句(agents/dispatch-owner.md:8、agents/dispatch-reviewer.md:10);README 写明宿主规则(README.md:186),仿真说明同步更新(README.md:212,216)。diff 只动 CHANGELOG、README、两个 agent 定义和 tests/sim/run.ts。
  • 测试(问题 2):仓库没有 test 检查,四条结果都由证据记录证明。仿真经真实 omp RPC 入口运行:tree 按深度断言 task 的有无(tests/sim/run.ts:813-825);tree-nested 覆盖深度 2(tests/sim/run.ts:1427-1428);head-packaged 用默认 workflow 和打包 agent 正文(tests/sim/run.ts:130-137,1436-1455)。
  • 冗余(问题 3):没有兼容分支、兜底或死代码;旧的无条件检查与表述已被替换。
  • 证据包(问题 4):
    • 结果 1,20261201T161728Z-8304d9:omp/19.4.0、HEAD 99abb83、PASS tree;配置为 maxRecursionDepth: 1,每个 seat 的读数都是 task=false spawns=*。
    • 结果 2,20261201T161839Z-44052f:PASS head-packaged;每个 seat 记录的系统提示中,helper 句子都以 "When you have the task tool" 开头,同一会话 task=false。
    • 结果 3,20261201T161906Z-af6834:引用 README.md:186 原文,无条件表述计数为 0。它取代了 grep 未命中的 20261201T161844Z-b787f0。
    • 结果 4,20261201T161805Z-535790:PASS tree-nested,每个 seat 的读数都是 task=true spawns=*。
  • 未覆盖(问题 5):
    • -1 与 0 没有单独跑仿真,-1 只能从宿主的 max < 0 分支推断。
    • delivery 进行中修改上限的情形没有证据。rework fork 恢复首个 seat 记录的工具列表(src/ports/host.ts:309-315,364-368),所以上限在 delivery 中途被调高时,fork 可能仍然没有 task。这是改动前就有的行为,不在本 issue 的结果之内。
  • 范围外:design/requirements.md:69 写 judge seat 不能派生 subagent,与 agents/dispatch-reviewer.md:10 的条件式 helper 指示之间的张力早于本 PR。

下一步:合并。

@RiriAgent
RiriAgent merged commit 200d8fd into main Dec 1, 2026
1 check passed
@RiriAgent
RiriAgent deleted the issue-269 branch December 1, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omp 19.4.0 默认 task.maxRecursionDepth 为 1 时 seat 没有 task,提示与 README 仍要求使用 helper

1 participant