can1357/oh-my-pi · error · ToolError
No models available for inspect_image.
Error message
No models available for inspect_image.
What it means
The model registry exists but `getAvailable()` returned an empty list, so inspect_image has no candidate models to resolve a vision model from. The tool throws ToolError because image inspection fundamentally requires at least one LLM model to be configured and reachable.
Source
Thrown at packages/coding-agent/src/tools/inspect-image.ts:167
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);
return resolveModelFromString(expanded, availableModels, matchPreferences);
};
const activeModelPattern = this.session.getActiveModelString?.() ?? this.session.getModelString?.();
let model: Model<Api> | undefined;
let selectedPattern: string | undefined;
for (const pattern of ["@vision", "@default", activeModelPattern]) {
const resolved = resolvePattern(pattern);
if (resolved?.input.includes("image")) {
model = resolved;
selectedPattern = pattern;
break;View on GitHub (pinned to 9690622007)
Solutions
- Configure at least one provider's API key (env var like OPENAI_API_KEY/ANTHROPIC_API_KEY or the auth config).
- Run `omp` models/auth setup to verify the registry lists models.
- Check network access if provider discovery is failing.
- Verify provider configuration files aren't empty or mispointed.
Example fix
// before: no credentials // (env) // after export ANTHROPIC_API_KEY=sk-ant-... # or add the key via the provider auth setup
Defensive patterns
Strategy: validation
Validate before calling
const models = session.modelRegistry?.getAvailable() ?? [];
if (models.length === 0) {
// prompt the user to configure a provider/API key before attempting image inspection
} Try / catch
try {
await inspectImageTool.execute(id, params, signal);
} catch (e) {
if (e instanceof ToolError && e.message.includes("No models available")) {
// run provider setup / show onboarding message
} else throw e;
} Prevention
- Configure at least one provider API key before using agent tools.
- Validate on startup that the registry lists models (log a warning when empty).
- In CI, ensure credentials are injected into the environment.
When it happens
Trigger: Calling inspect_image when no providers are authenticated/discovered: no API keys configured, all providers failed auth or discovery, or a filtered model list resolved to zero entries.
Common situations: Fresh install with no API keys in env/config; expired or revoked credentials causing discovery to yield nothing; running in an environment without provider configuration (CI, containers); models.json/provider discovery failing offline.
Related errors
- ${providerLabel} login requires onPrompt callback
- Gemini Files API credential is required
- An OpenAI API credential is required for file uploads
- No API key for ${model.provider}/${model.id}
- No models available in the bundled catalog
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/3dc39877a25ce9af.
Report an issue: GitHub.