fix(hermes): preserve atomic LCM tool transactions#464
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7978e0bbc0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| self.last_compress_result = result | ||
| self._last_compress_aborted = True | ||
| self._last_summary_error = boundary_code | ||
| return original |
There was a problem hiding this comment.
Keep rejected replays from advancing LCM frontier
When _compress_to_result returns an otherwise successful compressed result that this new boundary check rejects (for example non_shrinking_replay), the underlying tracedecay_lcm_compress call has already committed summary nodes and advanced the LCM frontier. Returning original here leaves the host transcript uncompressed while LCM now considers those messages already summarized, so the next preflight over the same oversized live transcript can see no eligible backlog and stop retrying compression instead of repairing the bad replay.
Useful? React with 👍 / 👎.
Summary
Root cause
TraceDecay could split tool transactions while assembling compressed replay. Hermes persisted that replay before its later sequence repair, so orphan-heavy history inflated rough token estimates and triggered repeated compaction despite much smaller provider prompts.
Verification
cargo test --test hermes_suite --test session_suite --quiet(73 + 228 passed)cargo fmt --all -- --checkgit diff --checkHermes Agent core was not modified.