Skip to content

Comments

Add write-only mode option for todo tool#260688

Merged
bhavyaus merged 5 commits intomainfrom
copilot/fix-260687
Aug 17, 2025
Merged

Add write-only mode option for todo tool#260688
bhavyaus merged 5 commits intomainfrom
copilot/fix-260687

Conversation

Copy link
Contributor

Copilot AI commented Aug 8, 2025

The todo tool now supports a write-only mode to prevent unnecessary read operations during new chat turns, since tool invocations remain in context for the agent.

Changes

New Configuration Setting:

  • Added chat.todoListTool.writeOnly boolean setting (default: false)
  • Marked as experimental to match the existing todo tool setting

Dynamic Schema Generation:

  • Created createManageTodoListToolData(writeOnly) function for conditional schema building
  • In write-only mode: removes the operation parameter entirely, only requires todoList
  • In normal mode: preserves existing behavior with both 'read' and 'write' operations

Tool Implementation:

  • Updated ManageTodoListTool constructor to accept writeOnly parameter
  • Modified invoke() method to always perform write operations in write-only mode
  • Adapted prepareToolInvocation() to handle optional operation parameter
  • Tool registration now reads configuration to instantiate appropriate version

Example Usage

Normal mode (existing behavior):

{
  "operation": "write",
  "todoList": [{"id": 1, "title": "Fix bug", "description": "...", "status": "not-started"}]
}

Write-only mode (new):

{
  "todoList": [{"id": 1, "title": "Fix bug", "description": "...", "status": "not-started"}]
}

The write-only mode eliminates redundant context checking while maintaining full backward compatibility when the setting is disabled.

Fixes #260687.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • electronjs.org
    • Triggering command: node-gyp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Option for write-only todo tool Add write-only mode option for todo tool Aug 8, 2025
Copilot AI requested a review from digitarald August 8, 2025 23:23
Copy link
Contributor

@digitarald digitarald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot address comments

@digitarald
Copy link
Contributor

@copilot failing CI:

[valid-layers-check       ] src/vs/workbench/contrib/chat/common/tools/manageTodoListTool.ts:27:14 - error TS2451: Cannot redeclare block-scoped variable 'ManageTodoListToolToolId'.
[valid-layers-check       ] 
[valid-layers-check       ] 27 export const ManageTodoListToolToolId = 'manage_todo_list';
[valid-layers-check       ]                 ~~~~~~~~~~~~~~~~~~~~~~~~
[valid-layers-check       ] src/vs/workbench/contrib/chat/common/tools/manageTodoListTool.ts:29:14 - error TS2451: Cannot redeclare block-scoped variable 'ManageTodoListToolToolId'.
[valid-layers-check       ] 
[valid-layers-check       ] 29 export const ManageTodoListToolToolId = 'manage_todo_list';
[valid-layers-check       ]                 ~~~~~~~~~~~~~~~~~~~~~~~~
[valid-layers-check       ] 
[valid-layers-check       ] Found 2 errors in the same file, starting at: src/vs/workbench/contrib/chat/common/tools/manageTodoListTool.ts:27

Copy link
Contributor Author

Copilot AI commented Aug 11, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • electronjs.org
    • Triggering command: node-gyp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Contributor Author

Copilot AI commented Aug 11, 2025

@copilot failing CI:

...

Fixed the compilation error by removing the duplicate ManageTodoListToolToolId declaration. The TypeScript error about redeclaring block-scoped variable has been resolved. Fixed in commit e05310e.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • electronjs.org
    • Triggering command: node-gyp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@digitarald digitarald marked this pull request as ready for review August 13, 2025 00:41
@digitarald digitarald requested a review from bhavyaus August 13, 2025 00:41
@vs-code-engineering vs-code-engineering bot added this to the August 2025 milestone Aug 13, 2025
@digitarald digitarald requested a review from Copilot August 13, 2025 02:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a write-only mode option for the todo tool to prevent unnecessary read operations during new chat turns, since tool invocations remain in context for the agent.

  • Adds a new chat.todoListTool.writeOnly boolean configuration setting (marked experimental)
  • Implements dynamic schema generation that conditionally removes the operation parameter in write-only mode
  • Updates the ManageTodoListTool to handle write-only behavior by always performing write operations when enabled

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/vs/workbench/contrib/chat/common/tools/tools.ts Updates tool registration to read configuration and instantiate write-only version when enabled
src/vs/workbench/contrib/chat/common/tools/manageTodoListTool.ts Implements write-only mode logic with dynamic schema generation and conditional operation handling
src/vs/workbench/contrib/chat/browser/chat.contribution.ts Adds the new experimental configuration setting for write-only mode

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

bhavyaus
bhavyaus previously approved these changes Aug 14, 2025
…update markdown header from "Task List" to "Todo List"
@bhavyaus bhavyaus force-pushed the copilot/fix-260687 branch from a4b05e9 to a01d6f2 Compare August 17, 2025 03:10
@bhavyaus bhavyaus enabled auto-merge (squash) August 17, 2025 03:11
@bhavyaus bhavyaus dismissed digitarald’s stale review August 17, 2025 03:55

reviewed prior

@bhavyaus bhavyaus merged commit 28ab4aa into main Aug 17, 2025
18 checks passed
@bhavyaus bhavyaus deleted the copilot/fix-260687 branch August 17, 2025 03:55
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Oct 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option for write-only todo tool

4 participants