feat: add briefCompletionSummary setting to reduce verbose task completion summaries

This PR addresses Issue #10087 where users reported that task completion
summaries are redundant with the todo list content and take too long to generate.

Changes:
- Add new VSCode setting `briefCompletionSummary` (default: false)
- When enabled, instructs the AI to keep completion summaries concise (1-2 sentences)
- Avoids repeating details already visible in the todo list
- Add comprehensive tests for the new functionality

The setting is opt-in to preserve backward compatibility.
This commit is contained in:
Roo Code 2025-12-16 09:11:25 +00:00
parent 596783d365
commit c538ccb966
7 changed files with 82 additions and 1 deletions

View file

@ -66,4 +66,65 @@ describe("getAttemptCompletionDescription", () => {
// Should contain result parameter
expect(description).toContain("- result: (required)")
})
it("should include brief summary instruction when briefCompletionSummary setting is enabled", () => {
const args = {
cwd: "/test/path",
supportsComputerUse: false,
settings: {
briefCompletionSummary: true,
},
}
const description = getAttemptCompletionDescription(args)
// Should contain the brief summary mode instruction
expect(description).toContain("BRIEF SUMMARY MODE")
expect(description).toContain("Keep your completion result concise")
expect(description).toContain("one or two sentences")
expect(description).toContain("Avoid repeating details already visible in the todo list")
})
it("should NOT include brief summary instruction when briefCompletionSummary setting is disabled", () => {
const args = {
cwd: "/test/path",
supportsComputerUse: false,
settings: {
briefCompletionSummary: false,
},
}
const description = getAttemptCompletionDescription(args)
// Should NOT contain the brief summary mode instruction
expect(description).not.toContain("BRIEF SUMMARY MODE")
expect(description).not.toContain("Keep your completion result concise")
})
it("should NOT include brief summary instruction when briefCompletionSummary setting is not provided", () => {
const args = {
cwd: "/test/path",
supportsComputerUse: false,
settings: {},
}
const description = getAttemptCompletionDescription(args)
// Should NOT contain the brief summary mode instruction
expect(description).not.toContain("BRIEF SUMMARY MODE")
expect(description).not.toContain("Keep your completion result concise")
})
it("should NOT include brief summary instruction when settings is not provided", () => {
const args = {
cwd: "/test/path",
supportsComputerUse: false,
}
const description = getAttemptCompletionDescription(args)
// Should NOT contain the brief summary mode instruction
expect(description).not.toContain("BRIEF SUMMARY MODE")
expect(description).not.toContain("Keep your completion result concise")
})
})

View file

@ -1,9 +1,15 @@
import { ToolArgs } from "./types"
const BRIEF_SUMMARY_INSTRUCTION = `
BRIEF SUMMARY MODE: Keep your completion result concise - one or two sentences summarizing what was accomplished. Avoid repeating details already visible in the todo list or in previous tool outputs. The user can review the task history for details.`
export function getAttemptCompletionDescription(args?: ToolArgs): string {
const briefSummary = args?.settings?.briefCompletionSummary === true
const briefSummarySection = briefSummary ? BRIEF_SUMMARY_INSTRUCTION : ""
return `## attempt_completion
Description: After each tool use, the user will respond with the result of that tool use, i.e. if it succeeded or failed, along with any reasons for failure. Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user. The user may respond with feedback if they are not satisfied with the result, which you can use to make improvements and try again.
IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user that any previous tool uses were successful. Failure to do so will result in code corruption and system failure. Before using this tool, you must confirm that you've received successful results from the user for any previous tool uses. If not, then DO NOT use this tool.
IMPORTANT NOTE: This tool CANNOT be used until you've confirmed from the user that any previous tool uses were successful. Failure to do so will result in code corruption and system failure. Before using this tool, you must confirm that you've received successful results from the user for any previous tool uses. If not, then DO NOT use this tool.${briefSummarySection}
Parameters:
- result: (required) The result of the task. Formulate this result in a way that is final and does not require further input from the user. Don't end your result with questions or offers for further assistance.
Usage:

View file

@ -12,4 +12,6 @@ export interface SystemPromptSettings {
toolProtocol?: ToolProtocol
/** When true, model should hide vendor/company identity in responses */
isStealthModel?: boolean
/** When true, instructs AI to keep completion summaries brief to reduce generation time */
briefCompletionSummary?: boolean
}

View file

@ -3397,6 +3397,9 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
newTaskRequireTodos: vscode.workspace
.getConfiguration(Package.name)
.get<boolean>("newTaskRequireTodos", false),
briefCompletionSummary: vscode.workspace
.getConfiguration(Package.name)
.get<boolean>("briefCompletionSummary", false),
toolProtocol,
isStealthModel: modelInfo?.isStealthModel,
},

View file

@ -96,6 +96,9 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web
newTaskRequireTodos: vscode.workspace
.getConfiguration(Package.name)
.get<boolean>("newTaskRequireTodos", false),
briefCompletionSummary: vscode.workspace
.getConfiguration(Package.name)
.get<boolean>("briefCompletionSummary", false),
toolProtocol,
isStealthModel: modelInfo?.isStealthModel,
},

View file

@ -347,6 +347,11 @@
"default": false,
"description": "%commands.preventCompletionWithOpenTodos.description%"
},
"roo-cline.briefCompletionSummary": {
"type": "boolean",
"default": false,
"description": "%settings.briefCompletionSummary.description%"
},
"roo-cline.vsCodeLmModelSelector": {
"type": "object",
"properties": {

View file

@ -31,6 +31,7 @@
"commands.commandExecutionTimeout.description": "Maximum time in seconds to wait for command execution to complete before timing out (0 = no timeout, 1-600s, default: 0s)",
"commands.commandTimeoutAllowlist.description": "Command prefixes that are excluded from the command execution timeout. Commands matching these prefixes will run without timeout restrictions.",
"commands.preventCompletionWithOpenTodos.description": "Prevent task completion when there are incomplete todos in the todo list",
"settings.briefCompletionSummary.description": "Instruct the AI to keep task completion summaries brief instead of repeating information already visible in the todo list. This can reduce generation time at task completion.",
"settings.vsCodeLmModelSelector.description": "Settings for VSCode Language Model API",
"settings.vsCodeLmModelSelector.vendor.description": "The vendor of the language model (e.g. copilot)",
"settings.vsCodeLmModelSelector.family.description": "The family of the language model (e.g. gpt-4)",