Skip to content

fix: avoid re-injecting todo subjects after compression - #18883

Open
batchprocess128 wants to merge 1 commit into
NousResearch:mainfrom
batchprocess128:fix/todo-privacy-boundary
Open

fix: avoid re-injecting todo subjects after compression#18883
batchprocess128 wants to merge 1 commit into
NousResearch:mainfrom
batchprocess128:fix/todo-privacy-boundary

Conversation

@batchprocess128

@batchprocess128 batchprocess128 commented May 2, 2026

Copy link
Copy Markdown

Summary

Fixes a todo privacy boundary in Hermes' post-compression state recovery.

Before this change, TodoStore.format_for_injection() appended full pending and in-progress todo subjects back into the compressed conversation as a user message. Todo subjects are useful for local planning, but they can contain sensitive task details. Re-injecting them into fresh model context after compression can re-surface details that should stay local to the original tool result.

This PR keeps todo continuity without re-surfacing full subjects after compression:

  • post-compression injection now includes active todo counts only
  • the model can call todo with no parameters when it needs full details
  • the todo tool schema now warns that todo content can be visible in UI and tool results
  • tests now assert that active todo subjects are not re-injected

Test plan

python -m pytest tests/tools/test_todo_tool.py tests/tools/test_read_loop_detection.py -q -o 'addopts='

Result:

37 passed

Risk / compatibility

This changes only the post-compression injection text. Normal todo reads/writes still return the full current list, and the live UI can still render todos from tool events.

The tradeoff is intentional: after compression, the model gets continuity counts and must explicitly call todo to inspect full task details rather than receiving all active subjects automatically.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused privacy hardening. The underlying behavior is still present on current main: tools/todo_tool.py:138-143 includes active subjects in the formatted snapshot, and agent/conversation_compression.py:703-705 appends that snapshot as a synthetic user message.

Problems

Suggested changes

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/compression Context compression and continuation sessions labels Jul 12, 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/tools Tool registry, model_tools, toolsets P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data 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.

3 participants