-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Open
Labels
area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent QualityIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualitystatus/need-triageIssues that need to be triaged by the triage automation.Issues that need to be triaged by the triage automation.
Description
What would you like to be added?
Improve the EditTool indentation logic to intelligently rebase code blocks to match the target file's indentation. This includes handling multi-line replacements, preserving inline suffixes (like comments), and avoiding double-indentation.
Why is this needed?
The EditTool sometimes produces misaligned code when the AI's proposed new_string indentation doesn't perfectly match the file's context. Adding a robust rebasing step makes the tool more reliable and the resulting diffs cleaner.
Additional context
The implementation adds rebaseIndentation and handleTrailingSpaces utilities to the EditTool and integrates them into the exact, flexible, and regex matching paths.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent QualityIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualitystatus/need-triageIssues that need to be triaged by the triage automation.Issues that need to be triaged by the triage automation.