Skip to content

fix(compression): keep same-session handoff when compress_end is degenerate (#83248) - #83290

Merged
teknium1 merged 2 commits into
NousResearch:mainfrom
HexLab98:fix/83248-handoff-scan-misses-beyond-compress-end
Aug 15, 2026
Merged

fix(compression): keep same-session handoff when compress_end is degenerate (#83248)#83290
teknium1 merged 2 commits into
NousResearch:mainfrom
HexLab98:fix/83248-handoff-scan-misses-beyond-compress-end

Conversation

@HexLab98

@HexLab98 HexLab98 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Always scan the full transcript for compaction handoff rows before the fix(agent): decay protected summaries after restart #57835 cross-session _previous_summary discard, so a degenerate compress_end cannot hide an in-window same-session handoff.
  • Prevents a rich iterative handoff from being replaced by a thin from-scratch one-turn summary on the second (or later) compaction in the same process.
  • Adds a regression test that forces compress_end before the handoff index and asserts _previous_summary is still present when the summarizer runs.

Fixes #83248

Test plan

  • scripts/run_tests.sh tests/agent/test_context_compressor_summary_continuity.py tests/agent/test_context_compressor_cross_session_guard.py -q
  • Reproduce a multi-compaction session where the handoff sits past a tiny compress_end and confirm the iterative PREVIOUS SUMMARY: path still runs (no cross-session discard log / no one-turn wipe)

…discard

A degenerate compress_end can hide an in-window handoff past the cut; the
NousResearch#57835 guard then cleared a valid same-session _previous_summary (NousResearch#83248).
… keep

Regression for NousResearch#83248: handoff beyond compress_end must not clear a valid
same-session _previous_summary via the cross-session discard path.
@teknium1
teknium1 merged commit 39f3bb9 into NousResearch:main Aug 15, 2026
45 checks passed
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/compression Context compression and continuation sessions sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/compression Context compression and continuation sessions comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

3 participants