[建议 / Feature] Goal 完成验证器增加 blocked 判定:受阻目标自动置为 paused,消除"等待人工输入"式无限空转
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
提交前确认 · Pre-submission checklist
- 我已搜索过现有 issue,确认这不是重复提议(相关但不同的:#117 验证器连续 FAIL 的跟踪缺陷、#345 goal 模式队列 BUG、#47 提问工具死循环;本提议是独立的功能缺失)
- 我已阅读 CONTRIBUTING.md
问题类别 · Category
对话 / Agent 交互 · Agent chat / interaction
涉及的 Agent 框架 · Agent framework
ZCode Agent(自研)
使用场景与问题描述 · Scenario
Goal(目标循环)缺少"受阻/blocked"终止路径,导致目标卡在只能由人工完成的工作时无限空转烧 token。
机制取证(基于 3.10.2 运行时反编译,.zcode/resources/glm/zcode.cjs):
- 完成验证器仅返回二值结论
{"passed": boolean, "reason": string, "nextAction": string},提示词明确要求 "When in doubt, set the passed property to false",且没有任何与"受阻/等待人工"相关的判定分支; - 工作模型每轮被注入 "Continue working toward the active session goal. ",同时被要求 "Do not mark the goal complete yourself. The runtime will run a completion verifier after this turn";
- goal 状态枚举为
["active", "paused", "budget_limited", "complete"]——paused存在,但没有任何自动路径会设置它,只能人工点击。
三者叠加的后果:当目标剩余工作只能由人工完成(凭据轮换、杠杆授权、风险参数确认等)时,工作模型诚实地报告"等待人工输入",验证器"正确地"判定未完成,循环在结构上无法终止。
实际案例:一次量化项目审查目标,工作模型连续 517+ 次迭代输出完全相同的状态("目标关闭,等待人工输入……解锁开关任一就绪时告知即可"),每轮约 5 秒、双份模型调用(工作 + 验证),全程无任何状态变化,直到人工发现并手动停止。
复现路径
- 创建一个 goal,使其在执行中必然到达"需要人工决策/凭据/授权"的节点(例如:目标依赖一个未配置的凭据);
- 不设置 token 预算;
- 观察:工作模型每轮输出"等待人工输入"类状态,验证器每轮判 notSatisfied,循环持续数百轮。
建议方案 · Proposed solution
为完成验证器增加第三种结论 blocked:
- 验证器检测到以下任一情况时返回 blocked 而非 notSatisfied:工作模型连续 N 轮(建议 2-3)输出语义等价的状态;或工作模型在最终消息中输出显式阻塞标记;
- goal 状态自动置为已有的
paused,UI 通过现有"暂停目标/继续目标"横幅提示用户介入; - 用户处理阻塞后点"继续目标"恢复循环。
这与现有状态机完全兼容(paused 已存在),改动集中在验证器提示词与结论解析(CZ 函数)及一处状态转移。
预期价值 · Expected value
- 消除最昂贵的空转形态:每轮烧工作 + 验证双份 token,案例中单次目标空转 500+ 轮;目标带预算的用户损失直接真金白银;
- "目标卡在人工节点"是 agent 长时任务的常见形态,blocked→paused 是此类产品的标准做法(Claude Code / Cursor 的后台任务均有类似人工介入暂停机制)。
你认为的优先级 · Your perceived priority
高 · High
ZCode 版本 / 环境 · Version / environment
ZCode Desktop 3.10.2 (build 6414), Windows x64
补充材料 · Additional context
用户侧已验证的临时缓解(供其他用户参考,官方实现前建议写进文档):
- 在目标文本末尾显式写入受阻退出条件,利用"目标原文是验证器权威判定依据"的特性,把"输出阻塞报告"定义为合法完成态:
受阻退出条件:若遇到只能由人工完成的阻塞(凭据缺失、需资金/杠杆授权、需人工确认风险参数),输出阻塞报告(阻塞原因+已完成部分+解锁选项)即视为本轮目标达成,停止迭代等待人工处理。
- 强制设置 token 预算(budget_limited 是唯一不依赖判断的硬闸),不要创建无预算的 goal。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing .zcode/resources/glm/zcode.cjs from the reported ZCode 3.10.2 runtime evidence, focusing on completion-verifier parsing and goal state transitions. Trace how the existing paused state is handled and identify the verifier and transition points described in the issue; done means a blocked result pauses the goal and allows the existing resume flow to continue it.
Written by the indexing model from the issue text.
Assessment
- Domain
- ai
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100