Repository navigation
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Below is the conclusion at which Haiku 4.5 at copilot-github analysed codebase to figure out.
The Root ProblemThe edit tool has a critical design flaw in how it instructs agents to handle the line number prefix from the The Documentation IssueIn The problem: This instruction is extremely difficult for agents to follow because:
The Implementation Shows WhyLooking at the for (const replacer of [
SimpleReplacer,
LineTrimmedReplacer,
BlockAnchorReplacer,
WhitespaceNormalizedReplacer, // ← Handles whitespace issues
IndentationFlexibleReplacer, // ← Handles indentation issues
EscapeNormalizedReplacer,
TrimmedBoundaryReplacer,
ContextAwareReplacer,
MultiOccurrenceReplacer,
])Even with these fallback strategies:
These exist precisely because agents struggle with whitespace/indentation. The tool was designed with these fallbacks as a band-aid, acknowledging the fundamental problem. Why Agents Struggle
SolutionThe edit tool documentation should be updated to provide explicit visual guidance, such as:
|
bd87b2b to
360acdb
Compare
|
I can confirm this PR fix the indentation problem I was having with python code / opencode 1.1.53 and the following models: devstrall 2 small, GLM 4.7 flash, Qwen3-coder-next These indentation errors slow down a lot the agents and waste context space. |
be0b0ab to
16c1a73
Compare
Dear Nico, i met same problem, how did you resolve it? replace node_modules file? |
|
Latest changes in |
What does this PR do?
This PR helps models (tested with Haiku 4.5) use the "Edit" tool more effectively with regards to leading whitespace after reading context given by the "Read" tool. Fixes #10656
How did you verify your code works?
I tasked agents with writing Haskell (white-space sensitive) and they improved considerably their success rate (to consistently perfect edits) when using the Edit tool as to not introduce leading-whitespace related errors