Skip to content

Commit f4aed27

Browse files
committed
Stop compaction from anchoring every error and losing the substance
Errored tool_results scored above the anchor threshold on their own, so a failing-edit retry loop anchored every iteration verbatim while healthy context got summarized away. Score errors below threshold and collapse runs of the same repeating error to one representative before scoring. Pairing anchors were pulled in with no cap, making maxAnchorTurns not a real bound; the scored-anchor selection now takes each candidate's pair closure whole-or-nothing against a shared budget. The summary prompt seeded from the last 8 assistant snippets, which during degeneration is the looped text itself; filter snippets flagged by the existing detectRepetition detector before they reach the summarizer. Superseded-result stubbing only covered read_file; extend it to grep, search_files, and list_dir (byte-identical arguments), excluding run_shell since the same command is not idempotent. CompactorConfig.summarize was typed with one argument even though the summarizer already accepted a workflow context, so the context never made it through; widen the type and thread cfg.summaryContext() into the call. Replace the bare catch in the model summarizer with a logged warning and a fallback marker so a failed LLM summary is distinguishable from a real one.
1 parent bebe563 commit f4aed27

5 files changed

Lines changed: 878 additions & 143 deletions

File tree

0 commit comments

Comments
 (0)