diff --git a/src/core/tools/__tests__/useMcpToolTool.spec.ts b/src/core/tools/__tests__/useMcpToolTool.spec.ts index 8738e059e5..937998a7d1 100644 --- a/src/core/tools/__tests__/useMcpToolTool.spec.ts +++ b/src/core/tools/__tests__/useMcpToolTool.spec.ts @@ -8,7 +8,12 @@ import { ToolUse } from "../../../shared/tools" vi.mock("../../prompts/responses", () => ({ formatResponse: { toolResult: vi.fn((result: string) => `Tool result: ${result}`), - toolError: vi.fn((error: string) => `Tool error: ${error}`), + toolError: vi.fn((error: string, toolName?: string) => { + if (toolName) { + return `Tool Call Error: ${toolName}\n\n${error}\n` + } + return `Tool Execution Error\n\n${error}\n` + }), invalidMcpToolArgumentError: vi.fn((server: string, tool: string) => `Invalid args for ${server}:${tool}`), unknownMcpToolError: vi.fn((server: string, tool: string, availableTools: string[]) => { const toolsList = availableTools.length > 0 ? availableTools.join(", ") : "No tools available" @@ -151,8 +156,18 @@ describe("useMcpToolTool", () => { expect(mockTask.consecutiveMistakeCount).toBe(1) expect(mockTask.recordToolError).toHaveBeenCalledWith("use_mcp_tool") - expect(mockTask.say).toHaveBeenCalledWith("error", expect.stringContaining("invalid JSON argument")) - expect(mockPushToolResult).toHaveBeenCalledWith("Tool error: Invalid args for test_server:test_tool") + expect(mockTask.say).toHaveBeenCalledWith( + "error", + expect.stringContaining("invalid JSON argument"), + undefined, + undefined, + undefined, + undefined, + { title: "tools:errors.invalidInput" }, + ) + expect(mockPushToolResult).toHaveBeenCalledWith( + "Tool Call Error: use_mcp_tool\n\nInvalid args for test_server:test_tool\n", + ) }) }) diff --git a/src/i18n/locales/ca/tools.json b/src/i18n/locales/ca/tools.json index 0f10b6fc2a..d6b11e3294 100644 --- a/src/i18n/locales/ca/tools.json +++ b/src/i18n/locales/ca/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "No s'ha pogut crear una nova tasca a causa de restriccions de política." } + }, + "errors": { + "fileNotFound": "Fitxer no trobat", + "parseError": "Error d'anàlisi", + "commandTimeout": "Temps d'espera de l'ordre exhaurit", + "permissionDenied": "Permís denegat", + "networkError": "Error de xarxa", + "invalidInput": "Entrada no vàlida", + "operationFailed": "L'operació ha fallat", + "resourceNotFound": "Recurs no trobat", + "configurationError": "Error de configuració", + "authenticationFailed": "Error d'autenticació" } } diff --git a/src/i18n/locales/de/tools.json b/src/i18n/locales/de/tools.json index ecf372a50b..f11f3c53c4 100644 --- a/src/i18n/locales/de/tools.json +++ b/src/i18n/locales/de/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "Neue Aufgabe konnte aufgrund von Richtlinienbeschränkungen nicht erstellt werden." } + }, + "errors": { + "fileNotFound": "Datei nicht gefunden", + "parseError": "Parse-Fehler", + "commandTimeout": "Befehl Zeitüberschreitung", + "permissionDenied": "Zugriff verweigert", + "networkError": "Netzwerkfehler", + "invalidInput": "Ungültige Eingabe", + "operationFailed": "Vorgang fehlgeschlagen", + "resourceNotFound": "Ressource nicht gefunden", + "configurationError": "Konfigurationsfehler", + "authenticationFailed": "Authentifizierung fehlgeschlagen" } } diff --git a/src/i18n/locales/es/tools.json b/src/i18n/locales/es/tools.json index 6fd1cc2122..145b57dd1a 100644 --- a/src/i18n/locales/es/tools.json +++ b/src/i18n/locales/es/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "No se pudo crear una nueva tarea debido a restricciones de política." } + }, + "errors": { + "fileNotFound": "Archivo no encontrado", + "parseError": "Error de análisis", + "commandTimeout": "Tiempo de espera del comando agotado", + "permissionDenied": "Permiso denegado", + "networkError": "Error de red", + "invalidInput": "Entrada no válida", + "operationFailed": "La operación falló", + "resourceNotFound": "Recurso no encontrado", + "configurationError": "Error de configuración", + "authenticationFailed": "Fallo de autenticación" } } diff --git a/src/i18n/locales/fr/tools.json b/src/i18n/locales/fr/tools.json index b6d7accebb..e38381eb57 100644 --- a/src/i18n/locales/fr/tools.json +++ b/src/i18n/locales/fr/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "Impossible de créer une nouvelle tâche en raison de restrictions de politique." } + }, + "errors": { + "fileNotFound": "Fichier non trouvé", + "parseError": "Erreur d'analyse", + "commandTimeout": "Délai d'attente de la commande dépassé", + "permissionDenied": "Autorisation refusée", + "networkError": "Erreur réseau", + "invalidInput": "Entrée invalide", + "operationFailed": "L'opération a échoué", + "resourceNotFound": "Ressource non trouvée", + "configurationError": "Erreur de configuration", + "authenticationFailed": "Échec de l'authentification" } } diff --git a/src/i18n/locales/hi/tools.json b/src/i18n/locales/hi/tools.json index cbfbd7aef7..e54244a726 100644 --- a/src/i18n/locales/hi/tools.json +++ b/src/i18n/locales/hi/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "नीति प्रतिबंधों के कारण नया कार्य बनाने में विफल।" } + }, + "errors": { + "fileNotFound": "फ़ाइल नहीं मिली", + "parseError": "पार्स त्रुटि", + "commandTimeout": "कमांड टाइमआउट", + "permissionDenied": "अनुमति अस्वीकृत", + "networkError": "नेटवर्क त्रुटि", + "invalidInput": "अमान्य इनपुट", + "operationFailed": "ऑपरेशन विफल", + "resourceNotFound": "संसाधन नहीं मिला", + "configurationError": "कॉन्फ़िगरेशन त्रुटि", + "authenticationFailed": "प्रमाणीकरण विफल" } } diff --git a/src/i18n/locales/id/tools.json b/src/i18n/locales/id/tools.json index 3eb8854eff..ca979f70e1 100644 --- a/src/i18n/locales/id/tools.json +++ b/src/i18n/locales/id/tools.json @@ -17,5 +17,17 @@ "errors": { "policy_restriction": "Gagal membuat tugas baru karena pembatasan kebijakan." } + }, + "errors": { + "fileNotFound": "File Tidak Ditemukan", + "parseError": "Kesalahan Parse", + "commandTimeout": "Waktu Tunggu Perintah Habis", + "permissionDenied": "Izin Ditolak", + "networkError": "Kesalahan Jaringan", + "invalidInput": "Input Tidak Valid", + "operationFailed": "Operasi Gagal", + "resourceNotFound": "Sumber Daya Tidak Ditemukan", + "configurationError": "Kesalahan Konfigurasi", + "authenticationFailed": "Autentikasi Gagal" } } diff --git a/src/i18n/locales/it/tools.json b/src/i18n/locales/it/tools.json index 35b114a719..5a55c0eb4f 100644 --- a/src/i18n/locales/it/tools.json +++ b/src/i18n/locales/it/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "Impossibile creare una nuova attività a causa di restrizioni di policy." } + }, + "errors": { + "fileNotFound": "File non trovato", + "parseError": "Errore di parsing", + "commandTimeout": "Timeout del comando", + "permissionDenied": "Permesso negato", + "networkError": "Errore di rete", + "invalidInput": "Input non valido", + "operationFailed": "Operazione non riuscita", + "resourceNotFound": "Risorsa non trovata", + "configurationError": "Errore di configurazione", + "authenticationFailed": "Autenticazione non riuscita" } } diff --git a/src/i18n/locales/ja/tools.json b/src/i18n/locales/ja/tools.json index 257d5aa201..185908a1b1 100644 --- a/src/i18n/locales/ja/tools.json +++ b/src/i18n/locales/ja/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "ポリシー制限により新しいタスクを作成できませんでした。" } + }, + "errors": { + "fileNotFound": "ファイルが見つかりません", + "parseError": "解析エラー", + "commandTimeout": "コマンドタイムアウト", + "permissionDenied": "権限がありません", + "networkError": "ネットワークエラー", + "invalidInput": "無効な入力", + "operationFailed": "操作に失敗しました", + "resourceNotFound": "リソースが見つかりません", + "configurationError": "設定エラー", + "authenticationFailed": "認証に失敗しました" } } diff --git a/src/i18n/locales/ko/tools.json b/src/i18n/locales/ko/tools.json index 94b6d8c377..4ce9840afd 100644 --- a/src/i18n/locales/ko/tools.json +++ b/src/i18n/locales/ko/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "정책 제한으로 인해 새 작업을 생성하지 못했습니다." } + }, + "errors": { + "fileNotFound": "파일을 찾을 수 없음", + "parseError": "파싱 오류", + "commandTimeout": "명령 시간 초과", + "permissionDenied": "권한 거부됨", + "networkError": "네트워크 오류", + "invalidInput": "잘못된 입력", + "operationFailed": "작업 실패", + "resourceNotFound": "리소스를 찾을 수 없음", + "configurationError": "구성 오류", + "authenticationFailed": "인증 실패" } } diff --git a/src/i18n/locales/nl/tools.json b/src/i18n/locales/nl/tools.json index 449cd54583..49852c5b9c 100644 --- a/src/i18n/locales/nl/tools.json +++ b/src/i18n/locales/nl/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "Kan geen nieuwe taak aanmaken vanwege beleidsbeperkingen." } + }, + "errors": { + "fileNotFound": "Bestand niet gevonden", + "parseError": "Parseerfout", + "commandTimeout": "Commando time-out", + "permissionDenied": "Toestemming geweigerd", + "networkError": "Netwerkfout", + "invalidInput": "Ongeldige invoer", + "operationFailed": "Bewerking mislukt", + "resourceNotFound": "Bron niet gevonden", + "configurationError": "Configuratiefout", + "authenticationFailed": "Authenticatie mislukt" } } diff --git a/src/i18n/locales/pl/tools.json b/src/i18n/locales/pl/tools.json index 979b2f54ae..196298df9a 100644 --- a/src/i18n/locales/pl/tools.json +++ b/src/i18n/locales/pl/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "Nie udało się utworzyć nowego zadania z powodu ograniczeń polityki." } + }, + "errors": { + "fileNotFound": "Nie znaleziono pliku", + "parseError": "Błąd parsowania", + "commandTimeout": "Przekroczono limit czasu polecenia", + "permissionDenied": "Odmowa dostępu", + "networkError": "Błąd sieci", + "invalidInput": "Nieprawidłowe dane wejściowe", + "operationFailed": "Operacja nie powiodła się", + "resourceNotFound": "Nie znaleziono zasobu", + "configurationError": "Błąd konfiguracji", + "authenticationFailed": "Uwierzytelnianie nie powiodło się" } } diff --git a/src/i18n/locales/pt-BR/tools.json b/src/i18n/locales/pt-BR/tools.json index 4e3296fd4a..a730bdb2b8 100644 --- a/src/i18n/locales/pt-BR/tools.json +++ b/src/i18n/locales/pt-BR/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "Falha ao criar nova tarefa devido a restrições de política." } + }, + "errors": { + "fileNotFound": "Arquivo não encontrado", + "parseError": "Erro de análise", + "commandTimeout": "Tempo limite do comando", + "permissionDenied": "Permissão negada", + "networkError": "Erro de rede", + "invalidInput": "Entrada inválida", + "operationFailed": "A operação falhou", + "resourceNotFound": "Recurso não encontrado", + "configurationError": "Erro de configuração", + "authenticationFailed": "Falha na autenticação" } } diff --git a/src/i18n/locales/ru/tools.json b/src/i18n/locales/ru/tools.json index d74918f058..dc9422bf20 100644 --- a/src/i18n/locales/ru/tools.json +++ b/src/i18n/locales/ru/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "Не удалось создать новую задачу из-за ограничений политики." } + }, + "errors": { + "fileNotFound": "Файл не найден", + "parseError": "Ошибка синтаксического анализа", + "commandTimeout": "Тайм-аут команды", + "permissionDenied": "В доступе отказано", + "networkError": "Сетевая ошибка", + "invalidInput": "Неверный ввод", + "operationFailed": "Операция не удалась", + "resourceNotFound": "Ресурс не найден", + "configurationError": "Ошибка конфигурации", + "authenticationFailed": "Сбой аутентификации" } } diff --git a/src/i18n/locales/tr/tools.json b/src/i18n/locales/tr/tools.json index 5341a23cb1..1f69f35367 100644 --- a/src/i18n/locales/tr/tools.json +++ b/src/i18n/locales/tr/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "Politika kısıtlamaları nedeniyle yeni görev oluşturulamadı." } + }, + "errors": { + "fileNotFound": "Dosya Bulunamadı", + "parseError": "Ayrıştırma Hatası", + "commandTimeout": "Komut Zaman Aşımı", + "permissionDenied": "İzin Reddedildi", + "networkError": "Ağ Hatası", + "invalidInput": "Geçersiz Giriş", + "operationFailed": "İşlem Başarısız Oldu", + "resourceNotFound": "Kaynak Bulunamadı", + "configurationError": "Yapılandırma Hatası", + "authenticationFailed": "Kimlik Doğrulama Başarısız" } } diff --git a/src/i18n/locales/vi/tools.json b/src/i18n/locales/vi/tools.json index 4c5080a146..66afe1d46a 100644 --- a/src/i18n/locales/vi/tools.json +++ b/src/i18n/locales/vi/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "Không thể tạo nhiệm vụ mới do hạn chế chính sách." } + }, + "errors": { + "fileNotFound": "Không tìm thấy tệp", + "parseError": "Lỗi phân tích cú pháp", + "commandTimeout": "Hết thời gian chờ lệnh", + "permissionDenied": "Quyền bị từ chối", + "networkError": "Lỗi mạng", + "invalidInput": "Đầu vào không hợp lệ", + "operationFailed": "Thao tác thất bại", + "resourceNotFound": "Không tìm thấy tài nguyên", + "configurationError": "Lỗi cấu hình", + "authenticationFailed": "Xác thực không thành công" } } diff --git a/src/i18n/locales/zh-CN/tools.json b/src/i18n/locales/zh-CN/tools.json index c0c93d8436..0d108d2191 100644 --- a/src/i18n/locales/zh-CN/tools.json +++ b/src/i18n/locales/zh-CN/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "由于策略限制,无法创建新任务。" } + }, + "errors": { + "fileNotFound": "文件未找到", + "parseError": "解析错误", + "commandTimeout": "命令超时", + "permissionDenied": "权限被拒绝", + "networkError": "网络错误", + "invalidInput": "无效输入", + "operationFailed": "操作失败", + "resourceNotFound": "资源未找到", + "configurationError": "配置错误", + "authenticationFailed": "认证失败" } } diff --git a/src/i18n/locales/zh-TW/tools.json b/src/i18n/locales/zh-TW/tools.json index b736448c20..5cf213c4bf 100644 --- a/src/i18n/locales/zh-TW/tools.json +++ b/src/i18n/locales/zh-TW/tools.json @@ -14,5 +14,17 @@ "errors": { "policy_restriction": "由於政策限制,無法建立新工作。" } + }, + "errors": { + "fileNotFound": "找不到檔案", + "parseError": "解析錯誤", + "commandTimeout": "指令逾時", + "permissionDenied": "權限遭拒", + "networkError": "網路錯誤", + "invalidInput": "無效輸入", + "operationFailed": "操作失敗", + "resourceNotFound": "找不到資源", + "configurationError": "設定錯誤", + "authenticationFailed": "驗證失敗" } }