[GH-ISSUE #104] [Feature]: Better agentic tools and stop button #75

Closed
opened 2026-03-03 13:58:42 +03:00 by kerem · 3 comments
Owner

Originally created by @HenkieTenkie62 on GitHub (Sep 19, 2025).
Original GitHub issue: https://github.com/Kuingsmile/word-GPT-Plus/issues/104

Originally assigned to: @Kuingsmile on GitHub.

前置阅读 | Pre-reading

服务类型 | Service Type

Self-hosted service

系统信息 | System Information

Windows

Office 版本 | Office Version

microsoft 365

功能请求 | Feature request

Great tool, very useful!

But I am missing a stop button. If the agent doesn't follow the plan i just wait for it to complete.

I also think the agent tools could be improved. If you do not select whole document the agent does not read the document.
Could this be made more like VSCode Copilot?

Image

Here you can choose, select and add context for the chat/agent.
Also agents in Copilot have the ability to search and insert edits to the document with tools:

https://code.visualstudio.com/docs/copilot/reference/copilot-vscode-features#_chat-tools

This is how the toolfunction is declared in chat:

# Tools

You may call one or more functions to assist with the user query.

You are provided with function signatures within <tools></tools> XML tags:
<tools>
... other tools ...
{"type": "function", "function": {"name": "grep_search", "description": "Do a fast text search in the workspace. Use this tool when you want to search with an exact string or regex. If you are not sure what words will appear in the workspace, prefer using regex patterns with alternation (|) or character classes to search for multiple potential words at once instead of making separate searches. For example, use \'function|method|procedure\' to look for all of those words at once. Use includePattern to search within files matching a specific pattern, or in a specific file, using a relative path. Use this tool when you want to see an overview of a particular file, instead of using read_file many times to look for code within a file.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The pattern to search for in files in the workspace. Use regex with alternation (e.g., \'word1|word2|word3\') or character classes to find multiple potential words in a single search. Be sure to set the isRegexp property properly to declare whether it\'s a regex or plain text pattern. Is case-insensitive."}, "isRegexp": {"type": "boolean", "description": "Whether the pattern is a regex."}, "includePattern": {"type": "string", "description": "Search files matching this glob pattern. Will be applied to the relative path of files within the workspace. To search recursively inside a folder, use a proper glob pattern like \\"src/folder/**\\". Do not use | in includePattern."}, "maxResults": {"type": "number", "description": "The maximum number of results to return. Do not use this unless necessary, it can slow things down. By default, only some matches are returned. If you use this and don\'t see what you\'re looking for, you can try again with a more specific query or a larger maxResults."}}, "required": ["query", "isRegexp"]}}}
...more tools ...
#this is a great one is think:
{"type": "function", "function": {"name": "insert_edit_into_file", "description": "Insert new code into an existing file in the workspace. Use this tool once per file that needs to be modified, even if there are multiple changes for a file. Generate the \\"explanation\\" property first.\
The system is very smart and can understand how to apply your edits to the files, you just need to provide minimal hints.\
Avoid repeating existing code, instead use comments to represent regions of unchanged code. Be as concise as possible. For example:\
// ...existing code...\
{ changed code }\
// ...existing code...\
{ changed code }\
// ...existing code...\
\
Here is an example of how you should use format an edit to an existing Person class:\
class Person {\
\\t// ...existing code...\
\\tage: number;\
\\t// ...existing code...\
\\tgetAge() {\
\\treturn this.age;\
\\t}\
}", "parameters": {"type": "object", "properties": {"explanation": {"type": "string", "description": "A short explanation of the edit being made."}, "filePath": {"type": "string", "description": "An absolute path to the file to edit."}, "code": {"type": "string", "description": "The code change to apply to the file.\
The system is very smart and can understand how to apply your edits to the files, you just need to provide minimal hints.\
Avoid repeating existing code, instead use comments to represent regions of unchanged code. Be as concise as possible. For example:\
// ...existing code...\
{ changed code }\
// ...existing code...\
{ changed code }\
// ...existing code...\
\
Here is an example of how you should use format an edit to an existing Person class:\
class Person {\
\\t// ...existing code...\
\\tage: number;\
\\t// ...existing code...\
\\tgetAge() {\
\\t\\treturn this.age;\
\\t}\
}"}}, "required": ["explanation", "filePath", "code"]}}}

<editFileInstructions>
Don\'t try to edit an existing file without reading it first, so you can make changes properly.
Use the insert_edit_into_file tool to edit files. When editing files, group your changes by file.
NEVER show the changes to the user, just call the tool, and the edits will be applied and shown to the user.
NEVER print a codeblock that represents a change to a file, use insert_edit_into_file instead.
For each file, give a short description of what needs to be changed, then use the insert_edit_into_file tool. You can use any tool multiple times in a response, and you can keep writing text after using a tool.
Follow best practices when editing files. If a popular external library exists to solve a problem, use it and properly install the package e.g. with "npm install" or creating a "requirements.txt".
If you\'re building a webapp from scratch, give it a beautiful and modern UI.
After editing a file, any new errors in the file will be in the tool result. Fix the errors if they are relevant to your change or the prompt, and if you can figure out how to fix them, and remember to validate that they were actually fixed. Do not loop more than 3 times attempting to fix errors in the same file. If the third try fails, you should stop and ask the user what to do next.
The insert_edit_into_file tool is very smart and can understand how to apply your edits to the user\'s files, you just need to provide minimal hints.
When you use the insert_edit_into_file tool, avoid repeating existing code, instead use comments to represent regions of unchanged code. The tool prefers that you are as concise as possible. For example:
// ...existing code...
changed code
// ...existing code...
changed code
// ...existing code...

Here is an example of how you should format an edit to an existing Person class:
class Person {
\t// ...existing code...
\tage: number;
\t// ...existing code...
\tgetAge() {
\t\treturn this.age;
\t}
}
</editFileInstructions>

Usage by model:

<tool_call>grep_search
<arg_key>query</arg_key>
<arg_value>## Storing" OR "## 6\\."</arg_value>
<arg_key>isRegexp</arg_key>
<arg_value>true</arg_value>
<arg_key>includePattern</arg_key>
<arg_value>c:\\\\Users\\\\user\\\\Documents\\\\Test\\\\20040000A-02 HL\\\\20040000A-02 HL.md</arg_value>
</tool_call>
... and ...
<tool_call>insert_edit_into_file
<arg_key>explanation</arg_key>
<arg_value>Voeg voorbeelden en duidelijke uitleg toe aan hoofdstuk 1: Inleiding</arg_value>
<arg_key>filePath</arg_key>
<arg_value>c:\\Users\\user\\Documents\\Test\\machine_manual_template_revised.html</arg_value>
<arg_key>code</arg_key>
<arg_value>...content...</arg_value>
</tool_call>

I think this would greatly increase it's utility value!

Originally created by @HenkieTenkie62 on GitHub (Sep 19, 2025). Original GitHub issue: https://github.com/Kuingsmile/word-GPT-Plus/issues/104 Originally assigned to: @Kuingsmile on GitHub. ### 前置阅读 | Pre-reading - [x] [Issues](https://github.com/Kuingsmile/word-gpt-plus/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed) - [x] [README](https://github.com/Kuingsmile/word-gpt-plus/blob/master/README.md) ### 服务类型 | Service Type Self-hosted service ### 系统信息 | System Information Windows ### Office 版本 | Office Version microsoft 365 ### 功能请求 | Feature request Great tool, very useful! But I am missing a stop button. If the agent doesn't follow the plan i just wait for it to complete. I also think the agent tools could be improved. If you do not select whole document the agent does not read the document. Could this be made more like VSCode Copilot? <img width="403" height="197" alt="Image" src="https://github.com/user-attachments/assets/8e6c8541-af91-4d7e-aeb9-1f11e2ca9637" /> Here you can choose, select and add context for the chat/agent. Also agents in Copilot have the ability to search and insert edits to the document with tools: https://code.visualstudio.com/docs/copilot/reference/copilot-vscode-features#_chat-tools This is how the toolfunction is declared in chat: ``` # Tools You may call one or more functions to assist with the user query. You are provided with function signatures within <tools></tools> XML tags: <tools> ... other tools ... {"type": "function", "function": {"name": "grep_search", "description": "Do a fast text search in the workspace. Use this tool when you want to search with an exact string or regex. If you are not sure what words will appear in the workspace, prefer using regex patterns with alternation (|) or character classes to search for multiple potential words at once instead of making separate searches. For example, use \'function|method|procedure\' to look for all of those words at once. Use includePattern to search within files matching a specific pattern, or in a specific file, using a relative path. Use this tool when you want to see an overview of a particular file, instead of using read_file many times to look for code within a file.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The pattern to search for in files in the workspace. Use regex with alternation (e.g., \'word1|word2|word3\') or character classes to find multiple potential words in a single search. Be sure to set the isRegexp property properly to declare whether it\'s a regex or plain text pattern. Is case-insensitive."}, "isRegexp": {"type": "boolean", "description": "Whether the pattern is a regex."}, "includePattern": {"type": "string", "description": "Search files matching this glob pattern. Will be applied to the relative path of files within the workspace. To search recursively inside a folder, use a proper glob pattern like \\"src/folder/**\\". Do not use | in includePattern."}, "maxResults": {"type": "number", "description": "The maximum number of results to return. Do not use this unless necessary, it can slow things down. By default, only some matches are returned. If you use this and don\'t see what you\'re looking for, you can try again with a more specific query or a larger maxResults."}}, "required": ["query", "isRegexp"]}}} ...more tools ... #this is a great one is think: {"type": "function", "function": {"name": "insert_edit_into_file", "description": "Insert new code into an existing file in the workspace. Use this tool once per file that needs to be modified, even if there are multiple changes for a file. Generate the \\"explanation\\" property first.\ The system is very smart and can understand how to apply your edits to the files, you just need to provide minimal hints.\ Avoid repeating existing code, instead use comments to represent regions of unchanged code. Be as concise as possible. For example:\ // ...existing code...\ { changed code }\ // ...existing code...\ { changed code }\ // ...existing code...\ \ Here is an example of how you should use format an edit to an existing Person class:\ class Person {\ \\t// ...existing code...\ \\tage: number;\ \\t// ...existing code...\ \\tgetAge() {\ \\treturn this.age;\ \\t}\ }", "parameters": {"type": "object", "properties": {"explanation": {"type": "string", "description": "A short explanation of the edit being made."}, "filePath": {"type": "string", "description": "An absolute path to the file to edit."}, "code": {"type": "string", "description": "The code change to apply to the file.\ The system is very smart and can understand how to apply your edits to the files, you just need to provide minimal hints.\ Avoid repeating existing code, instead use comments to represent regions of unchanged code. Be as concise as possible. For example:\ // ...existing code...\ { changed code }\ // ...existing code...\ { changed code }\ // ...existing code...\ \ Here is an example of how you should use format an edit to an existing Person class:\ class Person {\ \\t// ...existing code...\ \\tage: number;\ \\t// ...existing code...\ \\tgetAge() {\ \\t\\treturn this.age;\ \\t}\ }"}}, "required": ["explanation", "filePath", "code"]}}} <editFileInstructions> Don\'t try to edit an existing file without reading it first, so you can make changes properly. Use the insert_edit_into_file tool to edit files. When editing files, group your changes by file. NEVER show the changes to the user, just call the tool, and the edits will be applied and shown to the user. NEVER print a codeblock that represents a change to a file, use insert_edit_into_file instead. For each file, give a short description of what needs to be changed, then use the insert_edit_into_file tool. You can use any tool multiple times in a response, and you can keep writing text after using a tool. Follow best practices when editing files. If a popular external library exists to solve a problem, use it and properly install the package e.g. with "npm install" or creating a "requirements.txt". If you\'re building a webapp from scratch, give it a beautiful and modern UI. After editing a file, any new errors in the file will be in the tool result. Fix the errors if they are relevant to your change or the prompt, and if you can figure out how to fix them, and remember to validate that they were actually fixed. Do not loop more than 3 times attempting to fix errors in the same file. If the third try fails, you should stop and ask the user what to do next. The insert_edit_into_file tool is very smart and can understand how to apply your edits to the user\'s files, you just need to provide minimal hints. When you use the insert_edit_into_file tool, avoid repeating existing code, instead use comments to represent regions of unchanged code. The tool prefers that you are as concise as possible. For example: // ...existing code... changed code // ...existing code... changed code // ...existing code... Here is an example of how you should format an edit to an existing Person class: class Person { \t// ...existing code... \tage: number; \t// ...existing code... \tgetAge() { \t\treturn this.age; \t} } </editFileInstructions> ``` Usage by model: ``` <tool_call>grep_search <arg_key>query</arg_key> <arg_value>## Storing" OR "## 6\\."</arg_value> <arg_key>isRegexp</arg_key> <arg_value>true</arg_value> <arg_key>includePattern</arg_key> <arg_value>c:\\\\Users\\\\user\\\\Documents\\\\Test\\\\20040000A-02 HL\\\\20040000A-02 HL.md</arg_value> </tool_call> ... and ... <tool_call>insert_edit_into_file <arg_key>explanation</arg_key> <arg_value>Voeg voorbeelden en duidelijke uitleg toe aan hoofdstuk 1: Inleiding</arg_value> <arg_key>filePath</arg_key> <arg_value>c:\\Users\\user\\Documents\\Test\\machine_manual_template_revised.html</arg_value> <arg_key>code</arg_key> <arg_value>...content...</arg_value> </tool_call> ``` I think this would greatly increase it's utility value!
kerem 2026-03-03 13:58:42 +03:00
Author
Owner

@Kuingsmile commented on GitHub (Nov 13, 2025):

agent in Copilot is much more complex than the agent tool in this project, I need more time to improve my skills in order to enhance the project.

<!-- gh-comment-id:3525904553 --> @Kuingsmile commented on GitHub (Nov 13, 2025): agent in Copilot is much more complex than the agent tool in this project, I need more time to improve my skills in order to enhance the project.
Author
Owner

@Kuingsmile commented on GitHub (Dec 23, 2025):

@HenkieTenkie62 I’m happy to say that I’ve made a big improvement to the agent mode! As you can see in the GIF below, I’ll keep optimizing it and will release the first rewritten version soon.

MCP support is also under development.

Image

Image
<!-- gh-comment-id:3686887654 --> @Kuingsmile commented on GitHub (Dec 23, 2025): @HenkieTenkie62 I’m happy to say that I’ve made a big improvement to the agent mode! As you can see in the GIF below, I’ll keep optimizing it and will release the first rewritten version soon. MCP support is also under development. ![Image](https://github.com/user-attachments/assets/6cb5196e-13d3-4d1c-b3b3-89a36a650e24) <img width="528" height="1551" alt="Image" src="https://github.com/user-attachments/assets/3ef7bb4b-4a5b-418a-adae-eb36912e938c" />
Author
Owner

@HenkieTenkie62 commented on GitHub (Dec 23, 2025):

Great I'll check it out when I have the time 👌

<!-- gh-comment-id:3687158380 --> @HenkieTenkie62 commented on GitHub (Dec 23, 2025): Great I'll check it out when I have the time 👌
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/word-GPT-Plus#75
No description provided.