Skip to content

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

Closed

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

Activity

  1. github-actions commented on May 5, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is the same underlying bug, consider adding a comment there instead.

  2. zclllyybb commented on May 5, 2026

    @zclllyybb
    Author

    I have fixed this problem in #25855 and the tests runs well locally. @jlongster would you mind telling me how to continue to push this?

  3. simonklee commented on Jun 1, 2026

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions