mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: resolve failing tests and add missing translations
- Update useMcpToolTool.spec.ts mock to handle new toolName parameter in formatResponse.toolError - Add translations for new error title keys in all supported languages (ca, de, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW)
This commit is contained in:
parent
9d3c0268ae
commit
446bafb812
18 changed files with 222 additions and 3 deletions
|
|
@ -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<error>\n${error}\n</error>`
|
||||
}
|
||||
return `Tool Execution Error\n<error>\n${error}\n</error>`
|
||||
}),
|
||||
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<error>\nInvalid args for test_server:test_tool\n</error>",
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
12
src/i18n/locales/ca/tools.json
generated
12
src/i18n/locales/ca/tools.json
generated
|
|
@ -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ó"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/de/tools.json
generated
12
src/i18n/locales/de/tools.json
generated
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/es/tools.json
generated
12
src/i18n/locales/es/tools.json
generated
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/fr/tools.json
generated
12
src/i18n/locales/fr/tools.json
generated
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/hi/tools.json
generated
12
src/i18n/locales/hi/tools.json
generated
|
|
@ -14,5 +14,17 @@
|
|||
"errors": {
|
||||
"policy_restriction": "नीति प्रतिबंधों के कारण नया कार्य बनाने में विफल।"
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"fileNotFound": "फ़ाइल नहीं मिली",
|
||||
"parseError": "पार्स त्रुटि",
|
||||
"commandTimeout": "कमांड टाइमआउट",
|
||||
"permissionDenied": "अनुमति अस्वीकृत",
|
||||
"networkError": "नेटवर्क त्रुटि",
|
||||
"invalidInput": "अमान्य इनपुट",
|
||||
"operationFailed": "ऑपरेशन विफल",
|
||||
"resourceNotFound": "संसाधन नहीं मिला",
|
||||
"configurationError": "कॉन्फ़िगरेशन त्रुटि",
|
||||
"authenticationFailed": "प्रमाणीकरण विफल"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/id/tools.json
generated
12
src/i18n/locales/id/tools.json
generated
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/it/tools.json
generated
12
src/i18n/locales/it/tools.json
generated
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/ja/tools.json
generated
12
src/i18n/locales/ja/tools.json
generated
|
|
@ -14,5 +14,17 @@
|
|||
"errors": {
|
||||
"policy_restriction": "ポリシー制限により新しいタスクを作成できませんでした。"
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"fileNotFound": "ファイルが見つかりません",
|
||||
"parseError": "解析エラー",
|
||||
"commandTimeout": "コマンドタイムアウト",
|
||||
"permissionDenied": "権限がありません",
|
||||
"networkError": "ネットワークエラー",
|
||||
"invalidInput": "無効な入力",
|
||||
"operationFailed": "操作に失敗しました",
|
||||
"resourceNotFound": "リソースが見つかりません",
|
||||
"configurationError": "設定エラー",
|
||||
"authenticationFailed": "認証に失敗しました"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/ko/tools.json
generated
12
src/i18n/locales/ko/tools.json
generated
|
|
@ -14,5 +14,17 @@
|
|||
"errors": {
|
||||
"policy_restriction": "정책 제한으로 인해 새 작업을 생성하지 못했습니다."
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"fileNotFound": "파일을 찾을 수 없음",
|
||||
"parseError": "파싱 오류",
|
||||
"commandTimeout": "명령 시간 초과",
|
||||
"permissionDenied": "권한 거부됨",
|
||||
"networkError": "네트워크 오류",
|
||||
"invalidInput": "잘못된 입력",
|
||||
"operationFailed": "작업 실패",
|
||||
"resourceNotFound": "리소스를 찾을 수 없음",
|
||||
"configurationError": "구성 오류",
|
||||
"authenticationFailed": "인증 실패"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/nl/tools.json
generated
12
src/i18n/locales/nl/tools.json
generated
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/pl/tools.json
generated
12
src/i18n/locales/pl/tools.json
generated
|
|
@ -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ę"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/pt-BR/tools.json
generated
12
src/i18n/locales/pt-BR/tools.json
generated
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/ru/tools.json
generated
12
src/i18n/locales/ru/tools.json
generated
|
|
@ -14,5 +14,17 @@
|
|||
"errors": {
|
||||
"policy_restriction": "Не удалось создать новую задачу из-за ограничений политики."
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"fileNotFound": "Файл не найден",
|
||||
"parseError": "Ошибка синтаксического анализа",
|
||||
"commandTimeout": "Тайм-аут команды",
|
||||
"permissionDenied": "В доступе отказано",
|
||||
"networkError": "Сетевая ошибка",
|
||||
"invalidInput": "Неверный ввод",
|
||||
"operationFailed": "Операция не удалась",
|
||||
"resourceNotFound": "Ресурс не найден",
|
||||
"configurationError": "Ошибка конфигурации",
|
||||
"authenticationFailed": "Сбой аутентификации"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/tr/tools.json
generated
12
src/i18n/locales/tr/tools.json
generated
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/vi/tools.json
generated
12
src/i18n/locales/vi/tools.json
generated
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/zh-CN/tools.json
generated
12
src/i18n/locales/zh-CN/tools.json
generated
|
|
@ -14,5 +14,17 @@
|
|||
"errors": {
|
||||
"policy_restriction": "由于策略限制,无法创建新任务。"
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"fileNotFound": "文件未找到",
|
||||
"parseError": "解析错误",
|
||||
"commandTimeout": "命令超时",
|
||||
"permissionDenied": "权限被拒绝",
|
||||
"networkError": "网络错误",
|
||||
"invalidInput": "无效输入",
|
||||
"operationFailed": "操作失败",
|
||||
"resourceNotFound": "资源未找到",
|
||||
"configurationError": "配置错误",
|
||||
"authenticationFailed": "认证失败"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/i18n/locales/zh-TW/tools.json
generated
12
src/i18n/locales/zh-TW/tools.json
generated
|
|
@ -14,5 +14,17 @@
|
|||
"errors": {
|
||||
"policy_restriction": "由於政策限制,無法建立新工作。"
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"fileNotFound": "找不到檔案",
|
||||
"parseError": "解析錯誤",
|
||||
"commandTimeout": "指令逾時",
|
||||
"permissionDenied": "權限遭拒",
|
||||
"networkError": "網路錯誤",
|
||||
"invalidInput": "無效輸入",
|
||||
"operationFailed": "操作失敗",
|
||||
"resourceNotFound": "找不到資源",
|
||||
"configurationError": "設定錯誤",
|
||||
"authenticationFailed": "驗證失敗"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue