Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
ACP: an image refusal by a text-only model heals the thread and stops MCP tool images
jerryping5555e60bfef8a389
diff --git a/server/chat-notices.ts b/server/chat-notices.tsindex f28f4c519d..6c4d588472 100644--- a/server/chat-notices.ts+++ b/server/chat-notices.ts@@ -40,6 +40,7 @@ export const CHAT_NOTICE = {"chat.notice.acpStopFailed": "{provider} ignored Stop and its process could not be ended","chat.notice.toolCount": "{provider} refused this turn because this model takes at most {limit} tools and this bot offers more, even with its tool lists trimmed, so nothing ran. Turn off some of this bot's apps or MCP servers, or switch the bot to another model.","chat.notice.toolCountUnknown": "{provider} refused this turn because this model takes at most a limited number of tools and this bot offers more, even with its tool lists trimmed, so nothing ran. Turn off some of this bot's apps or MCP servers, or switch the bot to another model.",+ "chat.notice.imageContent": "{provider} refused this turn as an invalid request because this model reads text only and this conversation carries an image — one attached in chat or read by a tool — so every message fails the same way. Switch this bot to a model that can see images, or start a new conversation.","chat.notice.modelNoRoute": "{provider} can't use the model {model} here, so choose another model for this bot.","chat.notice.modelNoRouteUnnamed": "{provider} can't use this bot's model here, so choose another model for this bot.","chat.notice.goalRetry": "{name}'s turn did not settle ({why}) — retrying once.",diff --git a/server/drivers/acp/acp.test.ts b/server/drivers/acp/acp.test.tsindex 07989e03fe..1331af71c8 100644--- a/server/drivers/acp/acp.test.ts+++ b/server/drivers/acp/acp.test.ts@@ -26,6 +26,7 @@ import { CursorAgentDriver } from "./cursor.ts";import { QwenAgentDriver } from "./qwen.ts";import { antigravityUpdateFilter } from "../antigravity.ts";import { removeTempDir } from "../../testing/cleanup.ts";+import { forgetTextOnlyTools } from "../../mcp-text-only.ts";import { TurnWatchdog } from "../../turn-watchdog.ts";import { startFakeHttpMcp } from "../../testing/fake-http-mcp-server.ts";import { wideSchema } from "../../testing/oversized-tool-schema.ts";@@ -298,6 +299,7 @@ describe("ACP turns (fake CLI)", () => {delete process.env.FAKE_ACP_MODE;delete process.env.FAKE_ACP_AUTH_METHOD;delete process.env.FAKE_ACP_DUMP;+ forgetTextOnlyTools();delete process.env.FAKE_ACP_RPC_DUMP;delete process.env.FAKE_ACP_RPC_APPEND_FILE;delete process.env.FAKE_ACP_RPC_FAILURE_FILE;@@ -3087,6 +3089,56 @@ describe("ACP turns (fake CLI)", () => {});});+ describe("an image a text-only model cannot read", () => {+ // Z.ai GLM's refusal of a request whose message content holds an image part, reported from a chat where a tool+ // had read a picture into the conversation.+ const imageOnly = { code: -32603, message: "Internal error: messages.content.type is invalid, allowed values: ['text']", data: { service: "session", errorName: "provider.invalid-request" } };++ it("fails in plain words that say why every message in this conversation fails", async () => {+ await refusePrompt(imageOnly);+ releaseFailure();+ const ack = await instance.adapter.sendTurn({ threadId: "text-only-image", text: "go" });+ expect(await recorder.until((event) => event.type === "turn.completed" && event.turnId === ack.turnId))+ .toMatchObject({ ok: false, stopReason: "rpc_error" });+ expect(recorder.events.filter((event) => event.type === "runtime.error" && event.turnId === ack.turnId)).toEqual([expect.objectContaining({+ message: "Select Model Test refused this turn as an invalid request because this model reads text only and this conversation carries an image — one attached in chat or read by a tool — so every message fails the same way. Switch this bot to a model that can see images, or start a new conversation.",+ text: { key: "chat.notice.imageContent", params: { provider: "Select Model Test" } },+ })]);+ });++ it("rebuilds the conversation on the next message instead of resuming the poisoned session", async () => {+ const dump = join(scratch, "poisoned.json");+ process.env.FAKE_ACP_DUMP = dump;+ process.env.FAKE_ACP_DUMP_PROMPT = "1";+ const methods = join(scratch, "poisoned-rpc.json");+ process.env.FAKE_ACP_RPC_DUMP = methods;+ await refusePrompt(imageOnly);+ releaseFailure();+ const failed = await instance.adapter.sendTurn({ threadId: "text-only-rebuild", text: "show me the design" });+ expect(await recorder.until((event) => event.type === "turn.completed" && event.turnId === failed.turnId))+ .toMatchObject({ ok: false, stopReason: "rpc_error" });++ // A fresh fake answers this turn: the poisoned gate applied only to the first process.+ delete process.env.FAKE_ACP_RPC_FAILURE_FILE;+ delete process.env.FAKE_ACP_RPC_FAILURE_GATE;+ const recoveryText = "User: Show me the design.\nAssistant: I read design.png.\nUser: and now?";+ const ack = await instance.adapter.sendTurn({+ threadId: "text-only-rebuild", text: "and now?", resumeCursor: "fake-acp-session", recoveryText,+ });+ expect(await recorder.until((event) => event.type === "turn.completed" && event.turnId === ack.turnId))+ .toMatchObject({ ok: true });+ // The dump file holds the last process's methods: the fresh fake this turn launched never loads the+ // poisoned session, and its prompt is the rebuilt conversation plus the text-only note.+ const sent = JSON.parse(readFileSync(methods, "utf8"));+ expect(sent).not.toContain("session/load");+ expect(sent.filter((method: string) => method === "session/new")).toHaveLength(1);+ expect(recorder.events.find((event) => event.type === "session.started" && event.turnId === ack.turnId))+ .toMatchObject({ rebuilt: true });+ const prompt = JSON.parse(readFileSync(`${dump}.prompt.json`, "utf8"));+ expect(prompt).toEqual([{ type: "text", text: `${recoveryText}\n\n(Your model for this conversation reads text only. Reading an image file with a file tool, or keeping a picture a tool returned, makes every later reply fail. Say you cannot see it, or attach the file unchanged.)` }]);+ });+ });+it("fails normally for another prompt error before any activity", async () => {await refusePrompt({ code: -32603, message: "Internal error: Invalid API key.", data: { service: "session", errorName: "APIError" } });releaseFailure();diff --git a/server/drivers/acp/core.ts b/server/drivers/acp/core.tsindex 21d6a96a32..27c7356c88 100644--- a/server/drivers/acp/core.ts+++ b/server/drivers/acp/core.ts@@ -76,6 +76,7 @@ import { acpRuntimeFailure, acpStopFailure } from "./failure-words.ts";import { narrowsNativeTools, parseToolScope } from "../../../shared/tool-scope.ts";import { acpMcpServers, type AcpMcpServer } from "../turn-mcp.ts"; import { acpOwnMcpTransport, acpSessionMcpServers, loopbackUnproxied } from "../own-mcp-http.ts"; import { acpToolOutput, acpToolProgress } from "../tool-progress.ts";import { learnedToolCountLimit, mcpToolBudget, retryUnderToolLimit } from "../../tool-count-limit.ts"; import { instanceEnvNames } from "../../bot-box/env.ts";+import { learnedTextOnlyTools, learnTextOnlyTools } from "../../mcp-text-only.ts";/** Failures fixed on the provider account, not by retrying; the reporting process stays pooled. */export type AccountErrorCode = Extract<ProviderErrorCode,@@ -287,6 +288,7 @@ const SHARED_SESSIONS_MAX = 6, SHARED_SESSIONS_LIFETIME = 12;const HEALTHY_CLOSE = new Set(["idle", "reset", "contract", "stop", "stopAll", "dispose", "approval-unconfirmed"]);/** ACP agents may compact their history silently; re-send the full prompt after this many bare turns. */const ACP_PROMPT_RE_ANCHOR_TURNS = 8;+function isHermesReasoningReplay(chunk: string, streamed: string): boolean {const reply = streamed.trim();const replay = chunk.trim();@@ -895,8 +897,9 @@ export function createAcpDriver(support: AcpSupport): ProviderDriver<AcpConfig>}const resolvedModel = support.resolveTurnModel?.(turn.model, env, catalog.models);const toolLimitKey = JSON.stringify([instanceId, resolvedModel ?? null]);- const ownMcp = acpOwnMcpTransport(support), mcpServers = acpMcpServers(turn, { http: loopbackUnproxied(env, ownMcp !== "stdio") && ownMcp === "http", engine: support.driverKind,- toolBudget: mcpToolBudget(learnedToolCountLimit(toolLimitKey), support.engineTools ?? 32) });+ const textOnlyModel = learnedTextOnlyTools(toolLimitKey);+ const ownMcp = textOnlyModel ? "stdio" as const : acpOwnMcpTransport(support), mcpServers = acpMcpServers(turn, { http: loopbackUnproxied(env, ownMcp !== "stdio") && ownMcp === "http", engine: support.driverKind,+ toolBudget: mcpToolBudget(learnedToolCountLimit(toolLimitKey), support.engineTools ?? 32), ...(textOnlyModel ? { textOnlyTools: true } : {}) });support.applyTurnEnv?.(env, {model: resolvedModel, requestedModel: turn.model, fullAuto: turnConfig.fullAuto === true, botId: turn.botId, cwd, toolScope: turn.toolScope,threadId, mcpServers,@@ -1269,6 +1272,11 @@ export function createAcpDriver(support: AcpSupport): ProviderDriver<AcpConfig>emitSessionStarted();const { input: promptInput, note: contextNote, split } = turnPrompt(DRIVER_KIND, { threadId, sessionId }, turn, promptTurn, heldSystem(), ACP_PROMPT_RE_ANCHOR_TURNS);if (split) { state.usagePeak = split.previous?.peakUsed ?? split.previous?.lastUsed ?? null; pendingSplitReceipt = split; }+ // The note rides the prompt itself: the engine's own file tools can still read an image into the session+ // (an MCP server is stripped, a plain read is not), and the next refusal marks that session for a rebuild.+ const textOnlyNote = textOnlyModel+ ? "(Your model for this conversation reads text only. Reading an image file with a file tool, or keeping a picture a tool returned, makes every later reply fail. Say you cannot see it, or attach the file unchanged.)"+ : "";const text = support.buildPromptText? support.buildPromptText(promptInput): promptInput.system@@ -1291,7 +1299,7 @@ export function createAcpDriver(support: AcpSupport): ProviderDriver<AcpConfig>const quiet = startQuietWatch(threadId, session, current);const result = await request("session/prompt",- { sessionId, prompt: [{ type: "text", text: text + media.note }, ...imageBlocks, ...media.blocks, ...(contextNote ? [{ type: "text", text: contextNote }] : [])] },+ { sessionId, prompt: [{ type: "text", text: text + media.note }, ...imageBlocks, ...media.blocks, ...(contextNote ? [{ type: "text", text: contextNote }] : []), ...(textOnlyNote ? [{ type: "text", text: textOnlyNote }] : [])] },undefined,undefined,promptIdleMs,@@ -1355,6 +1363,14 @@ export function createAcpDriver(support: AcpSupport): ProviderDriver<AcpConfig>}, failed: (error) => { acknowledge(); emit({ ...base(threadId, turnId), type: "runtime.error", message: error instanceof Error ? error.message : String(error) });emit({ ...base(threadId, turnId), type: "turn.completed", ok: false, stopReason: "rpc_error", cost: null }); } })) return;const message = e instanceof Error ? e.message : String(e);+ // A text-only model's image refusal poisons the session it ran in (the image is in its history) and+ // teaches the model's key: the next turn rebuilds from the recovery text, and its MCP servers answer+ // tool calls without the images.+ if (engineFailureKind(message) === "image_content") {+ learnTextOnlyTools(toolLimitKey);+ if (session.sessionId) brokenSessions.add(session.sessionId);+ if (typeof turn.resumeCursor === "string") brokenSessions.add(turn.resumeCursor);+ }const code = support.classifyError?.(e) ?? (engineFailureKind(message) === "credits" ? "insufficient_funds" : undefined);const needsAuth = code === "invalid_credentials" || code === "inactive_subscription"|| code === "insufficient_funds" || message === support.loginNote;diff --git a/server/drivers/engine-errors.test.ts b/server/drivers/engine-errors.test.tsindex e09ba09874..c5626fd9ee 100644--- a/server/drivers/engine-errors.test.ts+++ b/server/drivers/engine-errors.test.ts@@ -105,6 +105,28 @@ describe("a provider refusing a tool's schema", () => {});});+describe("a text-only model sent an image", () => {+ /** Z.ai GLM's session/prompt refusal as acpRpcError words it, reported from a chat with an image read into the conversation. */+ const GLM = "Internal error: messages.content.type is invalid, allowed values: ['text'] (session/prompt, service: session, provider.invalid-request)";++ it("says in plain words that the model reads text only, keeping the words that class it an invalid request", () => {+ const plain = engineFailureMessage("OpenCode", GLM);+ expect(plain).toBe("OpenCode refused this turn as an invalid request because this model reads text only and this conversation carries an image — one attached in chat or read by a tool — so every message fails the same way. "+ + "Switch this bot to a model that can see images, or start a new conversation.");+ expect(engineFailureKind(GLM)).toBe("image_content");+ expect(engineFailure("OpenCode", GLM)!.text).toEqual({ key: "chat.notice.imageContent", params: { provider: "OpenCode" } });+ expect([reason(GLM), reason(plain!)]).toEqual(["unknown", "invalid_request"]);+ expect(classifyError({ text: plain! }).transient).toBe(false);+ });++ it("reads the words behind an HTTP status too, so the chat runtime keeps them plain", () => {+ expect(engineFailureKind("Z.ai HTTP 400: messages.content.type is invalid, allowed values: ['text']")).toBe("image_content");+ expect(plainFailureMessage("Z.ai", "Z.ai HTTP 400: messages.content.type is invalid, allowed values: ['text']"))+ .toBe(engineFailureMessage("Z.ai", "Z.ai HTTP 400: messages.content.type is invalid, allowed values: ['text']"));+ expect(engineFailureKind("Mistral HTTP 400: content is too long")).toBe("refused");+ });+});+describe("errorReplyFailure", () => {const NOW = Date.parse("2026-10-27T06:12:46Z");const anthropic = (status: number, type: string, message: string) =>diff --git a/server/drivers/engine-errors.ts b/server/drivers/engine-errors.tsindex f2875c837a..a60b88211a 100644--- a/server/drivers/engine-errors.ts+++ b/server/drivers/engine-errors.ts@@ -21,7 +21,7 @@ export const limitQuietMs = (): number => {export const usageLimitWait = (status: number | null | undefined, waitMs: number | null | undefined): boolean =>status === 429 && (waitMs ?? 0) > limitQuietMs();-export type EngineFailureKind = "credits" | "usage_limit" | "rate_limit" | "overloaded" | "server" | "tool_schema" | "tool_count" | "model_no_route" | "refused";+export type EngineFailureKind = "credits" | "usage_limit" | "rate_limit" | "overloaded" | "server" | "tool_schema" | "tool_count" | "image_content" | "model_no_route" | "refused";/** A provider refusing for want of credit or payment, in its own words (402 is read from the status). */const OUT_OF_CREDITS = /\bpayment required\b|\binsufficient (?:account )?(?:funds|balance|credits?)\b|\b(?:credit|account) balance is too low\b|\bout of credits?\b|\bno credits? (?:left|remaining)\b|\bused all (?:available |of (?:your|its) )?credits\b/i;@@ -33,6 +33,11 @@ const OUT_OF_CREDITS = /\bpayment required\b|\binsufficient (?:account )?(?:fundconst TOOL_SCHEMA = /moonshot flavou?red json schema|schema exceeds maximum allowed size|invalid schema for function\b|\btools\.\d+\.custom\.input_schema\b|function_declarations\[\d+\]\.parameters|\btoolSpec\.inputSchema\b/i;const SCHEMA_TOOL_NAME = /\b(?:function|tool) ['"`]([\w.:-]{1,128})['"`]/i;const SCHEMA_TOO_LARGE = /exceeds maximum allowed size|\btoo (?:large|long|big)\b/i;++/** Z.ai GLM's refusal (api.z.ai and open.bigmodel.cn, chat-completions form) when a request carries a content part a+ * text-only model cannot read: an image that reached the conversation — attached in chat or returned by a tool — is+ * resent with every turn, so each one fails with these words. */+const IMAGE_CONTENT = /\bmessages\.content\.type is invalid, allowed values: \[['"]text['"]\]/i;/** The model OpenCode 2.2.5 names in a no-route refusal ("Unsupported package for <id>: <package>", "Model unavailable:* <id>", "Cannot initialize <id>: …"); an id may hold a colon ("ollama-cloud/deepseek-v4.1-flash:1017"). */const NO_ROUTE_MODEL = /\b(?:Unsupported package for|Variant unavailable for|Cannot initialize|Model unavailable:) (\S+?)[:.]?(?=\s|$)/i;@@ -94,6 +99,7 @@ export function engineFailureKind(text: string, status = httpStatusOf(text)): Enif (status === 429) return "rate_limit";if (TOOL_SCHEMA.test(text)) return "tool_schema";if (toolCountLimitFromError(text) !== undefined) return "tool_count";+ if (IMAGE_CONTENT.test(text)) return "image_content";if (MODEL_NO_ROUTE.test(text)) return "model_no_route";if (status !== null) return status >= 500 ? "server" : "refused";return null;@@ -146,6 +152,7 @@ export function engineFailure(return limit == null ? noticeFailure("chat.notice.toolCountUnknown", { provider }): noticeFailure("chat.notice.toolCount", { provider, limit: String(limit) });}+ case "image_content": return noticeFailure("chat.notice.imageContent", { provider });case "model_no_route": {const model = NO_ROUTE_MODEL.exec(text)?.[1];return model ? noticeFailure("chat.notice.modelNoRoute", { provider, model }) : noticeFailure("chat.notice.modelNoRouteUnnamed", { provider });@@ -204,14 +211,15 @@ export function errorReplyFailure(provider: string, text: string, now = Date.nowreturn { ...failure, stopReason: "quota", limit: "engine", ...(resetsAt ? { limitResetsAt: resetsAt } : {}) };}-/** Only an out-of-credits failure or a refused tool schema or tool count in plain words; any other text stays as it is. */+/** Only an out-of-credits failure or a refused tool schema, tool count or image content in plain words; any other text stays as it is. */export function plainFailureMessage(provider: string, text: string): string {return plainFailure(provider, text).message;}export function plainFailure(provider: string, text: string): { message: string; text?: ServerText } {const kind = engineFailureKind(text);- return kind === "credits" || kind === "tool_schema" || kind === "tool_count" ? engineFailure(provider, text, { kind })! : { message: text };+ return kind === "credits" || kind === "tool_schema" || kind === "tool_count" || kind === "image_content"+ ? engineFailure(provider, text, { kind })! : { message: text };}/** ACP protocol v1's StopReason values that explain why a turn ended early. */diff --git a/server/drivers/turn-mcp.test.ts b/server/drivers/turn-mcp.test.tsindex bcacabe229..6aff6f26c9 100644--- a/server/drivers/turn-mcp.test.ts+++ b/server/drivers/turn-mcp.test.ts@@ -4,6 +4,7 @@ import type { SendTurnInput } from "../contracts.ts";import { SPAWNED_PROXIES } from "../proxy-paths.ts";import { AGENTS_ENV_HEADER } from "../routes/own-mcp-http-path.ts";import { TOOL_LIMIT_ENV, TOOL_LIMIT_HEADER } from "../tool-count-limit.ts";+import { TEXT_ONLY_TOOLS_ENV } from "../mcp-text-only.ts";import { TOOL_SCHEMA_PROFILE_ENV } from "../tool-schema-profile.ts";import { agentsToolList } from "./agents-mcp.ts";import { acpMcpServers, ownMcpOverHttp } from "./turn-mcp.ts";@@ -123,3 +124,20 @@ describe("the MCP servers of a turn whose model takes a limited number of tools"}});});++describe("the MCP servers of a turn whose model reads text only", () => {+ const env = (server: ReturnType<typeof acpMcpServers>[number]) =>+ Object.fromEntries(("env" in server ? server.env : []).map(({ name, value }) => [name, value]));++ it("carry the flag on every server, own proxies kept as processes so the flag reaches them", () => {+ const servers = acpMcpServers(turn(), { http: true, textOnlyTools: true });+ expect(servers.every((server) => "command" in server)).toBe(true);+ for (const server of servers) expect([server.name, env(server)[TEXT_ONLY_TOOLS_ENV]]).toEqual([server.name, "1"]);+ });++ it("sets no flag on any server otherwise", () => {+ for (const server of acpMcpServers(turn(), { http: true })) {+ expect(env(server)[TEXT_ONLY_TOOLS_ENV]).toBeUndefined();+ }+ });+});diff --git a/server/drivers/turn-mcp.ts b/server/drivers/turn-mcp.tsindex 1182f860bf..44a298cb86 100644--- a/server/drivers/turn-mcp.ts+++ b/server/drivers/turn-mcp.ts@@ -3,6 +3,7 @@import type { SendTurnInput } from "../contracts.ts";import { canUseMcpServer } from "../../shared/tool-scope.ts";import { harnessMcpTokenEnv } from "../harness-mcp-token.ts";+import { TEXT_ONLY_TOOLS_ENV } from "../mcp-text-only.ts";import { appMountFor, gateServer, mcpStdioServer, type AppMount } from "../mcp-gate-config.ts";import { AGENTS_ENV_HEADER, OWN_MCP_HTTP_PATH, TOOL_SHARE_HEADER } from "../routes/own-mcp-http-path.ts";import { toolListShare } from "../tool-list-budget.ts";@@ -112,11 +113,16 @@ export function ownMcpOverHttp(server: TurnStdioMcpServer): { url: string; heade/** The turn's MCP servers as ACP session/new takes them. stdio is the baseline every ACP agent supports; an agent that* reaches servers by URL (`http`) gets OpenMausBot's own as endpoints of this server instead of a proxy process each.* `engine` is the driver kind, whose provider may limit each tool's schema; `toolBudget`, how many MCP tools the model's- * provider takes in all. */-export function acpMcpServers(turn: SendTurnInput, options: { http?: boolean; engine?: string; toolBudget?: number } = {}): AcpMcpServer[] {+ * provider takes in all; `textOnlyTools`, that the model reads text only, so every server's tool results replace images+ * with a note — and the URL form is not used, whose endpoints strip nothing. */+export function acpMcpServers(turn: SendTurnInput, options: { http?: boolean; engine?: string; toolBudget?: number; textOnlyTools?: boolean } = {}): AcpMcpServer[] {const schemaProfile = toolSchemaProfileFor({ engine: options.engine })?.id;- const servers: AcpMcpServer[] = turnStdioMcpServers(turn, { schemaProfile, toolBudget: options.toolBudget }).map((server) => ({ ...server, env: pairs(server.env) }));- return options.http ? acpOwnServersOverHttp(servers) : servers;+ const servers = turnStdioMcpServers(turn, { schemaProfile, toolBudget: options.toolBudget })+ .map((server) => options.textOnlyTools === true+ ? { ...server, env: { ...server.env, [TEXT_ONLY_TOOLS_ENV]: "1" } }+ : server)+ .map((server) => ({ ...server, env: pairs(server.env) }));+ return options.http && options.textOnlyTools !== true ? acpOwnServersOverHttp(servers) : servers;}/** `servers` with each of OpenMausBot's own stdio proxies as its endpoint on this server; every other server as it was. */diff --git a/server/harness-mcp-proxy.test.ts b/server/harness-mcp-proxy.test.tsindex cee7afad95..d80d23da7d 100644--- a/server/harness-mcp-proxy.test.ts+++ b/server/harness-mcp-proxy.test.ts@@ -60,6 +60,16 @@ describe("harness MCP capability proxy", () => {.resolves.toEqual({ jsonrpc: "2.0", id: 1, result: { content: [{ type: "text", text: "1 row" }] } });});+ it("replaces an image in a tool's result with a note when the model reads text only", async () => {+ status = 200;+ payload = { result: { content: [{ type: "text", text: "snapshot taken" }, { type: "image", data: "jpeg", mimeType: "image/jpeg" }] } };+ const textOnly = await harnessMcpRequest(frame("tools/call", { name: "agent_browser_snapshot" }), { ...connection(), textOnly: true }) as any;+ expect(textOnly.result.content[0]).toEqual({ type: "text", text: "snapshot taken" });+ expect(textOnly.result.content[1]).toEqual({ type: "text", text: expect.stringContaining("[Image from this tool's result not shown: this model reads text only (image/jpeg, ~1 kB).]") });+ const asSent = await harnessMcpRequest(frame("tools/call", { name: "agent_browser_snapshot" }), connection()) as any;+ expect(asSent.result.content[1]).toEqual({ type: "image", data: "jpeg", mimeType: "image/jpeg" });+ });+it("sends Email calls to their own harness route with the Email instructions", async () => {status = 200;payload = { result: { tools: [{ name: "EMAIL_READ_MESSAGE" }], instructions: "mail" } };diff --git a/server/harness-mcp-proxy.ts b/server/harness-mcp-proxy.tsindex 15902fc8df..94a99ce00b 100644--- a/server/harness-mcp-proxy.ts+++ b/server/harness-mcp-proxy.ts@@ -5,6 +5,7 @@ import { failure, harnessMcpRequest, MAX_INPUT_BYTES, MAX_OUTPUT_BYTES, parseHarimport { harnessMcpTokenEnv } from "./harness-mcp-token.ts";import { toolLimitFromEnv } from "./tool-count-limit.ts";import { TOOL_SCHEMA_PROFILE_ENV } from "./tool-schema-profile.ts";+import { textOnlyToolsFromEnv } from "./mcp-text-only.ts";export { harnessMcpRequest } from "./harness-mcp-request.ts";@@ -12,7 +13,7 @@ const MAX_PENDING = 16;function run(kind: HarnessMcpKind): void {const connection = { url: process.env.OMB_HARNESS_URL ?? "", token: process.env[harnessMcpTokenEnv(kind)] ?? "", kind, toolLimit: toolLimitFromEnv(),- schemaProfile: process.env[TOOL_SCHEMA_PROFILE_ENV] };+ schemaProfile: process.env[TOOL_SCHEMA_PROFILE_ENV], textOnly: textOnlyToolsFromEnv() };let input = Buffer.alloc(0);let pending = 0;const output = (message: unknown) => {diff --git a/server/harness-mcp-request.ts b/server/harness-mcp-request.tsindex c1902d78ba..be1584ee66 100644--- a/server/harness-mcp-request.ts+++ b/server/harness-mcp-request.ts@@ -6,6 +6,7 @@ import { PHONE_INSTRUCTIONS, PHONE_RECOVERY } from "./phones/instructions.ts";import { HARNESS_PROXY_TIMEOUT_MS, HARNESS_PROXY_TIMEOUTS_MS } from "./harness-budget.ts";import { capToolListResult } from "./tool-count-limit.ts";import { toolsListResultForShareProfile } from "./tool-list-budget.ts";+import { withoutResultImages } from "./mcp-text-only.ts";export const MAX_INPUT_BYTES = 1_048_576;export const MAX_OUTPUT_BYTES = 16_777_216;@@ -64,7 +65,7 @@ async function boundedJson(response: Response, name: string): Promise<unknown> {export async function harnessMcpRequest(frame: unknown,- connection: { url: string; token: string; kind: HarnessMcpKind; toolLimit?: number; schemaProfile?: unknown },+ connection: { url: string; token: string; kind: HarnessMcpKind; toolLimit?: number; schemaProfile?: unknown; textOnly?: boolean },): Promise<unknown | undefined> {if (!frame || typeof frame !== "object" || Array.isArray(frame)) return failure(null, null, "Invalid request.", -32600);const message = frame as { id?: RpcId; jsonrpc?: unknown; method?: unknown; params?: unknown };@@ -100,6 +101,9 @@ export async function harnessMcpRequest(const log = (line: string) => console.warn(`[${connection.kind}] ${line}`);const result = message.method === "tools/list"? toolsListResultForShareProfile(capToolListResult(payload.result, connection.toolLimit, log), connection.schemaProfile, log) : payload.result;+ if (message.method === "tools/call" && connection.textOnly === true && withoutResultImages(result)) {+ log("replaced an image in a tool's result with a note: this model reads text only");+ }return { jsonrpc: "2.0", id, result };} catch (error) {return failure(id, message.method, unansweredText(error, name, HARNESS_PROXY_TIMEOUTS_MS[connection.kind] ?? HARNESS_PROXY_TIMEOUT_MS) + RECOVERY[connection.kind]);diff --git a/server/mcp-gate.test.ts b/server/mcp-gate.test.tsindex 5184a57284..bc556b7ba5 100644--- a/server/mcp-gate.test.ts+++ b/server/mcp-gate.test.ts@@ -159,6 +159,16 @@ describe("mcp-gate", () => {expect(JSON.parse(await nextLine())).toEqual({ jsonrpc: "2.0", id: 7, result: { echoed: "tools/list", params: null } });});+ it("replaces an image in a tool's result with a note when the model reads text only", async () => {+ const result = { content: [{ type: "text", text: "here is the design:" }, { type: "image", data: "QUJD", mimeType: "image/png" }] };+ start(result, { OMB_MCP_TEXT_ONLY: "1" });+ const answer = (await call("preview")).result;+ expect(answer.content[0]).toEqual({ type: "text", text: "here is the design:" });+ expect(answer.content[1]).toEqual({ type: "text", text: expect.stringContaining("[Image from this tool's result not shown: this model reads text only (image/png, ~1 kB).]") });+ start(result);+ expect((await call("preview")).result).toEqual(result);+ });+it.each([undefined, "not-json", "{}", '{"OMB_GATE_NAME":"notes","OMB_GATE_TOOL_SCOPE":"{}"}'])("refuses missing or corrupt private gate settings before spawning upstream: %s", value => {const key = `OMB_GATE_CONFIG_${"a".repeat(64)}`;start({}, value === undefined ? {} : { [key]: value }, SCOPED_UPSTREAM, ["--config-env", key]);diff --git a/server/mcp-gate.ts b/server/mcp-gate.tsindex ce36d0fb93..6f167e6a84 100644--- a/server/mcp-gate.ts+++ b/server/mcp-gate.ts@@ -16,6 +16,7 @@ import { killCliTree } from "./procs.ts";import { readStdioLines } from "./stdio-lines.ts";import { toolSchemaProfileFromEnv } from "./tool-schema-profile.ts";import { capToolListResult, toolLimitFromEnv } from "./tool-count-limit.ts";+import { textOnlyToolsFromEnv, withoutResultImages } from "./mcp-text-only.ts";type Json = Record<string, unknown>;@@ -47,6 +48,8 @@ const SPILL_HINT = gateEnv.OMB_GATE_SPILL_HINT === "1";const DIRECTORY = gateEnv.OMB_GATE_DIRECTORY === "1";const SCHEMA_PROFILE = toolSchemaProfileFromEnv(process.env);const TOOL_LIMIT = toolLimitFromEnv(process.env);+/** Read from the process env, so the plain (non --config-env) mounts an ACP engine spawns carry it. */+const TEXT_ONLY_TOOLS = textOnlyToolsFromEnv(process.env);function fail(message: string): never {process.stderr.write(`mcp-gate(${NAME}): ${message}\n`);@@ -411,6 +414,9 @@ readStdioLines(child.stdout, (line) => {message.result = capToolListResult(result, TOOL_LIMIT, (note) => process.stderr.write(`mcp-gate(${NAME}): ${note}\n`));}if (request?.kind === "call" && observer && message.error === undefined) observer.returned(request.params, result);+ if (TEXT_ONLY_TOOLS && request?.kind === "call" && message.error === undefined && isRecord(result) && withoutResultImages(result)) {+ process.stderr.write(`mcp-gate(${NAME}): replaced an image in ${request.tool}'s result with a note: this model reads text only\n`);+ }if (request?.kind === "call" && request.trim && isRecord(result)) {try {if (trimCallResult(result, request.tool)) {diff --git a/server/mcp-remote-proxy.test.ts b/server/mcp-remote-proxy.test.tsindex 77693c6737..54e5e139b5 100644--- a/server/mcp-remote-proxy.test.ts+++ b/server/mcp-remote-proxy.test.ts@@ -19,6 +19,7 @@ import { createPageSchema } from "./testing/oversized-tool-schema.ts";import { whopLikeCatalog } from "./testing/whop-like-catalog.ts";import { schemaBytes, TOOL_SCHEMA_PROFILE_ENV } from "./tool-schema-profile.ts";import { TOOL_LIMIT_ENV } from "./tool-count-limit.ts";+import { TEXT_ONLY_TOOLS_ENV } from "./mcp-text-only.ts";const TOKEN = "disposable-remote-fixture-token";type Frame = { id?: string | number; method?: string; params?: Record<string, unknown> };@@ -441,6 +442,22 @@ describe("remote MCP tool directory", () => {expect((await request("tools/list")).result.tools).toEqual(tools.slice(0, 1));});+ it("replaces an image in a tool's result with a note a text-only model can read", async () => {+ fake = await startFakeHttpMcp({+ tools: [{ name: "preview", inputSchema: { type: "object" } }],+ callResult: () => ({ content: [{ type: "text", text: "here is the design:" }, { type: "image", data: "QUJD", mimeType: "image/png" }] }),+ });+ start(mcpStdioServer(spec(fake.url))!, { ...process.env, [TEXT_ONLY_TOOLS_ENV]: "1" });+ await initialize();+ expect((await call("preview")).result.content).toEqual([+ { type: "text", text: "here is the design:" },+ { type: "text", text: expect.stringMatching(/^\[Image from this tool's result not shown: this model reads text only \(image\/png, ~1 kB\)\.\]$/) },+ ]);+ start(mcpStdioServer(spec(fake.url))!);+ await initialize();+ expect((await call("preview")).result.content[1]).toEqual({ type: "image", data: "QUJD", mimeType: "image/png" });+ });+it("reads every page of a paginated catalog, once", async () => {fake = await startFakeHttpMcp({ tools: catalog, pageSize: 40 });start(mcpStdioServer(spec(fake.url), { directory: { name: "whop" } })!);diff --git a/server/mcp-remote-proxy.ts b/server/mcp-remote-proxy.tsindex f55806ff63..ce11ff4e26 100644--- a/server/mcp-remote-proxy.ts+++ b/server/mcp-remote-proxy.ts@@ -31,6 +31,7 @@ import { fitToolListResult } from "./mcp-tool-schema.ts";import { toolSchemaProfileFromEnv } from "./tool-schema-profile.ts";import { capToolListResult, toolLimitFromEnv } from "./tool-count-limit.ts";import { readStdioLines } from "./stdio-lines.ts";+import { textOnlyToolsFromEnv, withoutResultImages } from "./mcp-text-only.ts";import { APP_EXTENSION_KEY } from "../shared/app.ts";type Json = Record<string, unknown>;@@ -112,6 +113,7 @@ const HANDSHAKE = observer?.mount.extension ? { extensions: { [APP_EXTENSION_KEYconst appOnly = new Set<string>();const SCHEMA_PROFILE = toolSchemaProfileFromEnv(process.env);const TOOL_LIMIT = toolLimitFromEnv(process.env);+const TEXT_ONLY_TOOLS = textOnlyToolsFromEnv(process.env);const logFit = (line: string) => { process.stderr.write(`mcp-remote-proxy: ${line}\n`); };const REMOTE_ERROR_CHARS = 1_000;@@ -341,6 +343,9 @@ async function handle(message: Json): Promise<void> {try {const result = directory ? await directed(message, signal) : await upstream(message.method, message.params, signal);if (message.method === "initialize") initialized = true;+ if (message.method === "tools/call" && TEXT_ONLY_TOOLS && withoutResultImages(result)) {+ logFit("replaced an image in the tool's result with a note: this model reads text only");+ }send({ jsonrpc: "2.0", id: message.id, result: message.method === "tools/list" ? capToolListResult(fitToolListResult(result, SCHEMA_PROFILE, logFit), TOOL_LIMIT, logFit) : result });} catch (failure) {// Transport failures may carry URLs or header values: never relayed.diff --git a/server/mcp-text-only.test.ts b/server/mcp-text-only.test.tsnew file mode 100644index 0000000000..fc234d051c--- /dev/null+++ b/server/mcp-text-only.test.ts@@ -0,0 +1,43 @@+import { describe, expect, it } from "vitest";++import { forgetTextOnlyTools, learnTextOnlyTools, learnedTextOnlyTools, textOnlyToolsFromEnv, withoutResultImages } from "./mcp-text-only.ts";++describe("withoutResultImages", () => {+ it("replaces every image content part with a text note, keeping the rest as it was", () => {+ const result = { content: [{ type: "text", text: "here:" }, { type: "image", data: "QUJD", mimeType: "image/png" }, { type: "image", data: "REVG", mimeType: "image/jpeg" }] };+ expect(withoutResultImages(result)).toBe(true);+ expect(result.content[0]).toEqual({ type: "text", text: "here:" });+ expect(result.content[1]).toEqual({ type: "text", text: expect.stringContaining("[Image from this tool's result not shown: this model reads text only (image/png, ~1 kB).]") });+ expect(result.content[2]).toEqual({ type: "text", text: expect.stringContaining("(image/jpeg") });+ });++ it("leaves results without image parts, and unreadable ones, exactly as they came", () => {+ const text = { content: [{ type: "text", text: "done" }] };+ expect(withoutResultImages(text)).toBe(false);+ expect(text).toEqual({ content: [{ type: "text", text: "done" }] });+ const bare = { content: "done" };+ expect(withoutResultImages(bare)).toBe(false);+ expect(withoutResultImages({})).toBe(false);+ expect(withoutResultImages(null)).toBe(false);+ expect(withoutResultImages(undefined)).toBe(false);+ });+});++describe("the learned text-only models", () => {+ it("remembers a key until forgotten", () => {+ expect(learnedTextOnlyTools('["i","m"]')).toBe(false);+ learnTextOnlyTools('["i","m"]');+ expect(learnedTextOnlyTools('["i","m"]')).toBe(true);+ expect(learnedTextOnlyTools('["i","other"]')).toBe(false);+ forgetTextOnlyTools();+ expect(learnedTextOnlyTools('["i","m"]')).toBe(false);+ });+});++describe("textOnlyToolsFromEnv", () => {+ it("reads only the exact flag the turn set", () => {+ expect(textOnlyToolsFromEnv({})).toBe(false);+ expect(textOnlyToolsFromEnv({ OMB_MCP_TEXT_ONLY: "0" })).toBe(false);+ expect(textOnlyToolsFromEnv({ OMB_MCP_TEXT_ONLY: "1" })).toBe(true);+ });+});diff --git a/server/mcp-text-only.ts b/server/mcp-text-only.tsnew file mode 100644index 0000000000..c2ff2d4dcd--- /dev/null+++ b/server/mcp-text-only.ts@@ -0,0 +1,55 @@+// A model that reads text only: Z.ai GLM's OpenAI-compatible endpoints (api.z.ai and open.bigmodel.cn) refuse a+// request whose message content holds an image part — "messages.content.type is invalid, allowed values: ['text']"+// — and an engine resends its whole session every turn, so one image anywhere in the conversation fails every+// later message. A refusal teaches the model's key here; after that, the turn's MCP servers answer tool calls+// with the image parts replaced by a text note the model can read.++/** Set in the environment of every MCP server a turn mounts for a model that reads text only. */+export const TEXT_ONLY_TOOLS_ENV = "OMB_MCP_TEXT_ONLY";++export function textOnlyToolsFromEnv(env: NodeJS.ProcessEnv = process.env): boolean {+ return env[TEXT_ONLY_TOOLS_ENV] === "1";+}++const isRecord = (value: unknown): value is Record<string, unknown> => Boolean(value) && typeof value === "object" && !Array.isArray(value);++/** One image content part as the note that replaces it: what it was, so the model can say so. */+function imageNote(part: Record<string, unknown>): string {+ const mime = typeof part.mimeType === "string" ? part.mimeType : "image";+ const bytes = typeof part.data === "string" ? Math.max(1, Math.round(part.data.length * 3 / 4 / 1024)) : 0;+ return `[Image from this tool's result not shown: this model reads text only (${mime}${bytes ? `, ~${bytes} kB` : ""}).]`;+}++/** A tools/call result with every image content part replaced by a text note, in place; true when one was. A result+ * that carries no image, or no readable content array, is left exactly as the server sent it. */+export function withoutResultImages(result: unknown): boolean {+ if (!isRecord(result) || !Array.isArray(result.content)) return false;+ let replaced = false;+ result.content = (result.content as unknown[]).map((part) => {+ if (!isRecord(part) || part.type !== "image") return part;+ replaced = true;+ return { type: "text", text: imageNote(part) };+ });+ return replaced;+}++const LEARNED_MAX = 500;+const learned = new Set<string>();++/** Remembers a model that reads text only until the server restarts; the oldest entry goes first past LEARNED_MAX. */+export function learnTextOnlyTools(key: string): void {+ learned.delete(key);+ learned.add(key);+ if (learned.size > LEARNED_MAX) {+ const oldest = learned.keys().next().value;+ if (oldest !== undefined) learned.delete(oldest);+ }+}++export function learnedTextOnlyTools(key: string): boolean {+ return learned.has(key);+}++export function forgetTextOnlyTools(): void {+ learned.clear();+}diff --git a/server/routine-recovery.ts b/server/routine-recovery.tsindex 2a21399d65..3b73c7c18d 100644--- a/server/routine-recovery.ts+++ b/server/routine-recovery.ts@@ -79,7 +79,7 @@ const BUSY_CODES = new Set(["thread_busy", "thread_limit", "workspace_busy", "se* repeat it. */const NOT_RETRIED_STOPS = new Set(["cancelled", "interrupted", "refusal", "tool_error"]);/** What the provider answered for a reason a second start would meet again. */-const REFUSED_KINDS = new Set(["refused", "tool_schema", "tool_count"]);+const REFUSED_KINDS = new Set(["refused", "tool_schema", "tool_count", "image_content"]);const OWNER_CAUSES = new Set<RoutineOwnerCause>(["signed_out", "credits", "usage_limit", "setup"]);const OWNER_ACTION: Record<Exclude<RoutineOwnerCause, "setup">, string> = {diff --git a/shared/ai-ranking.ts b/shared/ai-ranking.tsindex 8172466fed..e10b61ec49 100644--- a/shared/ai-ranking.ts+++ b/shared/ai-ranking.ts@@ -14,7 +14,7 @@ export type AiTestState = "testing" | "passed" | "failed" | "untestable";/** Why a test message failed, as a word from a fixed list: never the provider's text. */export const AI_TEST_REASONS = ["signed_out", "timeout", "empty", "credits", "usage_limit", "rate_limit", "overloaded", "server", "tool_schema", "tool_count",- "model_no_route", "refused", "other",+ "image_content", "model_no_route", "refused", "other",] as const;export type AiTestReason = (typeof AI_TEST_REASONS)[number];diff --git a/src/locales/en.json b/src/locales/en.jsonindex acf2a65e26..9a589fc71e 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -10131,6 +10131,7 @@"chat.notice.acpStopFailed": "{provider} ignored Stop and its process could not be ended","chat.notice.toolCount": "{provider} refused this turn because this model takes at most {limit} tools and this bot offers more, even with its tool lists trimmed, so nothing ran. Turn off some of this bot's apps or MCP servers, or switch the bot to another model.","chat.notice.toolCountUnknown": "{provider} refused this turn because this model takes at most a limited number of tools and this bot offers more, even with its tool lists trimmed, so nothing ran. Turn off some of this bot's apps or MCP servers, or switch the bot to another model.",+ "chat.notice.imageContent": "{provider} refused this turn as an invalid request because this model reads text only and this conversation carries an image — one attached in chat or read by a tool — so every message fails the same way. Switch this bot to a model that can see images, or start a new conversation.","chat.notice.modelNoRoute": "{provider} can't use the model {model} here, so choose another model for this bot.","chat.notice.modelNoRouteUnnamed": "{provider} can't use this bot's model here, so choose another model for this bot.","chat.notice.goalRetry": "{name}'s turn did not settle ({why}) — retrying once.",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex f777b36368..9f8d5c6f83 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -10054,6 +10054,7 @@"chat.notice.acpStopFailed": "{provider} ignorou “Parar” e não foi possível encerrar seu processo","chat.notice.toolCount": "{provider} recusou esta sessão porque o limite de ferramentas deste modelo é {limit} e este bot oferece mais, mesmo com as listas reduzidas. Nada foi executado. Desligue alguns apps ou servidores MCP deste bot, ou mude para outro modelo.","chat.notice.toolCountUnknown": "{provider} recusou esta sessão porque este modelo aceita um número limitado de ferramentas e este bot oferece mais, mesmo com as listas reduzidas. Nada foi executado. Desligue alguns apps ou servidores MCP deste bot, ou mude para outro modelo.",+ "chat.notice.imageContent": "{provider} recusou esta sessão como uma solicitação inválida porque este modelo lê apenas texto e esta conversa carrega uma imagem — anexada no chat ou lida por uma ferramenta — então toda mensagem falha da mesma forma. Mude este bot para um modelo que consiga ver imagens, ou inicie uma nova conversa.","chat.notice.modelNoRoute": "{provider} não consegue usar o modelo {model} aqui, então escolha outro modelo para este bot.","chat.notice.modelNoRouteUnnamed": "{provider} não consegue usar o modelo deste bot aqui, então escolha outro modelo para este bot.","chat.notice.goalRetry": "A sessão de {name} não terminou como esperado ({why}) — tentando mais uma vez.",diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.jsonindex 9f33ec12c0..07b7fbe5f2 100644--- a/src/locales/source-hashes.json+++ b/src/locales/source-hashes.json@@ -36329,6 +36329,7 @@"chat.notice.acpStopFailed": "e4e674df550729491506c0949d0684774cb21630d142e627c4c16645685e8512","chat.notice.toolCount": "4b96e4d9dbb91b17b047e3b1bb23b96e963ca371e96f9668fe30eb7a163d3ddc","chat.notice.toolCountUnknown": "1fbf5cc3ece0d5ea003ef4e2106e915957739bceaa67788aa41ff1a44d092990",+ "chat.notice.imageContent": "8f0667df017ef1a29ede8bf2252cb73756eb103d570b6a9d807709408c150b95","chat.notice.goalRetry": "ee732f6ce39b463f1d823c5027da34a3f6220c9662f13b985f41dc7a9409d199","chat.notice.part.providerFailed": "5ac9284a16971b1c4380566435c824d3f3ef9c2824eeb5407f07053f47e97270","chat.notice.part.dispatchFailed": "8d8fbed644451e6b50fa454984a3d614a2a9fb8f7b18a5947dc1b2f29578aac4",@@ -49040,6 +49041,7 @@"chat.notice.acpStopFailed": "e4e674df550729491506c0949d0684774cb21630d142e627c4c16645685e8512","chat.notice.toolCount": "4b96e4d9dbb91b17b047e3b1bb23b96e963ca371e96f9668fe30eb7a163d3ddc","chat.notice.toolCountUnknown": "1fbf5cc3ece0d5ea003ef4e2106e915957739bceaa67788aa41ff1a44d092990",+ "chat.notice.imageContent": "8f0667df017ef1a29ede8bf2252cb73756eb103d570b6a9d807709408c150b95","chat.notice.goalRetry": "ee732f6ce39b463f1d823c5027da34a3f6220c9662f13b985f41dc7a9409d199","chat.notice.part.providerFailed": "5ac9284a16971b1c4380566435c824d3f3ef9c2824eeb5407f07053f47e97270","chat.notice.part.dispatchFailed": "8d8fbed644451e6b50fa454984a3d614a2a9fb8f7b18a5947dc1b2f29578aac4",@@ -58993,6 +58995,7 @@"chat.notice.acpStopFailed": "e4e674df550729491506c0949d0684774cb21630d142e627c4c16645685e8512","chat.notice.toolCount": "4b96e4d9dbb91b17b047e3b1bb23b96e963ca371e96f9668fe30eb7a163d3ddc","chat.notice.toolCountUnknown": "1fbf5cc3ece0d5ea003ef4e2106e915957739bceaa67788aa41ff1a44d092990",+ "chat.notice.imageContent": "8f0667df017ef1a29ede8bf2252cb73756eb103d570b6a9d807709408c150b95","chat.notice.goalRetry": "ee732f6ce39b463f1d823c5027da34a3f6220c9662f13b985f41dc7a9409d199","chat.notice.part.providerFailed": "5ac9284a16971b1c4380566435c824d3f3ef9c2824eeb5407f07053f47e97270","chat.notice.part.dispatchFailed": "8d8fbed644451e6b50fa454984a3d614a2a9fb8f7b18a5947dc1b2f29578aac4",diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.jsonindex 4c016d56d3..b54aa32ab2 100644--- a/src/locales/zh-tw.json+++ b/src/locales/zh-tw.json@@ -9055,6 +9055,7 @@"chat.notice.acpStopFailed": "{provider} 忽略了「停止」,且無法結束它的程序","chat.notice.toolCount": "{provider} 拒絕了這個回合,因為這個模型最多只能接受 {limit} 個工具,而這個機器人即使精簡了工具清單仍提供更多,所以沒有執行任何動作。請關閉這個機器人的部分應用程式或 MCP 伺服器,或把機器人切換到另一個模型。","chat.notice.toolCountUnknown": "{provider} 拒絕了這個回合,因為這個模型能接受的工具數量有限,而這個機器人即使精簡了工具清單仍提供更多,所以沒有執行任何動作。請關閉這個機器人的部分應用程式或 MCP 伺服器,或把機器人切換到另一個模型。",+ "chat.notice.imageContent": "{provider} 以無效請求為由拒絕了這個回合:這個模型只能讀取文字,而這段對話裡帶著一張圖片——聊天中附上的,或是某個工具讀入的——所以之後每則訊息都會同樣失敗。請把這個機器人切換到能看圖片的模型,或開始一段新的對話。","chat.notice.goalRetry": "{name} 的回合沒有結束({why}),正在重試一次。","chat.notice.part.providerFailed": "供應商失敗","chat.notice.part.dispatchFailed": "派送失敗",diff --git a/src/locales/zh.json b/src/locales/zh.jsonindex 2bf1576b5c..5c59171dee 100644--- a/src/locales/zh.json+++ b/src/locales/zh.json@@ -8548,6 +8548,7 @@"chat.notice.acpStopFailed": "{provider} 忽略了停止请求,而且它的进程无法结束","chat.notice.toolCount": "{provider} 拒绝了这个轮次,因为这个模型最多接受 {limit} 个工具,而这个机器人提供的更多——即使精简了工具列表也还是更多,所以什么也没运行。请关掉这个机器人的一些应用或 MCP 服务,或把机器人切换到别的模型。","chat.notice.toolCountUnknown": "{provider} 拒绝了这个轮次,因为这个模型能接受的工具数量有限,而这个机器人提供的更多——即使精简了工具列表也还是更多,所以什么也没运行。请关掉这个机器人的一些应用或 MCP 服务,或把机器人切换到别的模型。",+ "chat.notice.imageContent": "{provider} 以无效请求为由拒绝了这个轮次:这个模型只能读取文字,而这段对话里带着一张图片——聊天中附上的,或是某个工具读入的——所以之后每条消息都会同样失败。请把这个机器人切换到能看图片的模型,或开始一段新的对话。","chat.notice.goalRetry": "{name} 的轮次没有正常结束({why})——正在重试一次。","chat.notice.part.providerFailed": "模型提供方失败","chat.notice.part.dispatchFailed": "派发失败",