File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,15 +161,15 @@ export function installCuaBehaviors(
161161 hasPendingQueue = false ;
162162 return undefined ;
163163 } ) ) ;
164- offs . push ( harness . subscribe ( ( event : any , signal ?: AbortSignal ) => {
164+ offs . push ( harness . subscribe ( async ( event : any , signal ?: AbortSignal ) => {
165165 if ( event . type === "message_end" && event . message . role === "assistant" ) turnFailed = false ;
166166 else if ( event . type === "tool_execution_end" && event . isError ) turnFailed = true ;
167167 else if ( event . type === "queue_update" ) hasPendingQueue = event . steer . length > 0 || event . followUp . length > 0 ;
168168 if ( ! recovery || recovery . maxAttempts <= 0 ) return ;
169169 if ( event . type !== "turn_end" || ! isEmptyAssistantResponse ( event . message ) ) return ;
170170 if ( signal ?. aborted || recoveryAttempts >= recovery . maxAttempts || hasPendingQueue ) return ;
171+ await harness . followUp ( recovery . followUp ) ;
171172 recoveryAttempts += 1 ;
172- return harness . followUp ( recovery . followUp ) ;
173173 } ) ) ;
174174
175175 return ( ) => {
You can’t perform that action at this time.
0 commit comments