diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 7dda3471d..1cb6adbe4 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -1,11 +1,16 @@ # Changelog ## [Unreleased] - ### Added +- Added `todos.enabled` setting to control availability of the todo_write tool for task tracking - Added `tools` field to agent frontmatter for declaring agent-specific tool capabilities +### Changed + +- Renamed todo completion settings from `todoCompletion.*` to `todos.reminders.*` and `todos.enabled` for clearer organization +- Updated todo reminder logic to check both `todos.reminders` and `todos.enabled` settings independently + ### Removed - Removed project tree snapshot generation from system prompt (unused feature) diff --git a/packages/coding-agent/src/config/settings-schema.ts b/packages/coding-agent/src/config/settings-schema.ts index 2c8044c08..4c159e6c9 100644 --- a/packages/coding-agent/src/config/settings-schema.ts +++ b/packages/coding-agent/src/config/settings-schema.ts @@ -264,12 +264,12 @@ export const SETTINGS_SCHEMA = { // ───────────────────────────────────────────────────────────────────────── // Todo completion settings // ───────────────────────────────────────────────────────────────────────── - "todoCompletion.enabled": { + "todo.reminders": { type: "boolean", default: false, - ui: { tab: "behavior", label: "Todo completion", description: "Remind agent to complete todos before stopping" }, + ui: { tab: "behavior", label: "Todo reminders", description: "Remind agent to complete todos before stopping" }, }, - "todoCompletion.maxReminders": { + "todo.reminders.max": { type: "number", default: 3, ui: { @@ -280,6 +280,15 @@ export const SETTINGS_SCHEMA = { }, }, + // ───────────────────────────────────────────────────────────────────────── + // Todos settings + // ───────────────────────────────────────────────────────────────────────── + "todo.enabled": { + type: "boolean", + default: true, + ui: { tab: "tools", label: "Todos", description: "Enable the todo_write tool for task tracking" }, + }, + // ───────────────────────────────────────────────────────────────────────── // Startup settings // ───────────────────────────────────────────────────────────────────────── @@ -822,7 +831,6 @@ export interface BashInterceptorRule { export interface GroupTypeMap { compaction: CompactionSettings; retry: RetrySettings; - todoCompletion: TodoCompletionSettings; branchSummary: BranchSummarySettings; skills: SkillsSettings; commit: CommitSettings; diff --git a/packages/coding-agent/src/session/agent-session.ts b/packages/coding-agent/src/session/agent-session.ts index 7b669fc1e..81b0a1b90 100644 --- a/packages/coding-agent/src/session/agent-session.ts +++ b/packages/coding-agent/src/session/agent-session.ts @@ -2461,13 +2461,15 @@ Be thorough - include exact file paths, function names, error messages, and tech * Check if agent stopped with incomplete todos and prompt to continue. */ private async _checkTodoCompletion(): Promise { - const todoSettings = this.settings.getGroup("todoCompletion"); - if (!todoSettings.enabled) { + const remindersEnabled = this.settings.get("todo.reminders"); + const todosEnabled = this.settings.get("todo.enabled"); + if (!remindersEnabled || !todosEnabled) { this._todoReminderCount = 0; return; } - if (this._todoReminderCount >= todoSettings.maxReminders) { + const remindersMax = this.settings.get("todo.reminders.max"); + if (this._todoReminderCount >= remindersMax) { logger.debug("Todo completion: max reminders reached", { count: this._todoReminderCount }); return; } @@ -2503,7 +2505,7 @@ Be thorough - include exact file paths, function names, error messages, and tech `\n` + `You stopped with ${incomplete.length} incomplete todo item(s):\n${todoList}\n\n` + `Please continue working on these tasks or mark them complete if finished.\n` + - `(Reminder ${this._todoReminderCount}/${todoSettings.maxReminders})\n` + + `(Reminder ${this._todoReminderCount}/${remindersMax})\n` + ``; logger.debug("Todo completion: sending reminder", { @@ -2516,7 +2518,7 @@ Be thorough - include exact file paths, function names, error messages, and tech type: "todo_reminder", todos: incomplete, attempt: this._todoReminderCount, - maxAttempts: todoSettings.maxReminders, + maxAttempts: remindersMax, }); // Inject reminder and continue the conversation diff --git a/packages/coding-agent/src/tools/index.ts b/packages/coding-agent/src/tools/index.ts index 820c483ec..7fb649423 100644 --- a/packages/coding-agent/src/tools/index.ts +++ b/packages/coding-agent/src/tools/index.ts @@ -278,6 +278,7 @@ export async function createTools(session: ToolSession, toolNames?: string[]): P if (name === "lsp") return enableLsp; if (name === "bash") return allowBash; if (name === "python") return allowPython; + if (name === "todo_write") return !includeSubmitResult && session.settings.get("todo.enabled"); return true; }; if (includeSubmitResult && requestedTools && !requestedTools.includes("submit_result")) {