Skip to content

fix: preserve user focus after todo compression - #35349

Closed
ykq wants to merge 1 commit into
NousResearch:mainfrom
ykq:fix/todo-compression-user-focus-20260530
Closed

fix: preserve user focus after todo compression#35349
ykq wants to merge 1 commit into
NousResearch:mainfrom
ykq:fix/todo-compression-user-focus-20260530

Conversation

@ykq

@ykq ykq commented May 30, 2026

Copy link
Copy Markdown

Summary

  • Prevents context compression from appending the preserved todo snapshot as a standalone latest user message.
  • Labels the todo snapshot as an internal state note and prepends it into the latest real user turn instead.
  • Preserves assistant messages unchanged, including signed-thinking/reasoning-bearing assistant content.

Test plan

  • ./venv/bin/python -m pytest -o addopts='' tests/agent/test_compression_todo_injection.py tests/tools/test_todo_tool.py -q → 17 passed
  • ./venv/bin/python -m pytest -o addopts='' tests/agent/test_context_compressor.py tests/agent/test_context_compressor_summary_continuity.py tests/run_agent/test_compression_boundary.py tests/agent/test_compression_todo_injection.py tests/tools/test_todo_tool.py -q → 108 passed

Notes

This fixes a compression-focus regression where internal continuity state could be interpreted as the newest user request after compaction.

@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 labels May 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: This competes with #26981 and #18883, all addressing #26979 (todo snapshot injected as synthetic user message after compression). This PR takes the approach of prepending the snapshot into the latest real user turn rather than removing the injection entirely (#26981) or stripping subjects (#18883). Maintainers should pick one approach.

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 P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants