Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(agent-runtime): surface unexecuted text tool calls

Linuxdazhao18eb37ba43b9
diff --git a/docs/spec/03-runtime/02-agent-runtime.md b/docs/spec/03-runtime/02-agent-runtime.md
index b218fb4ca..89887ab4d 100644
--- a/docs/spec/03-runtime/02-agent-runtime.md
+++ b/docs/spec/03-runtime/02-agent-runtime.md
@@ -278,6 +278,18 @@ re-executed. Other malformed context remains subject to strict validation.
Tool token estimates are optional telemetry: an invalid call identity must not
prevent the corresponding terminal tool event from being delivered.
+Complete Qwen-style `<tool_call><function=Name><parameter=...>...</parameter>
+</function></tool_call>` blocks emitted as assistant text for a known tool
+receive a visible `TOOL_CALL_NOT_EXECUTED` diagnostic on that response. This
+also applies when normal text precedes the block or structured sibling calls
+execute successfully. The original text is preserved; the affected message
+has error status, while valid structured calls and normal continuation remain
+unchanged. Text is never parsed into executable arguments, tools are never
+silently activated, and no provider retry is spent. Fenced, inline, quoted and
+indented examples, unknown tool names and incomplete blocks are not diagnosed.
+This is a conservative format diagnostic, not a general XML parser or proof
+that the model intended an action.
+
Before surfacing a pre-stream `PROVIDER_ERROR` for HTTP 400/422 whose message
ends in `(no body)`, the runtime makes at most one silent repair attempt with
the generated output-limit fields removed: `max_tokens`,
diff --git a/docs/spec/03-runtime/08-error-codes.md b/docs/spec/03-runtime/08-error-codes.md
index 7884d8c35..066f06a86 100644
--- a/docs/spec/03-runtime/08-error-codes.md
+++ b/docs/spec/03-runtime/08-error-codes.md
@@ -106,6 +106,7 @@ does not turn temporary thread pressure into a host process exit.
| `CONTEXT_COMPACTION_FAILED` | no | automatic retained-tail recovery could not prepare, persist, or fit a checkpoint, or manual checkpoint summary generation / durable append failed; the guarded next provider request does not start |
| `STREAM_FAILED` | yes | provider stream was terminated, closed prematurely, or otherwise ended before a complete response; up to ten same-turn retries may precede the terminal event |
| `EMPTY_MODEL_RESPONSE` | yes | the model ended its turn with no tool call and no visible text twice: once as streamed, once after the automatic re-run; the first reply to a Host-ledger completion notice is exempt (spec 02-agent-runtime §5e, D446) |
+| `TOOL_CALL_NOT_EXECUTED` | no | a complete known-tool Qwen call was emitted as assistant text; the message shows a format diagnostic without executing text, retrying the provider or interrupting valid structured siblings |
| `PROMPT_ENHANCEMENT_EMPTY` | no | the one-shot enhancement model returned no text |
| `SPEECH_NOT_CONFIGURED` | no | host speech ASR or TTS is not bound in settings |
| `SPEECH_PROTOCOL_UNSUPPORTED` | no | the speech protocol is unknown or does not support this role |
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index f7041b3ad..cbef85964 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -181,6 +181,20 @@
the actual settings panes and verifies saved bindings remain editable.
+### E2E-RUNTIME-text-tool-call-diagnostic
+
+- **Preconditions:** Isolated runtime with a fixture provider and synthetic data.
+- **Steps:** Return a complete text-form Qwen `TodoWrite` call, alone and after
+ normal prose. Repeat alongside a valid structured Bash call. Then return a
+ normal answer. Repeat with fenced/inline/quoted/indented XML examples,
+ incomplete blocks and an unknown tool name.
+- **Expected:** The literal known-tool call retains its text and displays
+ `TOOL_CALL_NOT_EXECUTED` with error message status. It never executes or
+ activates the text-form tool, and never retries automatically. Structured
+ sibling calls execute once and normal continuation succeeds. Examples,
+ unknown names and incomplete blocks remain ordinary text.
+- **Coverage:** `text-tool-call.test.ts`, `malformed-tool-recovery.test.ts`.
+
### E2E-PI-130-kernel-upgrade
- **Preconditions:** Exact Pi 1.3.0 pins and migrated patches in a dedicated
diff --git a/docs/zh-CN/spec/03-runtime/02-agent-runtime.md b/docs/zh-CN/spec/03-runtime/02-agent-runtime.md
index db3ee758f..9f0bfb555 100644
--- a/docs/zh-CN/spec/03-runtime/02-agent-runtime.md
+++ b/docs/zh-CN/spec/03-runtime/02-agent-runtime.md
@@ -1304,6 +1304,18 @@ re-executed. Other malformed context remains subject to strict validation.
Tool token estimates are optional telemetry: an invalid call identity must not
prevent the corresponding terminal tool event from being delivered.
+Complete Qwen-style `<tool_call><function=Name><parameter=...>...</parameter>
+</function></tool_call>` blocks emitted as assistant text for a known tool
+receive a visible `TOOL_CALL_NOT_EXECUTED` diagnostic on that response. This
+also applies when normal text precedes the block or structured sibling calls
+execute successfully. The original text is preserved; the affected message
+has error status, while valid structured calls and normal continuation remain
+unchanged. Text is never parsed into executable arguments, tools are never
+silently activated, and no provider retry is spent. Fenced, inline, quoted and
+indented examples, unknown tool names and incomplete blocks are not diagnosed.
+This is a conservative format diagnostic, not a general XML parser or proof
+that the model intended an action.
+
### 会话作业控制
Agent 模式下,即使没有配置子代理,也提供 TaskWait、TaskList 和 TaskStop。Task 仍要求子代理目录。Plan/Goal 保留声明以兼容对话历史,执行时拒绝这些工具。
diff --git a/docs/zh-CN/spec/03-runtime/08-error-codes.md b/docs/zh-CN/spec/03-runtime/08-error-codes.md
index c88c40c94..b78302ff9 100644
--- a/docs/zh-CN/spec/03-runtime/08-error-codes.md
+++ b/docs/zh-CN/spec/03-runtime/08-error-codes.md
@@ -107,6 +107,7 @@ stdio 与 Tokio 的动态阻塞池隔离,因此后一种情况
| `CONTEXT_COMPACTION_FAILED` | 不 | 自动保留尾部恢复无法准备、持久或适合检查点,或手动检查点摘要生成/持久追加失败;受保护的下一个提供程序请求不会启动 |
| `STREAM_FAILED` | 是的 | 提供程序流在完整响应之前终止、提前关闭或以其他方式结束;最多四次同回合重试可能会在终止事件之前发生 |
| `EMPTY_MODEL_RESPONSE` | 是的 | 模型在没有工具调用且没有可见文本的情况下结束了两次:一次是流式传输,一次是在自动重新运行后;对 Host 账本完成通知的第一条回复除外(规范 02-agent-runtime §5e、D446) |
+| `TOOL_CALL_NOT_EXECUTED` | no | a complete known-tool Qwen call was emitted as assistant text; the message shows a format diagnostic without executing text, retrying the provider or interrupting valid structured siblings |
| `PROMPT_ENHANCEMENT_EMPTY` | 不 | 一次性增强模型没有返回任何文本 |
| `SPEECH_NOT_CONFIGURED` | 不 | 设置里没有绑定转写或朗读 |
| `SPEECH_PROTOCOL_UNSUPPORTED` | 不 | 语音协议未知或不支持该角色 |
diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
index f030063cc..487e34a99 100644
--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
@@ -9,6 +9,20 @@
---
+### E2E-RUNTIME-text-tool-call-diagnostic
+
+- **Preconditions:** Isolated runtime with a fixture provider and synthetic data.
+- **Steps:** Return a complete text-form Qwen `TodoWrite` call, alone and after
+ normal prose. Repeat alongside a valid structured Bash call. Then return a
+ normal answer. Repeat with fenced/inline/quoted/indented XML examples,
+ incomplete blocks and an unknown tool name.
+- **Expected:** The literal known-tool call retains its text and displays
+ `TOOL_CALL_NOT_EXECUTED` with error message status. It never executes or
+ activates the text-form tool, and never retries automatically. Structured
+ sibling calls execute once and normal continuation succeeds. Examples,
+ unknown names and incomplete blocks remain ordinary text.
+- **Coverage:** `text-tool-call.test.ts`, `malformed-tool-recovery.test.ts`.
+
### E2E-PI-130-kernel-upgrade
- **Preconditions:** Pi 1.3.0 with migrated patches, isolated fixture state, and
diff --git a/packages/agent-runtime/src/malformed-tool-recovery.test.ts b/packages/agent-runtime/src/malformed-tool-recovery.test.ts
index 0e42e6cf8..30d827d5f 100644
--- a/packages/agent-runtime/src/malformed-tool-recovery.test.ts
+++ b/packages/agent-runtime/src/malformed-tool-recovery.test.ts
@@ -1,4 +1,6 @@
import { describe, expect, it, vi } from "vitest";
+import { createServer } from "node:http";
+import type { AddressInfo } from "node:net";
import type { AgentMessage } from "@earendil-works/pi-agent-core";
import { createAssistantMessageEventStream, type AssistantMessage } from "@earendil-works/pi-ai";
import { validateHostedSearchMessages } from "@earendil-works/pi-ai/utils/hosted-search";
@@ -21,7 +23,7 @@ function assistant(content: unknown[], stopReason = "toolUse"): AssistantMessage
const call = (id = "valid-call") => ({ type: "toolCall", id, name: "Bash", arguments: { command: "printf checked" } });
const answer = () => assistant([{ type: "text", text: "The requested check is complete." }], "stop");
-function fixture(reply: (round: number) => AssistantMessage) {
+function fixture(reply: (round: number) => AssistantMessage, baseUrl?: string) {
const requests: AgentMessage[][] = [];
const events: AgentEventEnvelope["event"][] = [];
const host = { call: vi.fn(async (method: string) => method === "tools.execute"
@@ -29,13 +31,13 @@ function fixture(reply: (round: number) => AssistantMessage) {
: undefined) };
const runtime = new DesktopAgentRuntime({
sessionId: "malformed-call-fixture", mode: "agent", thinkingLevel: "off", host: host as never,
- provider: { id: "fixture", name: "Fixture", modelId: "fixture", apiKey: "fixture", baseUrl: "http://localhost/v1",
+ provider: { id: "fixture", name: "Fixture", modelId: "fixture", apiKey: "fixture", baseUrl: baseUrl ?? "http://localhost/v1",
supportsReasoning: false, supportedThinkingLevels: ["off"] },
commandShell: { id: "bash", label: "Bash", dialect: "posix", available: true, isDefault: true },
history: [{ id: "earlier-user", role: "user", content: "Keep the completed work.", createdAt: new Date(1).toISOString() }],
onEvent: (envelope) => events.push(envelope.event),
});
- vi.spyOn(runtime["models"], "streamSimple").mockImplementation((_model, context) => {
+ if (!baseUrl) vi.spyOn(runtime["models"], "streamSimple").mockImplementation((_model, context) => {
requests.push(structuredClone(context.messages));
if (requests.length > 6) throw new Error("Unexpected extra provider request");
validateHostedSearchMessages(context.messages);
@@ -52,6 +54,43 @@ function fixture(reply: (round: number) => AssistantMessage) {
}
describe("malformed tool-call recovery", () => {
+ it.each([false, true])("makes an unexecuted text tool call visible, with real sibling call: %s", async (withSibling) => {
+ const text = 'I checked the workspace.\n<tool_call>\n<function=TodoWrite>\n<parameter=todos>\n[]\n</parameter>\n</function>\n</tool_call>';
+ const requests: string[] = [];
+ const server = createServer(async (request, response) => {
+ let body = "";
+ for await (const chunk of request) body += chunk;
+ requests.push(body);
+ const sibling = withSibling && requests.length === 1;
+ const delta = {
+ role: "assistant", content: requests.length === 1 ? text : "The requested check is complete.",
+ ...(sibling ? { tool_calls: [{ index: 0, id: "valid-call", type: "function", function: {
+ name: "Bash", arguments: JSON.stringify({ command: "printf checked" }),
+ } }] } : {}),
+ };
+ response.writeHead(200, { "content-type": "text/event-stream" });
+ response.end(`data: ${JSON.stringify({ choices: [{ index: 0, delta, finish_reason: sibling ? "tool_calls" : "stop" }] })}\n\ndata: [DONE]\n\n`);
+ });
+ await new Promise<void>((resolve) => server.listen(0, "127.0.0.1", resolve));
+ const { runtime, host, events } = fixture(answer, `http://127.0.0.1:${(server.address() as AddressInfo).port}/v1`);
+ try {
+ await runtime.prompt("Track the requested work.");
+ expect(events).toContainEqual(expect.objectContaining({
+ type: "message_end", message: expect.objectContaining({
+ content: text, status: "error", error: expect.objectContaining({
+ code: "TOOL_CALL_NOT_EXECUTED", message: expect.stringContaining("TodoWrite"),
+ }),
+ }),
+ }));
+ expect(host.call.mock.calls.filter(([method]) => method === "tools.execute")).toHaveLength(withSibling ? 1 : 0);
+ expect(requests).toHaveLength(withSibling ? 2 : 1);
+ expect(events.filter((event) => event.type === "tool_start" && event.toolName === "TodoWrite")).toHaveLength(0);
+ } finally {
+ await runtime.dispose();
+ await new Promise<void>((resolve, reject) => server.close((error) => error ? reject(error) : resolve()));
+ }
+ });
+
it.each([
["empty name", { name: "" }],
["missing name", { name: undefined }],
diff --git a/packages/agent-runtime/src/runtime.ts b/packages/agent-runtime/src/runtime.ts
index 8be2fca77..980c844c0 100644
--- a/packages/agent-runtime/src/runtime.ts
+++ b/packages/agent-runtime/src/runtime.ts
@@ -18,6 +18,7 @@ import { restoreHostedSearchReplay } from "./hosted-search-replay.js";
import { requestExtensionUi } from "./extensions/ui-request.js";
import { readLocalRequestErrorDetails } from "./local-request-errors.js";
import { isValidToolCall, recoverMalformedToolCalls } from "./tool-call-recovery.js";
+import { textToolCallDiagnostic } from "./text-tool-call.js";
import { computerUseDescription, computerUseParameters } from "./computer-use/tool.js";
import { imageGenerationDescription, imageGenerationParameters } from "./image-generation/tool.js";
import { todoWriteDescription, todoWriteParameters } from "./todo-tool.js";
@@ -8560,6 +8561,10 @@ Do not invent objections or turn speculative risks into blockers. Stop when the
// inspect only the response that just ended, or a silent retry after
// progress text would look non-silent forever.
const responseText = content.hasText ? content.text : "";
+ // Annotate literal calls without aborting valid structured siblings.
+ const textCallDiagnostic = !failed && !aborted
+ ? textToolCallDiagnostic(responseText, this.toolCatalog)
+ : undefined;
if (looksLikePseudoToolCall(nextText)) {
// The visible text is a lost tool batch, not an answer. Logging it
// separates "the model went quiet" from "the model tried to act and
@@ -8782,6 +8787,8 @@ Do not invent objections or turn speculative risks into blockers. Stop when the
thinking: nextThinking,
})
: undefined;
+ // This message annotation does not become a terminal run error.
+ classifiedError ??= textCallDiagnostic;
this.currentAssistant = {
...this.currentAssistant,
content: nextText,
@@ -8790,7 +8797,7 @@ Do not invent objections or turn speculative risks into blockers. Stop when the
: content.hasThinking
? { thinking: undefined }
: {}),
- status: failed || emptyResponse
+ status: failed || emptyResponse || textCallDiagnostic
? "error"
: aborted
? "aborted"
diff --git a/packages/agent-runtime/src/text-tool-call.test.ts b/packages/agent-runtime/src/text-tool-call.test.ts
new file mode 100644
index 000000000..3e979e201
--- /dev/null
+++ b/packages/agent-runtime/src/text-tool-call.test.ts
@@ -0,0 +1,28 @@
+import { describe, expect, it } from "vitest";
+import { textToolCallDiagnostic } from "./text-tool-call.js";
+
+const tools = new Map([["TodoWrite", {}]]);
+const xml = '<tool_call>\n<function=TodoWrite>\n<parameter=todos>\n[]\n</parameter>\n</function>\n</tool_call>';
+
+describe("text tool-call diagnostics", () => {
+ it.each([xml, `Workspace checked.\n${xml}`, xml.replaceAll("\n", "")])("recognizes a complete call outside code", (text) => {
+ expect(textToolCallDiagnostic(text, tools)?.code).toBe("TOOL_CALL_NOT_EXECUTED");
+ });
+ it.each([
+ `\`\`\`xml\n${xml}\n\`\`\``,
+ `~~~xml\n${xml}\n~~~`,
+ `\`\`\`\`xml\n\`\`\`\n${xml}\n\`\`\`\``,
+ `\`${xml.replaceAll("\n", "")}\``,
+ xml.split("\n").map((line) => `> ${line}`).join("\n"),
+ xml.split("\n").map((line) => ` ${line}`).join("\n"),
+ xml.replace("</tool_call>", ""),
+ xml.replace("</function>", ""),
+ xml.replace("TodoWrite", "UnknownTool"),
+ "The task is complete.",
+ ])("leaves examples, incomplete calls and unknown names alone", (text) => {
+ expect(textToolCallDiagnostic(text, tools)).toBeUndefined();
+ });
+ it("still checks prose following a fenced example", () => {
+ expect(textToolCallDiagnostic(`~~~xml\n${xml}\n~~~\n${xml}`, tools)?.code).toBe("TOOL_CALL_NOT_EXECUTED");
+ });
+});
diff --git a/packages/agent-runtime/src/text-tool-call.ts b/packages/agent-runtime/src/text-tool-call.ts
new file mode 100644
index 000000000..3cd3e81ba
--- /dev/null
+++ b/packages/agent-runtime/src/text-tool-call.ts
@@ -0,0 +1,41 @@
+import type { ClassifiedAgentError } from "./agent-errors.js";
+import { ErrorCodes } from "@pi-desktop/shared";
+
+/** Recognize literal call-shaped output, never turn assistant prose into actions. */
+export function textToolCallDiagnostic(
+ text: string,
+ toolNames: ReadonlyMap<string, unknown>,
+): ClassifiedAgentError | undefined {
+ let fence: { marker: string; length: number } | undefined;
+ const visible: string[] = [];
+ for (const line of text.split("\n")) {
+ const delimiter = /^ {0,3}(`{3,}|~{3,})(.*)$/.exec(line);
+ if (delimiter) {
+ const marker = delimiter[1][0];
+ if (!fence) fence = { marker, length: delimiter[1].length };
+ else if (marker === fence.marker && delimiter[1].length >= fence.length && !delimiter[2].trim()) fence = undefined;
+ visible.push("");
+ } else {
+ visible.push(fence ? "" : line);
+ }
+ }
+ const prose = visible.join("\n");
+ const starts = /(?:^|\n) {0,3}<tool_call>/g;
+ let coveredUntil = 0;
+ for (const start of prose.matchAll(starts)) {
+ if (start.index < coveredUntil) continue;
+ const offset = start.index + start[0].length;
+ const end = prose.indexOf("</tool_call>", offset);
+ if (end < 0) break;
+ coveredUntil = end + "</tool_call>".length;
+ const body = prose.slice(offset, end);
+ const call = /^\s*<function=([\w.-]{1,128})>\s*<parameter=[\w.-]{1,128}>/.exec(body);
+ if (!call || !toolNames.has(call[1]) || !/<\/parameter>\s*<\/function>\s*$/.test(body)) continue;
+ return {
+ code: ErrorCodes.TOOL_CALL_NOT_EXECUTED,
+ message: `The reply contains a text-form ${call[1]} call. Text is not executed as a tool call; check the provider's tool-call format and activate on-demand tools with ToolSearch.`,
+ retriable: false,
+ };
+ }
+ return undefined;
+}
diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.ts
index 1b080b37c..1c2459eac 100644
--- a/packages/i18n/src/locales/de/index.ts
+++ b/packages/i18n/src/locales/de/index.ts
@@ -3045,6 +3045,7 @@ sklm: {
NETWORK_POLICY_BLOCKED: "Die Adressprüfung der App hat diese Anfrage blockiert. Bei Proxy oder VPN: Einstellungen → System → Netzwerk prüfen.",
"TIMEOUT": "Bei der Anfrage an den KI-Anbieter ist eine Zeitüberschreitung aufgetreten.",
"STREAM_FAILED": "Die Antwort wurde unterbrochen.",
+ "TOOL_CALL_NOT_EXECUTED": "Das Modell hat einen Werkzeugaufruf als Text ausgegeben. Dieser Aufruf wurde nicht ausgeführt.",
"EMPTY_MODEL_RESPONSE": "Das Modell beendete seinen Zug zweimal hintereinander, ohne etwas zu sagen. Versuchen Sie es erneut oder formulieren Sie Ihre Anfrage um.",
"MUTATION_RETRY_BUDGET_EXHAUSTED": "Die gleiche Bearbeitung schlug dreimal fehl, daher wurde dieser Zug abgebrochen, anstatt es erneut zu versuchen. Bitten Sie erneut, fortzufahren.",
"CONTEXT_TOO_LARGE": "Dieser Chat ist nach der Kontextwiederherstellung immer noch zu lang. Kürzen Sie Ihre Nachricht oder starten Sie einen neuen Chat.",
diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.ts
index c22a36bc1..1991b3d83 100644
--- a/packages/i18n/src/locales/en/index.ts
+++ b/packages/i18n/src/locales/en/index.ts
@@ -3184,6 +3184,7 @@ importConfirm: "Imported extensions run inside the agent process with the same a
NETWORK_POLICY_BLOCKED: "The app's address check blocked this request. Behind a proxy or VPN, check Settings → System → Network.",
TIMEOUT: "The request to the AI provider timed out.",
STREAM_FAILED: "The reply was interrupted.",
+ TOOL_CALL_NOT_EXECUTED: "The model wrote a tool call as text. That call was not executed.",
EMPTY_MODEL_RESPONSE:
"The model finished its turn without saying anything, twice in a row. Try again, or rephrase your request.",
MUTATION_RETRY_BUDGET_EXHAUSTED:
diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.ts
index a9d90fc59..c5f0cc44b 100644
--- a/packages/i18n/src/locales/es/index.ts
+++ b/packages/i18n/src/locales/es/index.ts
@@ -3043,6 +3043,7 @@ sklm: {
NETWORK_POLICY_BLOCKED: "La comprobación de direcciones de la aplicación bloqueó esta solicitud. Si usas proxy o VPN, revisa Configuración → Sistema → Red.",
"TIMEOUT": "Se agotó el tiempo de espera de la solicitud al proveedor de IA.",
"STREAM_FAILED": "La respuesta fue interrumpida.",
+ "TOOL_CALL_NOT_EXECUTED": "El modelo escribió una llamada de herramienta como texto. Esa llamada no se ejecutó.",
"EMPTY_MODEL_RESPONSE": "El modelo terminó su turno sin decir nada, dos veces seguidas. Inténtelo de nuevo o reformule su solicitud.",
"MUTATION_RETRY_BUDGET_EXHAUSTED": "La misma edición falló tres veces, por lo que este turno se detuvo en lugar de volver a intentarlo a ciegas. Pregunta nuevamente para continuar.",
"CONTEXT_TOO_LARGE": "Este chat aún dura demasiado después de la recuperación del contexto. Acorta tu mensaje o inicia un nuevo chat.",
diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.ts
index cf19a32f7..fa0a5bf7c 100644
--- a/packages/i18n/src/locales/fr/index.ts
+++ b/packages/i18n/src/locales/fr/index.ts
@@ -3043,6 +3043,7 @@ sklm: {
NETWORK_POLICY_BLOCKED: "Le contrôle d'adresse de l'application a bloqué cette requête. Si vous utilisez un proxy ou un VPN, vérifiez Paramètres → Système → Réseau.",
"TIMEOUT": "La demande adressée au fournisseur d'IA a expiré.",
"STREAM_FAILED": "La réponse a été interrompue.",
+ "TOOL_CALL_NOT_EXECUTED": "Le modèle a écrit un appel d’outil sous forme de texte. Cet appel n’a pas été exécuté.",
"EMPTY_MODEL_RESPONSE": "Le modèle a terminé son tour sans rien dire, deux fois de suite. Réessayez ou reformulez votre demande.",
"MUTATION_RETRY_BUDGET_EXHAUSTED": "La même modification a échoué trois fois, donc ce tour s'est arrêté au lieu de réessayer en aveugle. Demandez à nouveau pour continuer.",
"CONTEXT_TOO_LARGE": "Ce chat est encore trop long après la récupération du contexte. Raccourcissez votre message ou démarrez une nouvelle discussion.",
diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.ts
index f08cf5c4a..827328e22 100644
--- a/packages/i18n/src/locales/ko/index.ts
+++ b/packages/i18n/src/locales/ko/index.ts
@@ -3082,6 +3082,7 @@ importConfirm: "가져온 확장은 에이전트 프로세스 안에서 에이
NETWORK_POLICY_BLOCKED: "앱의 주소 검사가 이 요청을 차단했습니다. 프록시나 VPN을 사용한다면 설정 → 시스템 → 네트워크를 확인하세요.",
TIMEOUT: "AI 프로바이더 요청 시간이 초과되었습니다.",
STREAM_FAILED: "답변이 중단되었습니다.",
+ TOOL_CALL_NOT_EXECUTED: "모델이 도구 호출을 텍스트로 작성했습니다. 해당 호출은 실행되지 않았습니다.",
EMPTY_MODEL_RESPONSE:
"모델이 두 번 연속 아무 말 없이 턴을 완료했습니다. 다시 시도하거나 요청을 바꿔 표현하세요.",
MUTATION_RETRY_BUDGET_EXHAUSTED:
diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.ts
index 0537a298d..5571859e5 100644
--- a/packages/i18n/src/locales/pt-BR/index.ts
+++ b/packages/i18n/src/locales/pt-BR/index.ts
@@ -3013,6 +3013,7 @@ export const ptBR = {
NETWORK_POLICY_BLOCKED: "A verificação de endereço do aplicativo bloqueou esta solicitação. Em redes com proxy ou VPN, verifique Configurações → Sistema → Rede.",
TIMEOUT: "A solicitação ao provedor de IA atingiu o tempo limite.",
STREAM_FAILED: "A resposta foi interrompida.",
+ TOOL_CALL_NOT_EXECUTED: "O modelo escreveu uma chamada de ferramenta como texto. Essa chamada não foi executada.",
EMPTY_MODEL_RESPONSE: "O modelo encerrou a rodada sem gerar resposta, duas vezes seguidas. Tente novamente ou reformule sua solicitação.",
MUTATION_RETRY_BUDGET_EXHAUSTED: "A mesma edição falhou três vezes seguidas. A rodada foi interrompida para evitar novas tentativas às cegas. Peça para continuar.",
CONTEXT_TOO_LARGE: "Esta conversa ainda é longa demais após a recuperação de contexto. Encurte sua mensagem ou inicie uma nova conversa.",
diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.ts
index d56c50bb3..17e9cd2c5 100644
--- a/packages/i18n/src/locales/tr/index.ts
+++ b/packages/i18n/src/locales/tr/index.ts
@@ -3075,6 +3075,7 @@ importConfirm: "İçe aktarılan uzantılar ajan sürecinde, ajanın kendi araç
NETWORK_POLICY_BLOCKED: "Uygulamanın adres denetimi bu isteği engelledi. Proxy veya VPN kullanıyorsanız Ayarlar → Sistem → Ağ bölümüne bakın.",
TIMEOUT: "AI servisine istek zaman aşımına uğradı.",
STREAM_FAILED: "Yanıt kesildi.",
+ TOOL_CALL_NOT_EXECUTED: "Model bir araç çağrısını metin olarak yazdı. Bu çağrı çalıştırılmadı.",
EMPTY_MODEL_RESPONSE:
"Model iki tur üst üste hiçbir şey söylemeden bitirdi. Yeniden deneyin veya isteği başka türlü sorun.",
MUTATION_RETRY_BUDGET_EXHAUSTED:
diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.ts
index 74d41b22a..027aff523 100644
--- a/packages/i18n/src/locales/zh-CN/index.ts
+++ b/packages/i18n/src/locales/zh-CN/index.ts
@@ -3115,6 +3115,7 @@ sklm: {
NETWORK_POLICY_BLOCKED: "应用的地址校验阻止了该请求。若使用代理或 VPN,请检查 设置 → 系统 → 网络。",
TIMEOUT: "请求 AI 服务超时。",
STREAM_FAILED: "回复中断了。",
+ TOOL_CALL_NOT_EXECUTED: "模型把工具调用写成了正文,该调用没有执行。",
EMPTY_MODEL_RESPONSE: "模型连续两轮都没有输出内容。可以重试,或换一种说法。",
MUTATION_RETRY_BUDGET_EXHAUSTED:
"同一处修改连续失败三次,本轮已停止,不再盲目重试。再说一次即可继续。",
diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.ts
index f15d114eb..01aa77fe0 100644
--- a/packages/i18n/src/locales/zh-TW/index.ts
+++ b/packages/i18n/src/locales/zh-TW/index.ts
@@ -3065,6 +3065,7 @@ sklm: {
NETWORK_POLICY_BLOCKED: "應用程式的地址校驗阻止了該請求。若使用代理或 VPN,請檢查 設定 → 系統 → 網路。",
TIMEOUT: "請求 AI 服務超時。",
STREAM_FAILED: "回覆中斷了。",
+ TOOL_CALL_NOT_EXECUTED: "模型把工具呼叫寫成了正文,該呼叫沒有執行。",
EMPTY_MODEL_RESPONSE: "模型連續兩輪都沒有輸出內容。可以重試,或換一種說法。",
MUTATION_RETRY_BUDGET_EXHAUSTED:
"同一處修改連續失敗三次,本輪已停止,不再盲目重試。再說一次即可繼續。",
diff --git a/packages/shared/src/errors.ts b/packages/shared/src/errors.ts
index 8e0eb073d..3ec18a6d4 100644
--- a/packages/shared/src/errors.ts
+++ b/packages/shared/src/errors.ts
@@ -138,6 +138,7 @@ export const ErrorCodes = {
CONTEXT_COMPACTION_FAILED: "CONTEXT_COMPACTION_FAILED",
STREAM_FAILED: "STREAM_FAILED",
EMPTY_MODEL_RESPONSE: "EMPTY_MODEL_RESPONSE",
+ TOOL_CALL_NOT_EXECUTED: "TOOL_CALL_NOT_EXECUTED",
/**
* The Node agent sidecar process died mid-turn (native crash, kill, or an
* unclassified abort). Main and the headless runtime settle the owning turn