can1357/oh-my-pi · warning · ToolError

Image submission is disabled by settings (images.blockImages

Error message

Image submission is disabled by settings (images.blockImages=true). Disable it to use inspect_image.

What it means

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.

Source

Thrown at packages/coding-agent/src/tools/inspect-image.ts:155

		},
	];

	constructor(
		private readonly session: ToolSession,
		private readonly completeImageRequest: typeof completeSimple = completeSimple,
	) {
		this.description = prompt.render(inspectImageDescription);
	}

	async execute(
		_toolCallId: string,
		params: InspectImageParams,
		signal?: AbortSignal,
		_onUpdate?: AgentToolUpdateCallback<InspectImageToolDetails>,
		_context?: AgentToolContext,
	): Promise<AgentToolResult<InspectImageToolDetails>> {
		if (this.session.settings.get("images.blockImages")) {
			throw new ToolError(
				"Image submission is disabled by settings (images.blockImages=true). Disable it to use inspect_image.",
			);
		}

		const modelRegistry = this.session.modelRegistry;
		if (!modelRegistry) {
			throw new ToolError("Model registry is unavailable for inspect_image.");
		}

		const availableModels = modelRegistry.getAvailable();
		if (availableModels.length === 0) {
			throw new ToolError("No models available for inspect_image.");
		}

		const matchPreferences = getModelMatchPreferences(this.session.settings);
		const resolvePattern = (pattern: string | undefined): Model<Api> | undefined => {
			if (!pattern) return undefined;
			const expanded = expandRoleAlias(pattern, this.session.settings);

View on GitHub (pinned to 9690622007)

Solutions

  1. Set images.blockImages to false (or remove it) in your settings/config file and restart or reload the session.
  2. If the block is intentional, avoid letting the agent use inspect_image (e.g. disable the tool or instruct it not to inspect images).
  3. Check where the setting comes from (global config, project config, or managed policy) if you did not expect it to be enabled.

Example fix

// before (config)
{ "images": { "blockImages": true } }
// after
{ "images": { "blockImages": false } }
Defensive patterns

Strategy: validation

Validate before calling

if (session.settings.get("images.blockImages")) {
  // skip or surface a friendly message instead of invoking inspect_image
  return;
}

Try / catch

try {
  await inspectImageTool.execute(id, params, signal);
} catch (e) {
  if (e instanceof ToolError && e.message.includes("blockImages")) {
    // inform user image inspection is disabled by settings
  } else throw e;
}

Prevention

When it happens

Trigger: 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().

Common situations: 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.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/a411d97bf3beacf4. Report an issue: GitHub.