feat(tools): Include the new content after edits#18
Open
BingqingLyu wants to merge 3 commits into
Open
Conversation
Introduces a new configuration setting, `readAfterEdit`, which is enabled by default. When this setting is active, the `edit` tool will automatically append the full content of a file to its response message (`llmContent`) after a successful modification or creation. This provides the AI with immediate context of the changes, improving its awareness of the file's current state and reducing the need for a subsequent `read_file` call. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Introduces a new configuration setting, `readAfterEdit`, which is enabled by default. When this setting is active, the `edit` tool will automatically append the full content of a file to its response message (`llmContent`) after a successful modification or creation. This provides the AI with immediate context of the changes, improving its awareness of the file's current state and reducing the need for a subsequent `read_file` call. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
…code into feat/read-after-edit
This was referenced Apr 28, 2026
5 tasks
Owner
Author
Conflict Group 1This PR shares modified functions with 17 other PR(s): #10, #106, #112, #113, #114, #117, #14, #17, #21, #22, #31, #36, #46, #7, #75, #86, #88. These PRs should be reviewed as a batch — merging one may affect the others.
graph LR
PR18["PR #18"]
FisSdkMcpServerConfig_803["isSdkMcpServerConfig<br>config.ts"]
PR18 -->|modifies| FisSdkMcpServerConfig_803
PR106["PR #106"]
PR106 -->|modifies| FisSdkMcpServerConfig_803
PR112["PR #112"]
PR112 -->|modifies| FisSdkMcpServerConfig_803
PR113["PR #113"]
PR113 -->|modifies| FisSdkMcpServerConfig_803
PR114["PR #114"]
PR114 -->|modifies| FisSdkMcpServerConfig_803
PR117["PR #117"]
PR117 -->|modifies| FisSdkMcpServerConfig_803
PR46["PR #46"]
PR46 -->|modifies| FisSdkMcpServerConfig_803
PR75["PR #75"]
PR75 -->|modifies| FisSdkMcpServerConfig_803
PR86["PR #86"]
PR86 -->|modifies| FisSdkMcpServerConfig_803
PR88["PR #88"]
PR88 -->|modifies| FisSdkMcpServerConfig_803
FnormalizeConfigOutputFormat_803["normalizeConfigOutputFormat<br>config.ts"]
PR18 -->|modifies| FnormalizeConfigOutputFormat_803
PR106 -->|modifies| FnormalizeConfigOutputFormat_803
PR112 -->|modifies| FnormalizeConfigOutputFormat_803
PR113 -->|modifies| FnormalizeConfigOutputFormat_803
PR114 -->|modifies| FnormalizeConfigOutputFormat_803
PR117 -->|modifies| FnormalizeConfigOutputFormat_803
PR75 -->|modifies| FnormalizeConfigOutputFormat_803
PR86 -->|modifies| FnormalizeConfigOutputFormat_803
PR88 -->|modifies| FnormalizeConfigOutputFormat_803
FparseArguments_6977["parseArguments<br>config.ts"]
PR18 -->|modifies| FparseArguments_6977
PR10["PR #10"]
PR10 -->|modifies| FparseArguments_6977
PR112 -->|modifies| FparseArguments_6977
PR113 -->|modifies| FparseArguments_6977
PR114 -->|modifies| FparseArguments_6977
PR117 -->|modifies| FparseArguments_6977
PR14["PR #14"]
PR14 -->|modifies| FparseArguments_6977
PR17["PR #17"]
PR17 -->|modifies| FparseArguments_6977
PR21["PR #21"]
PR21 -->|modifies| FparseArguments_6977
PR22["PR #22"]
PR22 -->|modifies| FparseArguments_6977
PR31["PR #31"]
PR31 -->|modifies| FparseArguments_6977
PR36["PR #36"]
PR36 -->|modifies| FparseArguments_6977
PR46 -->|modifies| FparseArguments_6977
PR7["PR #7"]
PR7 -->|modifies| FparseArguments_6977
PR86 -->|modifies| FparseArguments_6977
PR88 -->|modifies| FparseArguments_6977
Posted by codegraph-ai conflict detection. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Add a new
readAfterEditconfiguration option (default: true) that controls whether file content is automatically read and provided to the LLM after edit operations. This enhances the AI's context awareness by including updated file content in responses, making the AI more aware of the changes it has made.Dive Deeper
This PR introduces a new configuration setting that addresses the most common frustration: the "Failed to edit, 0 occurrences found for old_string" error. This error typically occurs when the AI attempts consecutive edits or follow-up modifications because it loses context of what it just changed.
Previously, after performing file edits, the AI would only receive a success message but wouldn't see the actual updated content. This meant that in multi-step editing workflows, the AI would often try to edit based on its memory of the original file content rather than the current state, leading to failed edits and frustrated users.
Current workaround: Users have to manually tell the AI to re-read the file before each subsequent edit (e.g., "First read the file, then make this change"), which is tedious, interrupts workflow, and isn't obvious to new users.
Key Changes:
readAfterEditboolean setting to the settings schema with default valuetrueedit.tstool to conditionally include the new content in LLM responses after successful edits"readAfterEdit": falsein their settings.jsonBenefits:
Reviewer Test Plan
To validate this change:
Test with feature enabled (default):
llmContent)Test with feature disabled:
"readAfterEdit": falsein your settings.jsonllmContent)Test edge cases:
Example prompts to test:
Testing Matrix
Linked issues / bugs