text_thread: Improve roles after assistant::Split
(shift-enter) (#33215)
Default to `You` when triggering `assistant::Split` at the end of a thread Release Notes: - agent_thread: Improved roles when triggering `assistant::Split` (`shift-enter`)
This commit is contained in:
parent
cc62125244
commit
2a5a1814cd
1 changed files with 7 additions and 1 deletions
|
@ -2523,6 +2523,12 @@ impl AssistantContext {
|
|||
}
|
||||
|
||||
let message = start_message;
|
||||
let at_end = range.end >= message.offset_range.end.saturating_sub(1);
|
||||
let role_after = if range.start == range.end || at_end {
|
||||
Role::User
|
||||
} else {
|
||||
message.role
|
||||
};
|
||||
let role = message.role;
|
||||
let mut edited_buffer = false;
|
||||
|
||||
|
@ -2557,7 +2563,7 @@ impl AssistantContext {
|
|||
};
|
||||
|
||||
let suffix_metadata = MessageMetadata {
|
||||
role,
|
||||
role: role_after,
|
||||
status: MessageStatus::Done,
|
||||
timestamp: suffix.id.0,
|
||||
cache: None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue