mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
fix: exclude thinking traces from summaries, use ephemeral session ID
- Omit Thinking/RedactedThinking from format_conversation() so
chain-of-thought never leaks into summarization input
- Use ephemeral session ID (summary_{id}) for provider.complete()
so providers that track context by session ID don't pollute
historical sessions
Signed-off-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
@@ -69,8 +69,9 @@ pub fn format_conversation(conversation: &Conversation) -> String {
|
||||
};
|
||||
parts.push(format!("[TOOL]: {}", text));
|
||||
}
|
||||
MessageContent::Thinking(t) => {
|
||||
parts.push(format!("[THINKING]: {}", t.thinking));
|
||||
MessageContent::Thinking(_) | MessageContent::RedactedThinking(_) => {
|
||||
// Thinking traces are internal chain-of-thought, never user-visible.
|
||||
// Exclude from summarization input.
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
@@ -174,10 +175,14 @@ async fn summarize_single_session(
|
||||
|
||||
let messages = vec![Message::user().with_text(user_prompt)];
|
||||
|
||||
// Use a throwaway session ID so providers that track context by session
|
||||
// (Claude Code, Gemini CLI) don't pollute the historical session.
|
||||
let ephemeral_id = format!("summary_{}", session_id);
|
||||
|
||||
match provider
|
||||
.complete(
|
||||
model_config,
|
||||
session_id,
|
||||
&ephemeral_id,
|
||||
SUMMARIZE_SYSTEM_PROMPT,
|
||||
&messages,
|
||||
&[],
|
||||
|
||||
Reference in New Issue
Block a user