zcbot/tests
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
..
frontend_task_progress.test.mjs Show task progress above composer 2026-06-08 09:04:43 +08:00
test_context_compaction.py feat(context): 压缩加"上下文压力门槛",短任务不压缩以护缓存+保信息 2026-06-10 13:42:18 +08:00
test_disk_quota.py Stage C 收尾包:资源 yaml + 磁盘配额 + 网络放开 + 容器内源持久化 2026-05-27 08:35:53 +08:00
test_executor_docker.py Reduce chat context token usage 2026-06-04 16:41:14 +08:00
test_load_skill.py fix(skill_tool): docker backend 下返回容器路径而非 host 绝对路径 2026-05-28 13:37:19 +08:00
test_loop_repeat_guard.py feat(loop): 停机判据从"步数"解耦为"是否在推进" 2026-06-10 13:22:02 +08:00
test_pptx_render.py feat(preview): pptx 在线预览 —— LibreOffice→PDF + 复用 PDF iframe(DESIGN §8.3 Stage 1) 2026-06-09 13:04:02 +08:00
test_run_python_script_path.py Reduce chat context token usage 2026-06-04 16:41:14 +08:00
test_sandbox_check.py Stage C Step 5: main.py sandbox check + lifespan fs quota WARN 2026-05-26 16:41:16 +08:00
test_secret_host_tools.py feat(tools+loop): 批量抓取 + 重复调用守卫 —— 治高轮数烧 token 2026-06-08 16:47:56 +08:00
test_static_vendor.py Disable static asset caching 2026-06-08 09:16:31 +08:00
test_system_prompt_paths.py test(prompt): 锁住 docker 下 system prompt 不漏宿主路径(药3 复核收口) 2026-06-09 11:30:32 +08:00
test_task_progress_tool.py Add task progress tool 2026-06-08 08:44:16 +08:00
test_tool_output_compaction.py Reduce chat context token usage 2026-06-04 16:41:14 +08:00
test_usage_accounting.py feat(usage): 记账给前缀缓存命中折价 + 前端体现缓存命中/真实成本 2026-06-05 08:26:09 +08:00