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

@ -2,7 +2,7 @@
mod assistant_context_tests;
mod context_store;
use agent_settings::AgentSettings;
use agent_settings::{AgentSettings, SUMMARIZE_THREAD_PROMPT};
use anyhow::{Context as _, Result, bail};
use assistant_slash_command::{
SlashCommandContent, SlashCommandEvent, SlashCommandLine, SlashCommandOutputSection,
@ -2688,10 +2688,7 @@ impl AssistantContext {
let mut request = self.to_completion_request(Some(&model.model), cx);
request.messages.push(LanguageModelRequestMessage {
role: Role::User,
content: vec![
"Generate a concise 3-7 word title for this conversation, omitting punctuation. Go straight to the title, without any preamble and prefix like `Here's a concise suggestion:...` or `Title:`"
.into(),
],
content: vec![SUMMARIZE_THREAD_PROMPT.into()],
cache: false,
});