Skip to content

fix(context_compressor): always keep last user message in tail to prevent active-task loss#11052

Merged
kshitijk4poor merged 1 commit into
mainfrom
fix/compressor-keep-last-user-msg
Apr 16, 2026
Merged

fix(context_compressor): always keep last user message in tail to prevent active-task loss#11052
kshitijk4poor merged 1 commit into
mainfrom
fix/compressor-keep-last-user-msg

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Cherry-picked from #10969 by @sontianye. Fixes #10896.

Ensure _align_boundary_backward never pushes the last user message into the compressed region. Without this, compression could delete the user's active task instruction mid-session.

Test Results

tests/agent/test_compress_focus.py + test_context_compressor.py: 44 passed

…vent active-task loss

Ensure _align_boundary_backward never pushes the last user message
into the compressed region. Without this, compression could delete
the user active task instruction mid-session.

Cherry-picked from #10969 by @sontianye. Fixes #10896.
@kshitijk4poor kshitijk4poor force-pushed the fix/compressor-keep-last-user-msg branch from 6a6710b to 91d25c4 Compare April 16, 2026 14:26
@kshitijk4poor kshitijk4poor merged commit f19ca50 into main Apr 16, 2026
3 of 5 checks passed
@kshitijk4poor kshitijk4poor deleted the fix/compressor-keep-last-user-msg branch April 16, 2026 14:45
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.

[Bug]: Context compression causes task regression — agent reverts to executing an earlier completed task after context is compacted

2 participants