Fix panic when re-editing old message with creases (#32017)

Co-authored-by: Cole Miller <m@cole-miller.net>

Release Notes:

- agent: Fixed a panic when re-editing old messages

---------

Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
Conrad Irwin 2025-06-03 14:56:18 -06:00 committed by GitHub
parent 4aabba6cf6
commit 03357f3f7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 93 additions and 4 deletions

View file

@ -1032,6 +1032,7 @@ impl Thread {
id: MessageId,
new_role: Role,
new_segments: Vec<MessageSegment>,
creases: Vec<MessageCrease>,
loaded_context: Option<LoadedContext>,
checkpoint: Option<GitStoreCheckpoint>,
cx: &mut Context<Self>,
@ -1041,6 +1042,7 @@ impl Thread {
};
message.role = new_role;
message.segments = new_segments;
message.creases = creases;
if let Some(context) = loaded_context {
message.loaded_context = context;
}