Skip to content

fix: skip slow file processing before write on large files#22403

Open
chebykinn wants to merge 2 commits intoanomalyco:devfrom
chebykinn:fix-stuck-write
Open

fix: skip slow file processing before write on large files#22403
chebykinn wants to merge 2 commits intoanomalyco:devfrom
chebykinn:fix-stuck-write

Conversation

@chebykinn
Copy link
Copy Markdown

Issue for this PR

Closes #11112, #22222, #16371, and related bugs for formatting large files and lsp diagnostics.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

This PR fixes "Pending write" issue that I've been noticing on large files. It adds a file size gate for write, apply_patch, format and lsp diagnostics runs. For write and apply_patch it prevents from running a slow two-file diff tool.

How did you verify your code works?

I have created unit tests, and I've also run a test with GLM model:

  1. Created a large file.
  2. Asked the agent to edit the file using "write" tool.
  3. Made sure that the tool is called, and that it is not stuck on "Pending write".

Lmk if I need to verify anything else.

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search results, I found one potentially related PR:

Related PR Found:

This PR appears related because it also addresses the "Pending/Preparing write" issue with large files, which is the core problem your PR (22403) is fixing. However, they seem to take different approaches (streaming progress vs. skipping slow processing), so they may be complementary rather than duplicate fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

always stuck at “Preparing write...”

1 participant