can1357/oh-my-pi · error · ToolError
${formatTimeoutMessage()}
Error message
${formatTimeoutMessage()} What it means
The one-shot vision LLM request aborted with AbortError/TimeoutError and the tool's own timeout signal (inspect_image.timeoutMs) was the cause, so it converts the abort into a descriptive ToolError stating the elapsed time and how to raise or disable the timeout. If the caller's signal aborted instead, the original error is rethrown.
Source
Thrown at packages/coding-agent/src/tools/inspect-image.ts:311
role: "user",
content: [
{ type: "image", data: imageInput.data, mimeType: imageInput.mimeType },
{ type: "text", text: params.question },
],
timestamp: Date.now(),
},
],
},
{
apiKey: modelRegistry.resolver(model, this.session.getSessionId?.() ?? undefined),
signal: effectiveSignal,
reasoning,
},
{ telemetry, oneshotKind: "inspect_image", completeImpl: this.completeImageRequest },
);
} catch (error) {
if (error instanceof Error && (error.name === "AbortError" || error.name === "TimeoutError")) {
if (timedOut()) throw new ToolError(formatTimeoutMessage());
}
throw error;
}
if (response.stopReason === "error") {
throw new ToolError(response.errorMessage ?? "inspect_image request failed.");
}
if (response.stopReason === "aborted") {
if (timedOut()) throw new ToolError(formatTimeoutMessage());
throw new ToolError("inspect_image request aborted.");
}
const text = extractTextContent(response);
if (!text) {
throw new ToolError("inspect_image model returned no text output.");
}
return {View on GitHub (pinned to 9690622007)
Solutions
- Increase inspect_image.timeoutMs in settings (e.g. 60000 or more).
- Set inspect_image.timeoutMs to 0 to disable the timeout entirely.
- Check provider status/latency or switch to a faster vision model via modelRoles.vision.
- Reduce image size to cut upload and inference time.
Example fix
// before
{ "inspect_image": { "timeoutMs": 5000 } }
// after
{ "inspect_image": { "timeoutMs": 120000 } } Defensive patterns
Strategy: retry
Validate before calling
const timeoutMs = session.settings.get("inspect_image.timeoutMs");
if (typeof timeoutMs === "number" && timeoutMs > 0 && timeoutMs < 30000) {
// vision calls commonly need 30s+: raise timeoutMs or set 0 to disable
} Try / catch
try {
await inspectImageTool.execute(id, params, signal);
} catch (e) {
if (e instanceof ToolError && e.message.includes("timed out")) {
// increase inspect_image.timeoutMs and retry, or check provider latency
} else throw e;
} Prevention
- Set inspect_image.timeoutMs generously (60s+) for vision workloads; 0 disables.
- Keep images small to reduce upload and inference latency.
- Avoid slow/rate-limited providers for the vision role.
When it happens
Trigger: Vision request exceeded inspect_image.timeoutMs (settings) — slow provider, very large image, reasoning-heavy vision model, or a very low timeoutMs value; also network stalls pushing latency past the limit.
Common situations: timeoutMs set to a small value like 5000 while the vision model takes 20-60s; slow rate-limited provider; huge downscaled image increasing upload+inference time; thinking-enabled vision models adding latency.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- timed out: {command}
- AnthropicConnectionTimeoutError
- xAI device-code request failed: ${error instanceof Error ? e
- xAI device-code token polling failed: ${error instanceof Err
- options.firstItemErrorMessage ?? options.errorMessage
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/402d5faa3f697776.
Report an issue: GitHub.