AgentLoop
英文标题:AgentLoop
AgentLoop 在每个循环中都会启动新的 Codex worker 和 critic,但不会累积 critic 的历史反馈。只有上一轮 critic 的修复建议会被注入下一轮 worker 提示词,持续状态由每轮重写的 `STATE.md` 承载。系统通过 PASS 终止循环、限制 `maxCycles` 为 1 至 10(默认 3),并利用仅含 IMPROVE 或 SHIP 的润色模式避免已通过的代码被重新否决。不过,无状态 critic 仍可能在不同轮次提出相互矛盾的要求,因此开发者需要依靠明确的 `GUIDELINES` 或固定检查清单来维持评估一致性。
2.2 KB
8.6 KB
9.4 KB
5.7 KB
10.4 KB
5.0 KB
790 B
648 B
797 B
718 B
829 B
603 B
中文
@dipankar_sarkar 是的,你切中了关键点。
它们不会累积。只有上一位 critic 的修复建议行会被注入下一轮 worker 的提示词。真正持续传递的是 STATE.md,而且 worker 会在每个循环中重写它。critic 甚至不会读取 STATE.md;它只会看到 PLAN.md、GUIDELINES.md 和实际文件。
这是有意为之,也正因如此我尚未遇到反复横跳的问题。PASS 会结束循环,因此已经完成的代码不会被重复投票两次。启用润色模式后,润色 critic 只能返回 IMPROVE 或 SHIP,其语法中根本没有 FAIL,因此它无法推翻此前的 PASS。如果某些内容出现回归,它会返回 IMPROVE,然后恢复被破坏的部分。
上限是硬性限制。maxCycles 的范围为 1 到 10,默认值为 3。润色没有单独的预算,它只会使用 PASS 之后剩余的循环次数。
不过,你的观点依然成立。无状态 critic 无法阻止自己在第 1 轮要求 X、而在第 3 轮要求非 X。唯一能维持这条标准线的是客观的 GUIDELINES 条目;如果评估标准较为宽泛,那么你提出的两次通过规则可能确实更合适。
你使用的是自由形式的评估,还是固定检查清单?我怀疑这才是真正的变量。
English / 原文
@dipankar_sarkar Yeah, you're poking at the right spot.
They don't accumulate. Only the last critic's fix line gets injected into the next worker prompt. STATE.md is the thing that carries, and the worker rewrites it every cycle. The critic doesn't even read STATE.md, it only sees PLAN.md, GUIDELINES.md and the actual files.
That's on purpose, and it's why I haven't hit the flip-flop. PASS ends the loop, so finished code never gets voted on twice. With polish mode on, the polish critic can only return IMPROVE or SHIP, there's literally no FAIL in the grammar, so it can't take a PASS back. If something regressed it comes back as IMPROVE, restore whatever broke.
Cap is hard. maxCycles 1 to 10, default 3. Polish doesn't get its own budget, it just spends whatever cycles are left after the PASS.
Your point still lands though. Stateless critic means nothing stops it asking for X in cycle 1 and not-X in cycle 3. Objective GUIDELINES items are the only thing holding that line, and if the rubric is loose your two-pass rule is probably the right call.
Was yours free-form or a fixed checklist? I suspect that's the actual variable.