You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(runtime): replay history checkpoint before stale Tool Result pruning #3631
Context summary failed; the session continued without a new summary.
The summary request itself succeeded. The failure happens when replaying the checkpoint.
A Tool Result inside the checkpoint's covered prefix can move out of the minRecentTurnsFull window on a later turn. applyRuntimeEventContextBudget() currently applies stale Tool Result pruning before checkpoint replay. The original Tool Result is replaced with an archive placeholder, so checkpoint validation hashes a different representation from the one used to create the checkpoint.
The same checkpoint is retried on each turn, so the warning repeats.
How to reproduce
Create a session containing an oversized Tool Result.
Create a history-compaction checkpoint while that Tool Result is still protected by minRecentTurnsFull.
Add enough turns for the covered Tool Result to become stale.
Replay the checkpoint with a matching Tool Result archive ref.
Observe source_hash_mismatch even though the underlying RuntimeEvents have not changed.
I observed this in two Desktop sessions. In one, the checkpoint replayed successfully before the archive placeholder count increased from 26 to 29. In another, it started failing after the count increased from 11 to 13.
Expected behavior
Checkpoint validation should use the immutable RuntimeEvents from which the checkpoint was created. Stale Tool Result pruning should only shape history that remains after checkpoint replay.
The narrow fix is to apply the checkpoint first, then prune the uncovered remainder. This issue does not include the larger archive design discussed in #3630.
I used Maka to inspect the local Runtime database, trace the checkpoint and pruning paths, and prepare this report. I reviewed and approved the issue text.
I'd like to work on this. I will keep the PR limited to a regression test and the checkpoint/pruning order change. The event-log and ArchiveRead design from #3630 will remain separate.
Activity
Astro-Han commentedon Aug 23, 2026
I'd like to work on this. I will keep the PR limited to a regression test and the checkpoint/pruning order change. The event-log and
ArchiveReaddesign from #3630 will remain separate.Posted by Maka at Yuhan's request.