eca icon indicating copy to clipboard operation
eca copied to clipboard

eca-rewrite does not work on large files

Open ak-fr opened this issue 7 months ago • 1 comments

eca-rewrite on emacs waits infinitely on Requesting LLM... **r**eject on large files, even though the text part to be rewritten is small.

Note: The usual eca chat works fine.

Doctor

ECA version: 0.128.1

Server cmd: /home/me/.emacs.d/eca/eca server

Workspaces: /home/me/workspace

Default model: mistral/mistral-large-latest (API key (**********))

Logged providers: None
Relevant env vars: 

Credential files: None found
Image

Update: I think I have pinned down the issue. It doesn't work with large files(even if the text to be rewritten is small). I tried opening a new file in the same folder, and it worked! I increased the file size the eca-rewrite stopped working!

I think I should move this issue to eca-emacs

ak-fr avatar Apr 21 '26 12:04 ak-fr

Thanks for the report!

Root cause: the server was always inlining the entire target file into the rewrite prompt, regardless of how small the selected text was. With a large file + mistral-large-latest (which flows through the generic openai-chat provider path that has no stream idle timeout), the upstream request would stall and ECA would wait forever on "Requesting LLM...".

Fix: when the file exceeds rewrite.fullFileMaxLines (new config, default 2000), only a window of that many lines centered on your selection is inlined, with a small truncation marker so the model knows the context is partial. Files within the cap keep the current behavior.

Override example (e.g. if your model has a larger context window):

{
  "rewrite": {
    "fullFileMaxLines": 4000
  }
}

Docs: https://eca.dev/config/rewrite/#large-files

Will ship in the next release. Please re-open if you still hit it after upgrading.

ericdallo avatar Apr 23 '26 14:04 ericdallo