fix(channel): save original user text to conversation history

Previously, the memory-enriched message (with [Memory context] block
prepended) was saved to per-sender conversation history. On subsequent
turns the LLM saw stale memory fragments with raw keys baked into
prior "user" messages, creating compounding noise.

Save the original msg.content instead. Memory context is still injected
for the current LLM call but no longer persists across turns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Edvard 2026-02-19 15:16:49 -05:00 committed by Chummy
parent ea2ff7c53b
commit 6cbdef8c16

View file

@ -838,7 +838,7 @@ async fn process_channel_message(
append_sender_turn(
ctx.as_ref(),
&history_key,
ChatMessage::user(&enriched_message),
ChatMessage::user(&msg.content),
);
// Build history from per-sender conversation cache.