Skip to content

fix(hermes): preserve atomic LCM tool transactions#464

Closed
ScriptedAlchemy wants to merge 3 commits into
masterfrom
codex/fix-hermes-lcm-replay
Closed

fix(hermes): preserve atomic LCM tool transactions#464
ScriptedAlchemy wants to merge 3 commits into
masterfrom
codex/fix-hermes-lcm-replay

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • keep assistant tool calls and consecutive results atomic across fresh-tail, summary-prefix, budget, and overflow replay boundaries
  • repair legacy partial groups, drop orphan results, and preserve legitimate trailing in-flight calls
  • reject malformed or non-shrinking generated replay at the Hermes host boundary with typed diagnostics
  • centralize replay decoding, normalization, and token accounting

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 -- --check
  • git diff --check
  • conventional commit check
  • independent correctness and maintainability reviews: no blockers

Hermes Agent core was not modified.

@changeset-bot

changeset-bot Bot commented Jul 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 584fc9e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +3644 to +3647
self.last_compress_result = result
self._last_compress_aborted = True
self._last_summary_error = boundary_code
return original

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Superseded by aggregate PR #465. Exact head 584fc9e is contained as an ancestor of aggregate head 54f53f8; full aggregate CI is the merge gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant