Describe the bug
After context compaction/summarization, the summarized history messages are written to the session with role: "assistant". This is incorrect — the compaction process is part of the system's internal bookkeeping, and the compacted summary should be injected as role: "user" so the model treats it as part of the conversation history context rather than as an assistant-generated response.
Impact
- Using "assistant" role for compacted content can confuse the model about what was actually generated vs. what is historical context
- The model may incorrectly attribute the compacted summary as its own output
- Can lead to unexpected behavior in subsequent turns
Expected behavior
Compacted/summarized context messages should use role: "user" to represent that these are historical conversation records being fed back as context.
Where to look
crates/core/src/context_pipeline.rs — compaction and context assembly
crates/core/src/session.rs — session state management
- Rollout record writing for compaction events
Describe the bug
After context compaction/summarization, the summarized history messages are written to the session with
role: "assistant". This is incorrect — the compaction process is part of the system's internal bookkeeping, and the compacted summary should be injected asrole: "user"so the model treats it as part of the conversation history context rather than as an assistant-generated response.Impact
Expected behavior
Compacted/summarized context messages should use
role: "user"to represent that these are historical conversation records being fed back as context.Where to look
crates/core/src/context_pipeline.rs— compaction and context assemblycrates/core/src/session.rs— session state management