AnyBot/docs/restructure/notes/b02g-agent-followthrough.md

23 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# b02g — `src/agent/followthrough.rs`(167 行):說了就做
## 目的
模型说「我接下来要做 X」却没调工具就结束 → 步无工具=回合结束,使用者要一直打「繼續」。纯规则检测(不调模型),发现只多给一个 quiet step(agent.rs Nudged)。
## 常量
- DONE_MARK=「〔到此為止〕」(模型答「其实已做完/该使用者决定」时只回这个,步作废、回合照旧结束)
- NUDGE_LINE=「說了要做還沒動手,提醒它接著做…」
- MAX_IN_A_ROW=2(连续无工具的 nudge 上限)、MAX_PER_TURN=12(护栏非预算)
## 检测(stopped_short → Option<Short>)
- Short::Announced(说了要做没调)/ AskedToGoOn(问「要我现在开始吗?」)。
- last_line(去 markdown)→ last_clause(最后一个。,;!之后)。
- 排除:DONE_MARK;PERSONS_CALL 不可收回词(刪/付款/寄出/格式化/reboot…,中英文)→ 交给使用者;问号→asks_to_go_on(ASK×GO_ON 两词表都有才命中——新提议「需要我幫你排住宿嗎?」不算);句尾:/…→Announced;announces:DONE 表(好了/完成/已經/記下來了/done…)与 LATER 表(之後/明天/later…)排除,NOW/NOW_EN 表(我來/讓我/let me /i'll…)命中。
- nudge(short):【AnyBot…】提示文(含 follow_up 指引、DONE_MARK 两情况例外)。
- is_done_mark:trim 空 或 含 DONE_MARK 且 ≤ 标记+12 字 → 收起。
## 测试锁
real_stops_are_caught(真实聊天记录 6 例+2 问例)、real_answers_are_left_alone(14 例不许打扰,含「等你一句話再刪。動手:」)、marker 测试。
## 迁移笔记
纯函数,进 core::agent。依赖 model.rs 无。