diff --git a/coderd/chatd/chatloop/compaction.go b/coderd/chatd/chatloop/compaction.go index 0d137eb7ab..696698b5dd 100644 --- a/coderd/chatd/chatloop/compaction.go +++ b/coderd/chatd/chatloop/compaction.go @@ -17,13 +17,26 @@ const ( minCompactionThresholdPercent = int32(0) maxCompactionThresholdPercent = int32(100) - defaultCompactionSummaryPrompt = "Summarize the current chat so a " + - "new assistant can continue seamlessly. Include the user's goals, " + - "decisions made, concrete technical details (files, commands, APIs), " + - "errors encountered and fixes, and open questions. Be dense and factual. " + - "Omit pleasantries and next-step suggestions." - defaultCompactionSystemSummaryPrefix = "Summary of earlier chat context:" - defaultCompactionTimeout = 90 * time.Second + defaultCompactionSummaryPrompt = "You are performing a context compaction. " + + "Summarize the conversation so a new assistant can seamlessly " + + "continue the work in progress.\n\n" + + "Include:\n" + + "- The user's overall goal and current task\n" + + "- Key decisions made and their rationale\n" + + "- Concrete technical details: file paths, function names, " + + "commands, APIs, and configurations\n" + + "- Errors encountered and how they were resolved\n" + + "- Current state of the work: what is DONE, what is IN PROGRESS, " + + "and what REMAINS to be done\n" + + "- The specific action the assistant was performing or about to " + + "perform when this summary was triggered\n\n" + + "Be dense and factual. Every sentence should convey essential " + + "context for continuation. Do not include pleasantries or " + + "conversational filler." + defaultCompactionSystemSummaryPrefix = "The following is a summary of " + + "the earlier conversation. The assistant was actively working when " + + "the context was compacted. Continue the work described below:" + defaultCompactionTimeout = 90 * time.Second ) type CompactionOptions struct {