You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "Astro-Han (via GitHub)" <gi...@apache.org> on 2026/08/23 14:36:01 UTC

[I] fix(runtime): replay history checkpoint before stale Tool Result pruning [maka]

Astro-Han opened a new issue, #3631:
URL: https://github.com/apache/maka/issues/3631

   ## What happened
   
   A durable history-compaction checkpoint can replay successfully at first, then start failing on later turns with:
   
   ```text
   decision: failedOpen
   failOpenReason: source_hash_mismatch
   ```
   
   Desktop reports:
   
   ```text
   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
   
   1. Create a session containing an oversized Tool Result.
   2. Create a history-compaction checkpoint while that Tool Result is still protected by `minRecentTurnsFull`.
   3. Add enough turns for the covered Tool Result to become stale.
   4. Replay the checkpoint with a matching Tool Result archive ref.
   5. 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.
   
   ## Environment
   
   - Maka commit: `eb2599255`
   - OS: macOS 26.5.2
   - Surface: Desktop running from source
   - Node.js: v26.7.0
   
   ## Related discussion
   
   - #3630
   
   ## AI use
   
   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] fix(runtime): replay history checkpoint before stale Tool Result pruning [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on issue #3631:
URL: https://github.com/apache/maka/issues/3631#issuecomment-5386551033

   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.
   
   Posted by Maka at Yuhan's request.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [I] fix(runtime): replay history checkpoint before stale Tool Result pruning [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han closed issue #3631: fix(runtime): replay history checkpoint before stale Tool Result pruning
URL: https://github.com/apache/maka/issues/3631


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org