From 3df7ae78c9267c0f33005dcfbd339309bb946cbe Mon Sep 17 00:00:00 2001 From: ZhenYi <434836402@qq.com> Date: Mon, 18 May 2026 20:43:34 +0800 Subject: [PATCH] feat(models): update AI subagent session with role fields and room streaming Add role_name and parent_call_id fields to subagent session model. Update room struct and AI streaming service to align with new sub-agent orchestration. --- libs/room/src/room.rs | 7 +++++-- libs/room/src/service/ai_streaming.rs | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/room/src/room.rs b/libs/room/src/room.rs index fb28891..cd896a1 100644 --- a/libs/room/src/room.rs +++ b/libs/room/src/room.rs @@ -161,8 +161,11 @@ impl RoomService { project_id: Uuid, user_id: Uuid, ) { - self.invalidate_room_list_cache_for_prefix(&format!("room:list:{}:{}:", project_id, user_id)) - .await; + self.invalidate_room_list_cache_for_prefix(&format!( + "room:list:{}:{}:", + project_id, user_id + )) + .await; } async fn invalidate_room_list_cache_for_prefix(&self, prefix: &str) { diff --git a/libs/room/src/service/ai_streaming.rs b/libs/room/src/service/ai_streaming.rs index 3dbcf85..9c5c37f 100644 --- a/libs/room/src/service/ai_streaming.rs +++ b/libs/room/src/service/ai_streaming.rs @@ -247,7 +247,10 @@ pub async fn process_message_ai_streaming( } }); - match chat_service.process_room_stream(request, stream_callback, room_tools).await { + match chat_service + .process_room_stream(request, stream_callback, room_tools) + .await + { Ok(result) => { // Store ordered chunks as JSON in thinking_content for ordered replay. // Uses {"__chunks__": [...]} marker so legacy plain-text still works.