Skip to content

Commit 7d50e9d

Browse files
committed
staged changes after revert to 4517eb7
1 parent 4cbb0b6 commit 7d50e9d

File tree

41 files changed

+566
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+566
-130
lines changed

src/core/assistant-message/presentAssistantMessage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { Task } from "../task/Task"
3737
import { codebaseSearchTool } from "../tools/codebaseSearchTool"
3838
import { experiments, EXPERIMENT_IDS } from "../../shared/experiments"
3939
import { applyDiffToolLegacy } from "../tools/applyDiffTool"
40+
import { t } from "../../i18n"
4041

4142
/**
4243
* Processes and presents assistant message content to the user interface.
@@ -327,7 +328,7 @@ export async function presentAssistantMessage(cline: Task) {
327328
undefined, // partial
328329
undefined, // checkpoint
329330
undefined, // progressStatus
330-
{ title: `Tool Call Error: ${block.name}` }, // Custom title with tool name
331+
{ title: t("tools:errors.toolCallError", { toolName: block.name }) }, // Custom title with tool name
331332
)
332333

333334
pushToolResult(formatResponse.toolError(errorString, block.name))

src/core/prompts/responses.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as path from "path"
33
import * as diff from "diff"
44
import { RooIgnoreController, LOCK_TEXT_SYMBOL } from "../ignore/RooIgnoreController"
55
import { RooProtectedController } from "../protect/RooProtectedController"
6+
import { t } from "../../i18n"
67

78
export const formatResponse = {
89
toolDenied: () => `The user denied this operation.`,
@@ -14,7 +15,9 @@ export const formatResponse = {
1415
`The user approved this operation and provided the following context:\n<feedback>\n${feedback}\n</feedback>`,
1516

1617
toolError: (error?: string, toolName?: string) => {
17-
const title = toolName ? `Tool Call Error: ${toolName}` : "Tool Execution Error"
18+
const title = toolName
19+
? t("tools:errors.toolCallError", { toolName, defaultValue: `Tool Call Error: ${toolName}` })
20+
: t("tools:errors.toolExecutionError", { defaultValue: "Tool Execution Error" })
1821
return `${title}\n<error>\n${error}\n</error>`
1922
},
2023

src/core/task/Task.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,16 +1141,22 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
11411141
}
11421142

11431143
async sayAndCreateMissingParamError(toolName: ToolName, paramName: string, relPath?: string) {
1144+
const message = relPath
1145+
? t("tools:errors.missingParamForToolWithPath", {
1146+
toolName,
1147+
relPath: relPath.toPosix(),
1148+
paramName,
1149+
})
1150+
: t("tools:errors.missingParamForTool", { toolName, paramName })
1151+
11441152
await this.say(
11451153
"error",
1146-
`Roo tried to use ${toolName}${
1147-
relPath ? ` for '${relPath.toPosix()}'` : ""
1148-
} without value for required parameter '${paramName}'. Retrying...`,
1154+
message,
11491155
undefined, // images
11501156
undefined, // partial
11511157
undefined, // checkpoint
11521158
undefined, // progressStatus
1153-
{ title: `Tool Call Error: ${toolName}` }, // Custom title for the error
1159+
{ title: t("tools:errors.toolCallError", { toolName }) }, // Custom title for the error
11541160
)
11551161
return formatResponse.toolError(formatResponse.missingToolParameterError(paramName), toolName)
11561162
}

src/core/tools/askFollowupQuestionTool.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Task } from "../task/Task"
22
import { ToolUse, AskApproval, HandleError, PushToolResult, RemoveClosingTag } from "../../shared/tools"
33
import { formatResponse } from "../prompts/responses"
44
import { parseXml } from "../../utils/xml"
5+
import { t } from "../../i18n"
56

67
export async function askFollowupQuestionTool(
78
cline: Task,
@@ -55,7 +56,7 @@ export async function askFollowupQuestionTool(
5556
undefined,
5657
undefined,
5758
undefined,
58-
{ title: "Parse Error" },
59+
{ title: t("tools:errors.parseError") },
5960
)
6061
pushToolResult(formatResponse.toolError("Invalid operations xml format", "ask_followup_question"))
6162
return

src/core/tools/attemptCompletionTool.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Anthropic from "@anthropic-ai/sdk"
22
import * as vscode from "vscode"
3+
import { t } from "../../i18n"
34

45
import { RooCodeEventName } from "@roo-code/types"
56
import { TelemetryService } from "@roo-code/telemetry"
@@ -44,10 +45,7 @@ export async function attemptCompletionTool(
4445
cline.recordToolError("attempt_completion")
4546

4647
pushToolResult(
47-
formatResponse.toolError(
48-
"Cannot complete task while there are incomplete todos. Please finish all todos before attempting completion.",
49-
"attempt_completion",
50-
),
48+
formatResponse.toolError(t("tools:attemptCompletion.errors.incompleteTodos"), "attempt_completion"),
5149
)
5250

5351
return
@@ -126,7 +124,7 @@ export async function attemptCompletionTool(
126124

127125
toolResults.push({
128126
type: "text",
129-
text: `The user has provided feedback on the results. Consider their input to continue the task, and then attempt completion again.\n<feedback>\n${text}\n</feedback>`,
127+
text: `${t("tools:attemptCompletion.userFeedbackLead")}\n<feedback>\n${text}\n</feedback>`,
130128
})
131129

132130
toolResults.push(...formatResponse.imageBlocks(images))

src/i18n/locales/ca/tools.json

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/de/tools.json

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/es/tools.json

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/fr/tools.json

Lines changed: 33 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/i18n/locales/hi/tools.json

Lines changed: 33 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)