-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(tools): Include the new content after edits #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ajiwo
wants to merge
20
commits into
QwenLM:main
Choose a base branch
from
ajiwo:feat/read-after-edit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
ef9fc1e to
d29967e
Compare
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 <[email protected]>
d29967e to
d2d1e74
Compare
…oject level memory show
use sub-command to switch between project and global memory ops
* fix: add explicit background param for shell tool * fix: explicit param schema * docs(shelltool): update `is_background` description
* fix: sync token among multiple qwen sessions * fix: adjust cleanup function
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 <[email protected]>
…code into feat/read-after-edit
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