eca icon indicating copy to clipboard operation
eca copied to clipboard

Preceding Text can get broken by Tool Call

Open zikajk opened this issue 1 year ago • 7 comments

The text immediately preceding a tool call (e.g., the final part of a sentence or word) is getting cut off or badly wrapped when the "Preparing tool: ⏳" block appears. This visual glitch disrupts the flow of the assistant's response, leaving the previous text incomplete (as seen with "expression:" in the image).

Image

Although I can't replicate it manually. I wonder whether this could be caused by a user pressing some key. Maybe we could we disable editing in all areas except the last section of the chat (the new prompt area)?

zikajk avatar Oct 01 '25 20:10 zikajk

Yeah, I can't see LLM outputing tool calls in the middle of a text, anthropic ones do that but after sentences and it's alright.

But agree, we should disable editting in other parts, and we already have this kind of logic for deletions, but not overall editing

ericdallo avatar Oct 01 '25 23:10 ericdallo

LLM doesn't do that, it is probably a client issue. And it is not caused by any user action.

Image

zikajk avatar Oct 02 '25 08:10 zikajk

that's weird, can you check logs via --verbose so we can make sure it's ECA server sending things in wrong order?

ericdallo avatar Oct 02 '25 13:10 ericdallo

@zikajk I managed to repro that for openai-chat, is that what you are using? I believe it might be related with the thinking block addition I did recently

ericdallo avatar Oct 02 '25 16:10 ericdallo

I was using copilot sonnet 4.5 (no thinking there).

zikajk avatar Oct 02 '25 16:10 zikajk

When it breaks then it breaks the last word (whole or part of it) so I thought it might be some race condition.

zikajk avatar Oct 02 '25 16:10 zikajk

@zikajk just fixed that on 0.63.3, can you check please? It was related with the last few chars of streaming, which I touched for parsing <think> blocks, LMK otherwise

ericdallo avatar Oct 02 '25 18:10 ericdallo