Go to file
caoqianming 8a7e0cd233 fix(loop): 工具调用 arguments 损坏时丢弃重试 + 非流式兜底,断投毒级联
deepseek-v4-flash 大参数工具调用(大 write/run_python,≈7K+ 字符)偶发把内容
碎片错位粘进 arguments 开头致 JSON 解析失败,或退化成空 {} 缺参。隔离批量验证
(干净上下文)非流式 8/8、流式 8/8 全干净 → 上游间歇抖动,概率低;真正放大成
灾的是 loop 把损坏的 assistant 消息入库 + 每轮重发,诱导模型继续学坏(投毒级联)。

- core/loop.py:_stream_llm 拉一轮后用 _malformed_tool_calls 校验 tool_call
  arguments 能否 json.loads,不能则丢弃整轮(不 append/不记账)重 roll(≤3 次),
  最后一次降级 _nonstream_once(provider 服务端拼,绕开流式错位)。流式收集逻辑
  抽成 _collect_stream_once,正常路径不变。
- core/executor_host.py / core/sandbox/tool_runner.py:缺必填参数早返
  「缺少必填参数 [...];请带齐 [...] 重新调用」,替掉暴露内部签名的
  TypeError missing N required positional arguments(host + docker 两路覆盖)。
- 文档:PROGRESS.md 加 2026-06-06 条;RUN.md 故障兜底加一行。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 20:51:45 +08:00
config feat(usage): 记账给前缀缓存命中折价 + 前端体现缓存命中/真实成本 2026-06-05 08:26:09 +08:00
core fix(loop): 工具调用 arguments 损坏时丢弃重试 + 非流式兜底,断投毒级联 2026-06-06 20:51:45 +08:00
db/migrations Stage C 收尾包:资源 yaml + 磁盘配额 + 网络放开 + 容器内源持久化 2026-05-27 08:35:53 +08:00
deploy fix(deploy): npm 默认源改回腾讯 — npmmirror 访问不稳 2026-06-03 11:00:28 +08:00
prompts/system Reduce chat context token usage 2026-06-04 16:41:14 +08:00
scripts fix(usage): 缓存命中率同源(修 822% 怪值)+ 列表花费改 hover + backfill 加 --assume-cache-hit-rate 2026-06-05 08:41:51 +08:00
skills feat(skill): 新增 standard skill — 国标/行标/团标起草(GB/T 1.1-2020) 2026-06-05 15:46:06 +08:00
tests feat(usage): 记账给前缀缓存命中折价 + 前端体现缓存命中/真实成本 2026-06-05 08:26:09 +08:00
tools feat(run_python): 过程脚本约定落 task_dir/scripts/ 2026-06-05 15:52:05 +08:00
web refactor(dev): 前端模块化 Step 1 — dev.html 拆零构建 ES module(叶子优先) 2026-06-05 16:55:20 +08:00
.gitattributes Add .gitattributes: force LF for shell + Dockerfile 2026-05-26 10:45:17 +08:00
.gitignore skills+core(命名约定): task 级宪法文件 <date>-<short_id>-<name>.spec.md + spec_lock → spec 简化 2026-05-20 14:03:21 +08:00
CLAUDE.md docs(claude): 加 Shell 语法规约 — 别把 PowerShell here-string 喂给 Bash 工具 2026-06-02 12:28:23 +08:00
DESIGN.md feat(dev): 顶栏自助改密码 + 选入按钮文字改图标(防换行) 2026-06-05 15:07: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(web): embed 模式接受 ?task_id=<uuid> URL 参数自动定位 task 2026-05-22 15:27:19 +08:00
PROGRESS.md fix(loop): 工具调用 arguments 损坏时丢弃重试 + 非流式兜底,断投毒级联 2026-06-06 20:51:45 +08:00
RUN.md fix(loop): 工具调用 arguments 损坏时丢弃重试 + 非流式兜底,断投毒级联 2026-06-06 20:51:45 +08:00
SCIENTIFIC_SKILLS.md skills: 加 pymatgen / stats_ml / plot_pub(建材院无机材料场景) 2026-05-28 11:33:59 +08:00
SKILL_LIST.md feat(skill): 新增 standard skill — 国标/行标/团标起草(GB/T 1.1-2020) 2026-06-05 15:46: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 Stage C Step 5: main.py sandbox check + lifespan fs quota WARN 2026-05-26 16:41:16 +08:00
requirements.txt skills: 加 pymatgen / stats_ml / plot_pub(建材院无机材料场景) 2026-05-28 11:33:59 +08:00