Skip to content

fix(compression): always use role=user for compaction summaries (#42768) - #42897

Closed
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-42768
Closed

fix(compression): always use role=user for compaction summaries (#42768)#42897
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:auto-fix/issue-42768

Conversation

@kyssta-exe

Copy link
Copy Markdown
Contributor

Fixes #42768. Compaction summaries now always use role=user instead of role=assistant when standalone. Some LLMs treat role=assistant summaries as their own prior output and echo them back as live assistant messages. When role=user would create consecutive same-role messages with the head or tail neighbor, the summary is merged into the adjacent message instead.

…Research#42768)

Compaction summaries now always use role=user instead of role=assistant
when standalone. Some LLMs treat role=assistant summaries as their own
prior output and echo them back into the conversation as live assistant
messages. When role=user would create consecutive same-role messages,
the summary is merged into the adjacent head or tail message instead.
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Jun 9, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #42830 (fix(agent): keep compaction summaries as user role) — same fix for #42768, and #42830 is the more complete of the cluster (also appends an END marker and counts deterministic fallback summaries as ineffective compression). Also overlaps closed #42804 and open #42783.

@kyssta-exe

Copy link
Copy Markdown
Contributor Author

Duplicate of #42830 — same compaction summary role fix for #42768. Closing as superseded.

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 type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Context compaction summaries leak into chat as assistant responses when inserted with role="assistant"

2 participants