You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR introduces a new file_edit tool that allows for targeted text replacements within files without constructing manual diff blocks. It also includes UI updates for better visualization of file edit operations, enhanced task management with manual message queuing, and improvements to the system prompt documentation. The changes enable more deterministic file editing while maintaining user approval workflows.
🔍 Impact of the Change
The introduction of the file_edit tool provides a more straightforward approach to file modifications compared to the existing apply_diff tool. The UI enhancements improve user experience by clearly displaying file edit operations. Task management improvements ensure better handling of manual user messages during active conversations. System prompt updates provide clearer guidance on tool usage.
📁 Total Files Changed
File
ChangeLog
tool.ts
Added file_edit to native tools list
nativeToolCallHelpers.ts
Updated tool call parameters and native tools usage
openrouter.ts
Added custom request options for task metadata and logging
presentAssistantMessage.ts
Integrated file_edit tool handling and presentation
system-prompt snapshots
Updated documentation to include file_edit tool usage examples
sections.spec.ts
Updated test cases to include file_edit in capabilities
capabilities.ts
Enhanced capabilities section to include file_edit tool
rules.ts
Updated rules to reference file_edit tool
system.ts
Added detailed apply_diff tool description and effective diff strategy
file-edit.ts
Added new file with file_edit tool description
tools/index.ts
Integrated file_edit tool description and updated tool management
apply_diff.ts
Added strict mode to apply_diff tool
ask_followup_question.ts
Updated mode description for follow-up questions
file_edit.ts
Added new native tool definition for file_edit
getAllowedJSONToolsForMode.ts
Updated tool filtering to include file_edit
native-tools/index.ts
Integrated file_edit native tool
search_files.ts
Enhanced file pattern description
Task.ts
Implemented manual message queue for user responses and improved task handling
fileEditTool.ts
Added new implementation for file_edit tool with validation and replacement logic
ExtensionMessage.ts
Added fileEdit to tool types and replaceAll parameter
experiments.ts
Enabled MORPH_FAST_APPLY experiment
tools.ts
Added file_edit tool parameters and interface definitions
ChatRow.tsx
Added UI components for fileEdit tool display
ChatView.tsx
Enhanced message handling for task resumption and sending
FollowUpSuggest.tsx
Updated follow-up suggestion styling
MarkdownBlock.tsx
Adjusted paragraph margins
🧪 Test Added/Recommended
Added
Updated test cases in sections.spec.ts to include file_edit in capabilities section
Recommended
Add comprehensive unit tests for fileEditTool.ts covering various replacement scenarios
Add integration tests for manual message queue functionality in Task.ts
✅ Reviewed the changes: This PR introduces a new file_edit tool and integrates it across the system. Key changes include tool definitions, prompt updates, UI components, and the core implementation in fileEditTool.ts. Several issues were identified, including a critical regex escaping bug, performance concerns with polling intervals, and debug logs that should be removed.
This PR introduces a new file_edit tool for precise text replacements within files, enhances UI/UX elements, and refactors tool management logic to support Morph fast apply features. It also includes prompt improvements and task handling optimizations.
New Features
Introduced a new file_edit tool that allows targeted text replacements within a single file without manual diff construction.
Added detailed tool descriptions and usage instructions for file_edit in system prompts and documentation.
Implemented manual message queue processing in Task.ts to handle user inputs asynchronously during streaming or ask-response states.
Enabled strict mode for apply_diff tool usage to enforce precise content matching.
Added support for replaceAll parameter in fileEdit tool use interface and UI components.
Introduced resume task and resume completed task states in ChatView for better task lifecycle management.
Added a new experiment configuration MORPH_FAST_APPLY enabled by default for Morph fast apply capabilities.
Bug fixes
Fixed UI rendering issues in ChatRow by adding proper icons and styling for file edit operations.
Improved error handling and validation in fileEditTool.ts to prevent invalid replacements and missing parameters.
Corrected prompt descriptions to include file_edit alongside other editing tools for better clarity.
Resolved issues with tool exclusion logic when Morph fast apply is enabled by updating native tool filtering.
Enhanced replacer logic in fileEditTool.ts with multiple strategies for improved text matching accuracy.
Commits
update follow ups and ui: UI enhancements and follow-up suggestion updates (01382b) by code-crusher(vatsal.bajpai05@gmail.com)
new file edit tool: Implementation of the new file edit tool and related logic (e78bd0) by code-crusher(vatsal.bajpai05@gmail.com)
add exec cmd tool in prompt: Added execute command tool description in system prompts (8f2600) by code-crusher(vatsal.bajpai05@gmail.com)
Dependencies added
Added new TypeScript interfaces and type definitions in src/shared/tools.ts for FileEditToolUse to support structured tool usage.
Introduced new UI components in webview-ui/src/components/chat/ChatRow.tsx to render fileEdit tool operations with appropriate icons and accordions.
Added new prompt description modules in src/core/prompts/tools/file-edit.ts and updated index files to include fileEdit tool documentation.
Integrated new native tool definitions in src/core/prompts/tools/native-tools/file_edit.ts with strict parameter validation.
Updated experiment configurations in src/shared/experiments.ts to enable MORPH_FAST_APPLY by default.
I encountered an error while processing your request. Please try again later.
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
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.
No description provided.