File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
tools/server/mcp-bridge/lib Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,12 @@ class ProxySSE {
392392
393393 currentTurn ++ ;
394394 } catch ( error ) {
395+ // Check if error is due to client disconnection (stop button)
396+ if ( sessionState . clientDisconnected ) {
397+ this . _log ( 'Client disconnection during LLM call (expected)' ) ;
398+ break ;
399+ }
400+
395401 // Handle LLM backend communication errors
396402 this . _log ( `Error during LLM call: ${ error . message } ` ) ;
397403
@@ -404,7 +410,7 @@ class ProxySSE {
404410 choices : [
405411 {
406412 delta : {
407- content : `\n\nUpstream LLM error:\ n\`\`\`\n${ errorDetails } \n\`\`\`\n`
413+ content : `\n\n\`\`\`\nUpstream LLM error: \n${ errorDetails } \n\`\`\`\n`
408414 } ,
409415 finish_reason : 'stop'
410416 }
@@ -430,7 +436,7 @@ class ProxySSE {
430436 const warningChunk = {
431437 choices : [
432438 {
433- delta : { content : '\n\nTurn limit reached' }
439+ delta : { content : '\n\n```\ nTurn limit reached\n```\n ' }
434440 }
435441 ]
436442 } ;
You can’t perform that action at this time.
0 commit comments