Go to file
caoqianming 8b6e66b006 feat(context): 压缩加"上下文压力门槛",短任务不压缩以护缓存+保信息
prepare_messages_with_stats 加 compact_threshold_chars:总 chars 未超阈值
则完全跳过压缩、原样发 —— 短任务 prompt 前缀逐轮字节一致、DeepSeek 前缀
缓存全程命中,且不白丢旧 tool 细节(context 预算还很空时无谓压缩=纯损失)。
超阈值才走原压缩逻辑。

- loop 按 caps.reliable_context × 0.5 × 2.5(char/token 粗折算)算阈值
  (flash ≈ 33 万 chars),_COMPACT_CONTEXT_RATIO/_CHARS_PER_TOKEN 可调
- compaction_skipped 进 stats / llm_start 事件可观测
- 默认 compact_threshold_chars=0 = 永远压缩(向后兼容)

背景:实测 task b27466a0 DeepSeek 缓存命中已 92-94%、滑动边界损失有限
(压缩函数确定性、旧消息压缩态稳定),故只补门槛、暂不改边界为阶梯式。
新增 2 测试(below/above 门槛),全量 105 过。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 13:42:18 +08:00
config feat(loop): 停机判据从"步数"解耦为"是否在推进" 2026-06-10 13:22:02 +08:00
core feat(context): 压缩加"上下文压力门槛",短任务不压缩以护缓存+保信息 2026-06-10 13:42:18 +08:00
db/migrations Stage C 收尾包:资源 yaml + 磁盘配额 + 网络放开 + 容器内源持久化 2026-05-27 08:35:53 +08:00
deploy docs(deploy): update.sh restart 日志提示 drain 期会等几十秒 2026-06-10 11:21:25 +08:00
prompts/system feat(prompt): 工作原则加「少来回」—— 独立步骤合并,广谱减轮 2026-06-08 11:31:22 +08:00
scripts feat(tools+loop): 批量抓取 + 重复调用守卫 —— 治高轮数烧 token 2026-06-08 16:47:56 +08:00
skills feat(ppt): 补信息设计纪律 + 混合背景 + pptx 预览器(深读 pptmaster 后) 2026-06-09 09:41:55 +08:00
tests feat(context): 压缩加"上下文压力门槛",短任务不压缩以护缓存+保信息 2026-06-10 13:42:18 +08:00
tools feat(tools+loop): 批量抓取 + 重复调用守卫 —— 治高轮数烧 token 2026-06-08 16:47:56 +08:00
web feat(web): systemctl restart 优雅 drain in-flight run,不再误标 error 2026-06-10 10:54:43 +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(context): 压缩加"上下文压力门槛",短任务不压缩以护缓存+保信息 2026-06-10 13:42:18 +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 feat(context): 压缩加"上下文压力门槛",短任务不压缩以护缓存+保信息 2026-06-10 13:42:18 +08:00
RUN.md feat(loop): 停机判据从"步数"解耦为"是否在推进" 2026-06-10 13:22:02 +08:00
SCIENTIFIC_SKILLS.md skills: 加 pymatgen / stats_ml / plot_pub(建材院无机材料场景) 2026-05-28 11:33:59 +08:00
SKILL_LIST.md feat(ppt): 补信息设计纪律 + 混合背景 + pptx 预览器(深读 pptmaster 后) 2026-06-09 09:41:55 +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): systemctl restart 优雅 drain in-flight run,不再误标 error 2026-06-10 10:54:43 +08:00
requirements.txt skills: 加 pymatgen / stats_ml / plot_pub(建材院无机材料场景) 2026-05-28 11:33:59 +08:00