mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-24 12:39:32 +00:00
findCutPoint defaulted cutIndex to the earliest valid cut (cutPoints[0], keep everything) and only moved it forward to a cut point at or after the backward token cursor. When the final entry is a toolResult whose estimate alone meets keepRecentTokens, the cursor stops at that trailing toolResult index, no valid cut point sits at or after it (toolResult entries are not valid cut points), and the default stuck at keep-everything. Compaction then summarized zero messages, so preflight and overflow compaction silently no-op and the session loops on a context it cannot shrink. Default cutIndex to the most recent valid cut before the forward search. When a cut point exists at or after the cursor the search still finds it and behavior is unchanged; only the trailing-tool-result case now keeps the recent tail and summarizes the prefix.