Skip to content

Commit a64318e

Browse files
committed
fix(condense): update SUMMARY_PROMPT to use general AI assistant introduction
Replace task-specific summarization instruction with a more neutral AI assistant prompt that describes the assistant's role for summarization.
1 parent 3437f5e commit a64318e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/core/condense/__tests__/index.spec.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ describe("summarizeConversation", () => {
839839

840840
// Verify that createMessage was called with the simple system prompt
841841
expect(mockApiHandler.createMessage).toHaveBeenCalledWith(
842-
"Summarize the conversation so far, as described in the prompt instructions.",
842+
"You are a helpful AI assistant tasked with summarizing conversations.",
843843
expect.any(Array),
844844
)
845845

@@ -1542,9 +1542,7 @@ describe("summarizeConversation with custom settings", () => {
15421542
// Verify the default prompt was used (simple system prompt)
15431543
let createMessageCalls = (mockMainApiHandler.createMessage as Mock).mock.calls
15441544
expect(createMessageCalls.length).toBe(1)
1545-
expect(createMessageCalls[0][0]).toBe(
1546-
"Summarize the conversation so far, as described in the prompt instructions.",
1547-
)
1545+
expect(createMessageCalls[0][0]).toBe("You are a helpful AI assistant tasked with summarizing conversations.")
15481546

15491547
// Reset mock and test with undefined
15501548
vi.clearAllMocks()
@@ -1561,9 +1559,7 @@ describe("summarizeConversation with custom settings", () => {
15611559
// Verify the default prompt was used again (simple system prompt)
15621560
createMessageCalls = (mockMainApiHandler.createMessage as Mock).mock.calls
15631561
expect(createMessageCalls.length).toBe(1)
1564-
expect(createMessageCalls[0][0]).toBe(
1565-
"Summarize the conversation so far, as described in the prompt instructions.",
1566-
)
1562+
expect(createMessageCalls[0][0]).toBe("You are a helpful AI assistant tasked with summarizing conversations.")
15671563
})
15681564

15691565
/**

src/core/condense/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export const N_MESSAGES_TO_KEEP = 3
155155
export const MIN_CONDENSE_THRESHOLD = 5 // Minimum percentage of context window to trigger condensing
156156
export const MAX_CONDENSE_THRESHOLD = 100 // Maximum percentage of context window to trigger condensing
157157

158-
const SUMMARY_PROMPT = "Summarize the conversation so far, as described in the prompt instructions."
158+
const SUMMARY_PROMPT = "You are a helpful AI assistant tasked with summarizing conversations."
159159

160160
export type SummarizeResponse = {
161161
messages: ApiMessage[] // The messages after summarization

0 commit comments

Comments
 (0)