fix(write): only include written-file diagnostics in tool output#18894
fix(write): only include written-file diagnostics in tool output#18894Haohao-end wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: PR #16424: fix(lsp): filter diagnostics to current project paths only Why it might be related: This PR also addresses filtering diagnostics output, similar to PR #18894 which filters diagnostics to only include those from the written file. Both are concerned with reducing unnecessary diagnostic information in tool output, though PR #16424 focuses on project path filtering while #18894 focuses on file-specific filtering in the write tool. The other results (PRs #6844 and #7015) appear to be older and less directly related to the current diagnostic filtering approach. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Issue for this PR
Closes #17578
Type of change
What does this PR do?
This fixes the
writetool so it only includes diagnostics for the file that was just written.Before this change,
writewould collect project-wide LSP diagnostics and append unrelated errors from other files into the tool output. That makes the returned tool result larger than necessary and can contribute to SSE timeouts in the provider path.This patch keeps the change local to
write:I chose this approach because it matches the narrower diagnostics behavior already used by
edit/apply_patch, while still preserving useful error output for the file the tool actually modified.How did you verify your code works?
I verified the change by reviewing the affected tool-result path and adding a focused regression test for the
writetool output.The new test covers the case where:
It checks that:
I also ran
git diff --checkto make sure the patch is clean and does not introduce formatting issues.Screenshots / recordings
N/A
Checklist