From b7631c71a81592b01ffe9b2d35bbb651b97eed56 Mon Sep 17 00:00:00 2001 From: weichen Date: Thu, 1 Oct 2026 13:29:55 +0000 Subject: [PATCH] Pin the harness turn loop across the three native checkouts Why: the direct chat path and both consumers must compile the same agent-native commit, or the new loop fields exist in only one replace target. Evidence: make test passed (boundaries, core, backend, frontend 51, ui 71, agent-command). The three agent-native gitlinks are a34689c. Impact: Dev pins deps/agent-native, deps/agent-squad, and modules/backend. Squad behavior stays on the zero-value kernel switches. Refs: feature/agent-harness-p1 Co-authored-by: Cursor --- .task/feature-agent-harness-p1.md | 18 ++++++++++++++---- deps/agent-native | 2 +- deps/agent-squad | 2 +- modules/backend | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.task/feature-agent-harness-p1.md b/.task/feature-agent-harness-p1.md index 87ea63b4..af813fa7 100644 --- a/.task/feature-agent-harness-p1.md +++ b/.task/feature-agent-harness-p1.md @@ -6,11 +6,14 @@ - 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 701d4ab1e351b83bbc05c1b3f306467941064805 - 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-agent-harness-p1(worktree);分支:feature/agent-harness-p1 -- 授权与交付终点:<本次允许的动作与终点;未授权事项写明> +- 授权与交付终点:实现 P1(直连改走 runtime.Run,内核新能力默认关闭)。允许改 agent-native、backend、agent-squad 与 Dev 的 gitlink,并在各仓 feature/agent-harness-p1 上提 PR。未授权:合入 main、改小队行为、做 P2 计划回灌或 P3 子代理。 +- precheck(2026-10-01):verdict READY;R0=701d4ab1e351b83bbc05c1b3f306467941064805;branch=main head=701d4ab1e3;ahead=0 behind=0;tree clean。 ## 目标与非目标 -<预期结果、受影响入口/模块/契约;明确不做什么。> +- 目标:直连 LLMRunner 改为 runtime.Run 适配;内核补 Stop、工具钩子、提醒、重复调用提醒、length 续写与 FinishReason。新字段零值保持今天的行为,P1 只给直连打开 RepeatGuard 与 ContinueOnLength。 +- 非目标:不改小队路径;不实现 Reminders 的计划回灌(P2);不改 SubLLMRunner / delegate_task(P3)。 +- 裁定:Stop 在 follow-up 排空之后才看;两者同时设置时,本轮有 follow-up 就不调用 Stop。length 续写优先于 follow-up 与 Stop。History 只在会话转录为空时作为初始转录,且不回写进 Session。 ## 同步记录 @@ -20,6 +23,13 @@ ## 结果与验证(完成后填写) -- 结果: +- 结果:直连 `LLMRunner` 改为 `runtime.Run` 适配。内核新增可选的 Stop、BeforeTool/AfterTool、Reminders、RepeatGuard、ContinueOnLength、History、UnknownTool 与 `llm.Event.FinishReason`。直连打开 RepeatGuard 与 ContinueOnLength;小队不设置这些字段。三处 agent-native gitlink 同为 `a34689c`(Dev `deps/agent-native`、backend `deps/agent-native`、agent-squad `deps/agent-native`)。 +- 指针:agent-native `a34689c`,backend `cfcf95d`,agent-squad `590fd86`。 +- 裁定:未在画像里声明、但模型仍然发出的工具调用走 `UnknownTool`,零值保持 unknown tool 错误。注册表 schema 用宽松 object,真实 schema 仍经流式请求声明,避免空参数被内核校验提前拒绝。 - 验证: -- 影响与剩余项: + - precheck(启动):verdict READY;R0=701d4ab1e351b83bbc05c1b3f306467941064805;head=701d4ab1e3;ahead=0 behind=0;tree clean。 + - agent-native `go test ./...` 通过。 + - backend `go test ./...` 通过。现有 `internal/runtime` 断言未改;新增工具整批超限落库与 length 续写。 + - agent-squad `scripts/submodule-consistency.sh` 全部 ok;`go test ./...` 通过。 + - Dev `make test` 通过(boundaries ok,core/backend go test,frontend vitest 51,ui vitest 71,agent-command ok)。 +- 影响与剩余项:合入顺序为 Agent-Native,然后 Backend 与 Agent-Squad,最后 Dev。未合入。P2 的 Reminders 仍为 nil。小队行为留到 P3。 diff --git a/deps/agent-native b/deps/agent-native index 6b7d2432..a34689c7 160000 --- a/deps/agent-native +++ b/deps/agent-native @@ -1 +1 @@ -Subproject commit 6b7d2432b3bc4f2bbdbde12c26d0c83f09450f47 +Subproject commit a34689c78fbddbfa34b343cd6f85cca36c4d2f9d diff --git a/deps/agent-squad b/deps/agent-squad index 5cbac00b..590fd86f 160000 --- a/deps/agent-squad +++ b/deps/agent-squad @@ -1 +1 @@ -Subproject commit 5cbac00b994223b6aa76afd9bc70277b8b49e985 +Subproject commit 590fd86f4c8bfada0ec76efbfb57133c61607bd6 diff --git a/modules/backend b/modules/backend index 188c6335..cfcf95d3 160000 --- a/modules/backend +++ b/modules/backend @@ -1 +1 @@ -Subproject commit 188c63357cccd7fe028af23621396e51be59f449 +Subproject commit cfcf95d33524d5313f2cd967c8632553f28662b2