Use the same prompt as agent thread summary for text threads (#35669)

This was causing text thread summarization to be counted as a usage of 1
prompt

Release Notes:

- Fixed bug with agent text threads (not chat threads) counting
summarization as a usage of 1 prompt.

Co-authored-by: Oleksiy <oleksiy@zed.dev>
This commit is contained in:
Michael Sloan 2025-08-05 15:47:17 -06:00 committed by GitHub
parent 42699411f6
commit 86957a5614
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 9 deletions

View file

@ -8,7 +8,7 @@ use crate::{
},
tool_use::{PendingToolUse, ToolUse, ToolUseMetadata, ToolUseState},
};
use agent_settings::{AgentProfileId, AgentSettings, CompletionMode};
use agent_settings::{AgentProfileId, AgentSettings, CompletionMode, SUMMARIZE_THREAD_PROMPT};
use anyhow::{Result, anyhow};
use assistant_tool::{ActionLog, AnyToolCard, Tool, ToolWorkingSet};
use chrono::{DateTime, Utc};
@ -2112,12 +2112,10 @@ impl Thread {
return;
}
let added_user_message = include_str!("./prompts/summarize_thread_prompt.txt");
let request = self.to_summarize_request(
&model.model,
CompletionIntent::ThreadSummarization,
added_user_message.into(),
SUMMARIZE_THREAD_PROMPT.into(),
cx,
);