In the case where the model would respond with `new_text` before `old_text`, we would just emit an empty `old_text`, because the parsing layer was operating under the assumption that `old_text` occurs before `new_text`. We now hold back new text chunks if we receive them first, and only emit them once old_text is complete. In addition to that we also need to handle the case where the first chunk contains `old_text` and `new_text`. In that case we don't know which one of the two fields have finished streaming, since we can't rely on the ordering anymore. Therefore we hold back all events until we receive the full edit, and emit a single OldTextChunk (done = true) and a single NewTextChunk (done = true) Closes #55398 Release Notes: - agent: Fixed an issue where editing would sometimes fail for specific models (Deepseek v4)
2 files changedLine totals unavailable