@@ -44,12 +44,6 @@ export function createAgentsModule({
4444 conversation : AgentConversation ,
4545 message : AgentMessage
4646 ) => {
47- const room = `/agent-conversations/${ conversation . id } ` ;
48- const socket = getSocket ( ) ;
49- await socket . updateModel ( room , {
50- ...conversation ,
51- messages : [ ...( conversation . messages || [ ] ) , message ] ,
52- } ) ;
5347 return axios . post < any , AgentMessage > (
5448 `${ baseURL } /conversations/${ conversation . id } /messages` ,
5549 { ...message , api_version : "v2" }
@@ -75,11 +69,10 @@ export function createAgentsModule({
7569 update_model : async ( { data : jsonStr } ) => {
7670 const data = JSON . parse ( jsonStr ) ;
7771
78- // Check if this is v2 format with _agent_message
79- if ( data . _agent_message ) {
72+ if ( data . _message ) {
8073 // Wait for initial conversation to be loaded
8174 await conversationPromise ;
82- const message = data . _agent_message as AgentMessage ;
75+ const message = data . _message as AgentMessage ;
8376
8477 // Update local conversation state
8578 if ( currentConversation ) {
@@ -97,11 +90,6 @@ export function createAgentsModule({
9790 } ;
9891 onUpdate ?.( currentConversation ) ;
9992 }
100- } else {
101- // Old format: full conversation object
102- const conv = data as AgentConversation ;
103- currentConversation = conv ;
104- onUpdate ?.( conv ) ;
10593 }
10694 } ,
10795 } ) ;
0 commit comments