Add files via upload

This commit is contained in:
公明
2026-07-22 11:30:11 +08:00
committed by GitHub
parent 7caf77683f
commit 631ee6c447
4 changed files with 73 additions and 21 deletions
+1 -1
View File
@@ -745,7 +745,7 @@ func (m *ExternalMCPManager) CallTool(ctx context.Context, toolName string, args
return result, callErr
},
OnDone: func(exec *ToolExecution) {
failed := exec != nil && exec.Status != ToolExecutionStatusCompleted
failed := exec != nil && exec.Status != ToolExecutionStatusCompleted && exec.Status != ToolExecutionStatusCancelled
m.recordExternalMCPResult(mcpName, failed)
m.updateStats(toolName, failed)
},
+3 -3
View File
@@ -602,13 +602,13 @@ func (s *Server) handleCallTool(requestCtx context.Context, msg *Message) *Messa
st, msg := executionStatusAndMessage(err)
execution.Status = st
execution.Error = msg
failed = true
failed = st != "cancelled"
} else if result != nil && result.IsError {
if cancelledWithUserNote {
execution.Status = "cancelled"
execution.Error = ""
execution.Result = result
failed = true
failed = false
} else {
execution.Status = "failed"
if len(result.Content) > 0 {
@@ -930,7 +930,7 @@ func (s *Server) CallTool(ctx context.Context, toolName string, args map[string]
return handler(runCtx, args)
},
OnDone: func(exec *ToolExecution) {
failed := exec != nil && exec.Status != ToolExecutionStatusCompleted
failed := exec != nil && exec.Status != ToolExecutionStatusCompleted && exec.Status != ToolExecutionStatusCancelled
s.updateStats(toolName, failed)
},
})