{"record":{"id":"a411d97bf3beacf4","repo":"can1357/oh-my-pi","slug":"image-submission-is-disabled-by-settings-images-b","errorCode":null,"errorMessage":"Image submission is disabled by settings (images.blockImages=true). Disable it to use inspect_image.","messagePattern":"Image submission is disabled by settings \\(images\\.blockImages=true\\)\\. Disable it to use inspect_image\\.","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"warning","filePath":"packages/coding-agent/src/tools/inspect-image.ts","lineNumber":155,"sourceCode":"\t\t},\n\t];\n\n\tconstructor(\n\t\tprivate readonly session: ToolSession,\n\t\tprivate readonly completeImageRequest: typeof completeSimple = completeSimple,\n\t) {\n\t\tthis.description = prompt.render(inspectImageDescription);\n\t}\n\n\tasync execute(\n\t\t_toolCallId: string,\n\t\tparams: InspectImageParams,\n\t\tsignal?: AbortSignal,\n\t\t_onUpdate?: AgentToolUpdateCallback<InspectImageToolDetails>,\n\t\t_context?: AgentToolContext,\n\t): Promise<AgentToolResult<InspectImageToolDetails>> {\n\t\tif (this.session.settings.get(\"images.blockImages\")) {\n\t\t\tthrow new ToolError(\n\t\t\t\t\"Image submission is disabled by settings (images.blockImages=true). Disable it to use inspect_image.\",\n\t\t\t);\n\t\t}\n\n\t\tconst modelRegistry = this.session.modelRegistry;\n\t\tif (!modelRegistry) {\n\t\t\tthrow new ToolError(\"Model registry is unavailable for inspect_image.\");\n\t\t}\n\n\t\tconst availableModels = modelRegistry.getAvailable();\n\t\tif (availableModels.length === 0) {\n\t\t\tthrow new ToolError(\"No models available for inspect_image.\");\n\t\t}\n\n\t\tconst matchPreferences = getModelMatchPreferences(this.session.settings);\n\t\tconst resolvePattern = (pattern: string | undefined): Model<Api> | undefined => {\n\t\t\tif (!pattern) return undefined;\n\t\t\tconst expanded = expandRoleAlias(pattern, this.session.settings);","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/tools/inspect-image.ts#L137-L173","documentation":"The inspect_image tool refuses to run because the user has explicitly disabled image submission via the `images.blockImages=true` setting. This is a deliberate privacy/cost guardrail: it prevents any image data from being sent to external LLM providers. The tool throws a ToolError immediately at the top of execute(), before any model resolution or file loading.","triggerScenarios":"Calling inspect_image (as the agent does when it decides to analyze an image) while session settings contain images.blockImages=true. No other inputs matter; the check precedes all other logic in execute().","commonSituations":"Users or orgs configure blockImages in opencode config to stop screenshots or sensitive images from leaving the machine; the agent then tries to inspect an image and hits this error. Also occurs after a settings file edit or a profile that enables the block.","solutions":["Set images.blockImages to false (or remove it) in your settings/config file and restart or reload the session.","If the block is intentional, avoid letting the agent use inspect_image (e.g. disable the tool or instruct it not to inspect images).","Check where the setting comes from (global config, project config, or managed policy) if you did not expect it to be enabled."],"exampleFix":"// before (config)\n{ \"images\": { \"blockImages\": true } }\n// after\n{ \"images\": { \"blockImages\": false } }","handlingStrategy":"validation","validationCode":"if (session.settings.get(\"images.blockImages\")) {\n  // skip or surface a friendly message instead of invoking inspect_image\n  return;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await inspectImageTool.execute(id, params, signal);\n} catch (e) {\n  if (e instanceof ToolError && e.message.includes(\"blockImages\")) {\n    // inform user image inspection is disabled by settings\n  } else throw e;\n}","preventionTips":["Check images.blockImages before advertising/offering the inspect_image tool to the agent.","Keep image-blocking policy in one config layer and document it for the team.","Filter the tool out of the tool registry when blockImages is enabled."],"tags":["settings","configuration","tool-disabled","privacy"],"backgroundTag":"feature-disabled-by-config","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}