From b54ba8e0a2edf52dd30936e95ca11ff41ef06fa8 Mon Sep 17 00:00:00 2001 From: Tyler Longwell Date: Mon, 16 Feb 2026 13:34:19 -0500 Subject: [PATCH] Make compaction continuation messages explicit about context being compacted Update all three continuation text constants to explicitly tell the LLM that its context was compacted: - CONVERSATION_CONTINUATION_TEXT: for normal conversation flow - TOOL_LOOP_CONTINUATION_TEXT: when compaction happens mid-tool-loop - MANUAL_COMPACT_CONTINUATION_TEXT: when user triggers /compact The new wording uses 'Your context was compacted' rather than the passive 'a summary was prepared because a context limit was reached'. Also adds consistent trailing periods to all three constants. --- crates/goose/src/context_mgmt/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/goose/src/context_mgmt/mod.rs b/crates/goose/src/context_mgmt/mod.rs index 305b817b60f0..b2a53a47fc81 100644 --- a/crates/goose/src/context_mgmt/mod.rs +++ b/crates/goose/src/context_mgmt/mod.rs @@ -17,19 +17,19 @@ use tracing::log::warn; pub const DEFAULT_COMPACTION_THRESHOLD: f64 = 0.8; const CONVERSATION_CONTINUATION_TEXT: &str = - "The previous message contains a summary that was prepared because a context limit was reached. + "Your context was compacted. The previous message contains a summary of the conversation so far. Do not mention that you read a summary or that conversation summarization occurred. -Just continue the conversation naturally based on the summarized context"; +Just continue the conversation naturally based on the summarized context."; const TOOL_LOOP_CONTINUATION_TEXT: &str = - "The previous message contains a summary that was prepared because a context limit was reached. + "Your context was compacted. The previous message contains a summary of the conversation so far. Do not mention that you read a summary or that conversation summarization occurred. Continue calling tools as necessary to complete the task."; const MANUAL_COMPACT_CONTINUATION_TEXT: &str = - "The previous message contains a summary that was prepared at the user's request. + "Your context was compacted at the user's request. The previous message contains a summary of the conversation so far. Do not mention that you read a summary or that conversation summarization occurred. -Just continue the conversation naturally based on the summarized context"; +Just continue the conversation naturally based on the summarized context."; #[derive(Serialize)] struct SummarizeContext {