Skip to content

agent_ui: Fix panic when inserting context prefix with multi-byte characters#48179

Merged
smitbarmase merged 1 commit intomainfrom
fix-multibyte-char-panic-message-editor
Feb 2, 2026
Merged

agent_ui: Fix panic when inserting context prefix with multi-byte characters#48179
smitbarmase merged 1 commit intomainfrom
fix-multibyte-char-panic-message-editor

Conversation

@smitbarmase
Copy link
Member

@smitbarmase smitbarmase commented Feb 2, 2026

Closes ZED-4R9

Introduced in #47768

The insert_context_prefix function was using byte offsets to check if the prefix already exists at the cursor. This caused a panic with multi-byte characters like emojis. Now uses character counts instead.

Release Notes:

  • Fixed a crash in the Agent Panel when inserting context mentions with emojis in the message editor.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 2, 2026
@smitbarmase smitbarmase merged commit 9ee0f08 into main Feb 2, 2026
31 checks passed
@smitbarmase smitbarmase deleted the fix-multibyte-char-panic-message-editor branch February 2, 2026 10:51
@smitbarmase
Copy link
Member Author

/cherry-pick preview

github-actions bot pushed a commit that referenced this pull request Feb 2, 2026
…racters (#48179)

Closes ZED-4R9

Introduced in #47768

The `insert_context_prefix` function was using byte offsets to check if
the prefix already exists at the cursor. This caused a panic with
multi-byte characters like emojis. Now uses character counts instead.

Release Notes:

- Fixed a crash in the Agent Panel when inserting context mentions with
emojis in the message editor.
zed-zippy bot added a commit that referenced this pull request Feb 2, 2026
…racters (#48179) (cherry-pick to preview) (#48180)

Cherry-pick of #48179 to preview

----
Closes ZED-4R9

Introduced in #47768

The `insert_context_prefix` function was using byte offsets to check if
the prefix already exists at the cursor. This caused a panic with
multi-byte characters like emojis. Now uses character counts instead.

Release Notes:

- Fixed a crash in the Agent Panel when inserting context mentions with
emojis in the message editor.

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
adb-sh pushed a commit to adb-sh/zed that referenced this pull request Feb 5, 2026
…racters (zed-industries#48179)

Closes ZED-4R9

Introduced in zed-industries#47768

The `insert_context_prefix` function was using byte offsets to check if
the prefix already exists at the cursor. This caused a panic with
multi-byte characters like emojis. Now uses character counts instead.

Release Notes:

- Fixed a crash in the Agent Panel when inserting context mentions with
emojis in the message editor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant