Significant progress. Performing cleanup now

This commit is contained in:
Ryan Ward
2026-05-11 14:31:02 -05:00
parent fe105e0369
commit 140da74f99
37 changed files with 843 additions and 1220 deletions
+20
View File
@@ -228,6 +228,12 @@ pub struct AIConversation {
/// event log. Used on restore to resume event delivery without
/// re-delivering already-processed events.
last_event_sequence: Option<i64>,
/// Accumulated message history for direct Bedrock conversations.
/// Contains the full ordered sequence of user messages, assistant responses,
/// tool calls, and tool results sent to/received from Bedrock across all
/// request cycles. This is the source of truth for what Bedrock sees.
bedrock_message_history: Vec<crate::ai::bedrock::convert::ConversationMessage>,
}
pub(crate) fn artifact_from_fork_proto(
@@ -278,6 +284,7 @@ impl AIConversation {
parent_conversation_id: None,
is_remote_child: false,
last_event_sequence: None,
bedrock_message_history: Vec::new(),
}
}
@@ -459,6 +466,7 @@ impl AIConversation {
parent_conversation_id,
is_remote_child: false,
last_event_sequence,
bedrock_message_history: Vec::new(),
})
}
@@ -466,6 +474,18 @@ impl AIConversation {
self.id
}
pub fn bedrock_message_history(&self) -> &[crate::ai::bedrock::convert::ConversationMessage] {
&self.bedrock_message_history
}
pub fn bedrock_message_history_mut(&mut self) -> &mut Vec<crate::ai::bedrock::convert::ConversationMessage> {
&mut self.bedrock_message_history
}
pub fn append_to_bedrock_history(&mut self, messages: Vec<crate::ai::bedrock::convert::ConversationMessage>) {
self.bedrock_message_history.extend(messages);
}
/// Assigns fresh exchange IDs to all exchanges in this conversation.
/// Used when forking conversations to avoid ID collisions with persisted blocks.
pub fn reassign_exchange_ids(&mut self) {