Skip to content

[Bug] The "paste summary" causes the content to be disordered after pasting. #25854

@zclllyybb

Description

@zclllyybb

Description

When UTF8 characters are included in the input content, if the paste action triggers a paste summary, the actual text passed to the model will be completely scrambled, and the pasted text will be inserted in the wrong position.

Plugins

none

OpenCode version

dev and any release version

Steps to reproduce

  1. Enter some UTF8 text
  2. Paste a long text to trigger paste summary, confirm that you see "[Pasted ~x lines]" displayed.
  3. Send it. then you can see the disordered text

Screenshot and/or share link

Image

what I actually entered is:

我能吞下玻璃而不伤身体我能吞下玻璃而不伤身体我能吞下玻璃而不伤身体[Pasted ~1 lines]我能吞下玻璃而不伤身体。

which the pasted line is:

A sufficiently long test content1 A sufficiently long test content2 A sufficiently long test content3 A sufficiently long test content1 A sufficiently long test content2 A sufficiently long test content4 A sufficiently long test content1 A sufficiently long test content2 A sufficiently long test content5 

Operating System

OS-independent

Terminal

terminal-independent

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions