死循环提醒(designs/runtime-borrow.md §4;借 Keelson Advisors/DeadLoopAdvisor.cs,
它又借 keel dead-loop-filter)。
模型在两三个调用之间打转(读同一个文件、查同一个状态),每轮都成功,所以失败保护
(filter.tool-guard)管不到。本 filter 记最近 :window 轮的调用指纹,最近 :recent
轮里不超过 :distinct 种、且这几轮没有真进展 → 给下一轮挂一条临时提醒
(react 的 :notes 挂点:只附在那一次请求末尾,不进 ChatMemory)。
⛔ 只提醒、不阻断:误阻断会把正在做的事拦腰截断,漏检只是多烧几轮 token (上面还有 max-iterations 与 tool-guard)。提醒过就清空窗口。
挂法::iteration + :turn(后者在新 turn 开始时清零状态)。状态按 conversation-id
放在 filter 闭包里——只是提醒,不进暂停快照,丢了无害。
死循环提醒(designs/runtime-borrow.md §4;借 Keelson `Advisors/DeadLoopAdvisor.cs`, 它又借 keel `dead-loop-filter`)。 模型在两三个调用之间打转(读同一个文件、查同一个状态),每轮都**成功**,所以失败保护 (`filter.tool-guard`)管不到。本 filter 记最近 `:window` 轮的调用指纹,最近 `:recent` 轮里不超过 `:distinct` 种、且这几轮没有真进展 → 给**下一轮**挂一条临时提醒 (react 的 `:notes` 挂点:只附在那一次请求末尾,不进 ChatMemory)。 ⛔ **只提醒、不阻断**:误阻断会把正在做的事拦腰截断,漏检只是多烧几轮 token (上面还有 max-iterations 与 tool-guard)。提醒过就清空窗口。 挂法:`:iteration` + `:turn`(后者在新 turn 开始时清零状态)。状态按 conversation-id 放在 filter 闭包里——只是提醒,不进暂停快照,丢了无害。
(dead-loop-filter &
{:keys [window recent distinct reminder writes progress?]
:or
{window 6 recent 4 distinct 2 reminder default-reminder}})死循环提醒 filter。
opts:
死循环提醒 filter。 opts: - :window 记几轮(缺省 6) - :recent 看最近几轮(缺省 4) - :distinct 最多几种算打转(缺省 2) - :reminder 提醒文案 - :writes 写工具名集合:这些工具成功 = 有进展,清空窗口 - :progress? (fn [calls errors] -> bool) 完全自定义进展判据(优先于 :writes)
(round-print calls)一轮调用的指纹:每个调用「名字:规范化参数」截前 100 字符,排序后拼接。
一轮调用的指纹:每个调用「名字:规范化参数」截前 100 字符,排序后拼接。
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |