Go to file
caoqianming 3c60c5c736 fix(loop): 堵失败聚集两裂缝——必填key被吞畸形走非流式重试 + RepeatGuard连续同错streak拦(bump 0.58.33)
扫近14天工具失败面板 top13 定位两条反复烧 token 的裂缝:

① 必填 key 被吞畸形(面板 #3 edit 缺 path,14次/13task/9用户,最广):
定层坐实是流式 wire 乱序(path 值碎片被吞进 old_str 尾部,独立 path 键消失),
跨 provider,非模型漏参。关键区别是 JSON parse 成功 → 既不命中
_malformed_tool_calls(只抓 parse 失败)、salvage 也救不了,一路漏到 executor
才报错反复烧。新增 _toolcalls_partial_args(非空 dict 且 0<缺失必填<全部必填)
接进 _stream_llm attempt 循环走非流式重试(服务端一次拼好绕开乱序),
_log_partial_args 落 usage_events(kind=tool_malformed,签名 missing required keys)
纳入面板可观测(此前伪装成普通 [Error] 完全是盲区)。

② 换参数撞同一堵墙(面板 #2 edit old_str not found,单task 9次/24h 7次):
模型微调 old_str 重试,精确 args 指纹每次不同 → RepeatGuard arg 判据不累计。
补第二道判据:按工具的连续同类错误 streak(_norm_err 抹平路径/数字后签名相同、
跨≥2 不同 args),SOFT 注入定向提示、HARD 拦截一次并重置到 SOFT(非永久封死),
任一成功立即清零。

测试 test_loop_repeat_guard.py +12(err-streak 5 + partial-args 7),20/20 通过;
相邻 salvage/toolfail_malformed 23/23 通过,未碰坏既有行为。additive 内部机制,
不碰对外 API/DB 契约。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 08:22:42 +08:00
config fix(sandbox): pids-limit 256→1024 修容器内 mermaid 渲染必崩(bump 0.58.2) 2026-07-11 09:02:45 +08:00
core fix(loop): 堵失败聚集两裂缝——必填key被吞畸形走非流式重试 + RepeatGuard连续同错streak拦(bump 0.58.33) 2026-07-17 08:22:42 +08:00
db/migrations feat(context): §8.8 Phase 2 长会话中段折叠摘要 + 头部压缩指示环(bump 0.54.1) 2026-07-09 12:39:31 +08:00
deploy feat(sandbox): 镜像补 file 命令(bump 0.58.12) 2026-07-13 08:50:55 +08:00
docs docs: 操作说明书精简版表格微调 + 新增「科研AI双智能体·汇报PPT大纲」+ bump 0.24.4 2026-06-24 14:57:57 +08:00
prompts/system docs(prompt): system prompt 加通用 context 纪律,堵大块输出滚雪球(bump 0.32.5) 2026-06-29 14:56:44 +08:00
rendering feat(rendering): 平台渲染层 rendering/ 统一三 skill docx + chromium md→pdf + bump 0.21.0 2026-06-23 13:07:19 +08:00
scripts feat(loop): 空响应防御——provider 吐空自动重试 + warn 自停不静默 done + 面板留痕(bump 0.58.32) 2026-07-15 15:29:49 +08:00
skills feat(mp): mp_search_summary 批量入参 formulas[] 定点解检索烧 token(bump 0.58.28) 2026-07-15 10:49:35 +08:00
tests fix(loop): 堵失败聚集两裂缝——必填key被吞畸形走非流式重试 + RepeatGuard连续同错streak拦(bump 0.58.33) 2026-07-17 08:22:42 +08:00
tools feat(mp): mp_search_summary 批量入参 formulas[] 定点解检索烧 token(bump 0.58.28) 2026-07-15 10:49:35 +08:00
web fix(web): 对话正文文件锚点两处回归——含·的 pptx 丢 chip + 链接点击整页404(bump 0.58.29) 2026-07-15 13:40:12 +08:00
.gitattributes Add .gitattributes: force LF for shell + Dockerfile 2026-05-26 10:45:17 +08:00
.gitignore feat: 忽略vscodecounter 2026-07-07 15:38:55 +08:00
CHANGELOG.md feat(loop): 空响应防御——provider 吐空自动重试 + warn 自停不静默 done + 面板留痕(bump 0.58.32) 2026-07-15 15:29:49 +08:00
CLAUDE.md feat(changelog): 用户版更新日志 CHANGELOG.md + /v1/changelog + 点版本号弹层(bump 0.55.0) 2026-07-09 16:49:26 +08:00
DESIGN.md chore: 撤回 §8.11 delegate,只留验证过的批量工具(bump 0.58.31) 2026-07-15 14:58:21 +08:00
DOCUMENT_SEARCH_API.md feat(skill): documents skill 接内部材料学科知识库(document_search API) 2026-05-21 15:31:21 +08:00
EMBED.md feat(wecom): 企业微信应用主页免登进 embed 控制台(bump 0.44.0) 2026-07-07 10:09:52 +08:00
PROGRESS.md fix(loop): 堵失败聚集两裂缝——必填key被吞畸形走非流式重试 + RepeatGuard连续同错streak拦(bump 0.58.33) 2026-07-17 08:22:42 +08:00
RUN.md feat(ops+web): run 级错误持久提示+失败聚集+provider 致命错误即时告警(bump 0.58.21) 2026-07-13 14:06:29 +08:00
SCIENTIFIC_SKILLS.md skills: 加 pymatgen / stats_ml / plot_pub(建材院无机材料场景) 2026-05-28 11:33:59 +08:00
SKILL_LIST.md feat(prompt): 结构图 mermaid vs 生图改 ask_user 让用户点选(bump 0.58.15) 2026-07-13 10:18:48 +08:00
WW_verify_THssshZfneJwIG5Y.txt chore(wecom): 加企业微信可信域名校验文件 WW_verify_THssshZfneJwIG5Y.txt(放 repo 根)+ bump 0.26.7 2026-06-25 10:25:06 +08:00
alembic.ini core(§7 B Step 1): Storage 基建 — SQLAlchemy ORM + alembic + db CLI 2026-05-14 10:41:44 +08:00
main.py feat(web): main.py web 支持 --ssl-certfile/--ssl-keyfile(uvicorn 原生 TLS,免 nginx)+ bump 0.26.8 2026-06-25 10:43:18 +08:00
requirements.txt feat(sandbox): 补 olefile/xlrd/extract-msg 老格式解析依赖(bump 0.58.23) 2026-07-15 08:16:18 +08:00