From 2464566942ace4ffe71d347fde3dd9868e2ecd5d Mon Sep 17 00:00:00 2001 From: Totoro Date: Fri, 16 Oct 2026 09:41:20 +0800 Subject: [PATCH] fix(summarization): cover all selected history before compaction (#6918) * fix(summarization): cover all selected history before compaction * fix(summarization): bound compaction work and recover oversized carries * docs: leave headroom in middleware guidance chain * fix(summarization): cool down repeated chunk-limit failures * test(runtime): complete callback cleanup graph fixture --------- Co-authored-by: Willem Jiang --- README.md | 11 + backend/docs/summarization.md | 49 +- .../deerflow/agents/middlewares/AGENTS.md | 44 +- .../middlewares/summarization_middleware.py | 452 ++++++++++-------- .../deerflow/config/summarization_config.py | 2 +- .../harness/deerflow/subagents/AGENTS.md | 8 +- backend/tests/AGENTS.md | 4 + .../test_extension_system_model_calls.py | 5 +- backend/tests/test_jev_context_extension.py | 11 +- backend/tests/test_run_worker_rollback.py | 9 +- .../test_summarization_chunk_cooldown.py | 142 ++++++ .../tests/test_summarization_cost_recovery.py | 359 ++++++++++++++ .../test_summarization_rolling_contract.py | 230 +++++++++ .../test_summarization_source_coverage.py | 304 ++++++++++++ .../tests/test_summarization_summary_text.py | 149 +++--- 15 files changed, 1489 insertions(+), 290 deletions(-) create mode 100644 backend/tests/test_summarization_chunk_cooldown.py create mode 100644 backend/tests/test_summarization_cost_recovery.py create mode 100644 backend/tests/test_summarization_rolling_contract.py create mode 100644 backend/tests/test_summarization_source_coverage.py diff --git a/README.md b/README.md index 948284cb6c..d4b71b5ba3 100644 --- a/README.md +++ b/README.md @@ -2051,6 +2051,17 @@ When your role lacks `runs:create`, the Web UI rejects a new task or `/goal