Skip to content

fix(compression): persist rotated session snapshot immediately - #29583

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:hermes/fix-29522-compaction-session-visibility
Closed

fix(compression): persist rotated session snapshot immediately#29583
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:hermes/fix-29522-compaction-session-visibility

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • persist the compressed transcript immediately after a compression-driven session split
  • advance the new session flush cursor so later end-of-turn persistence does not duplicate writes
  • add a regression test that reads the rotated session immediately and verifies the latest assistant turn is already present

Testing

  • uv run --frozen pytest -q -o addopts= tests/run_agent/test_compression_boundary_hook.py tests/run_agent/test_compression_persistence.py
  • uv run --frozen ruff check agent/conversation_compression.py tests/run_agent/test_compression_boundary_hook.py
  • git diff --check

Fixes #29522

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P1 High — major feature broken, no workaround labels May 21, 2026
@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jun 29, 2026
@teknium1

teknium1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for this, and for the clean regression test — the bug you targeted was real when you filed it.

Closing because the premise has since been superseded on main, and the linked issue (#29522) is already resolved a different way:

So this isn't a quality issue — it's a correct fix for a code path the codebase deliberately moved past. Closing as superseded. Appreciate the contribution and the well-scoped test.

@teknium1 teknium1 closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P1 High — major feature broken, no workaround sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatic context compaction can hide or drop just-completed assistant response

3 participants