can1357/oh-my-pi · error · AggregateError
Image generation failed for all credentialed providers: ${fa
Error message
Image generation failed for all credentialed providers: ${failures.map(failure => failure.provider).join(", ")} What it means
Final fallback after the tool attempted every credentialed image provider and each attempt failed. An AggregateError is thrown whose errors array holds each provider's underlying exception, with a message listing the providers that were tried. The individual causes must be inspected to know why each provider failed.
Source
Thrown at packages/coding-agent/src/tools/image-gen.ts:1766
}
if (!foundCredentials) {
throw new Error(
"No image API credentials found. Connect a Codex (ChatGPT) subscription, use a GPT Responses/Codex model with OpenAI credentials, log in with google-antigravity or xAI Grok OAuth, or set OPENAI_API_KEY, XAI_API_KEY, OPENROUTER_API_KEY, GEMINI_API_KEY, GOOGLE_API_KEY, or DEEPINFRA_API_KEY.",
);
}
if (failures.length === 0 && unsupportedAspectRatioProvider) {
assertImageAspectRatioSupported(unsupportedAspectRatioProvider, params.aspect_ratio);
}
if (failures.length === 0 && editUnsupportedProvider) {
throw new Error(
`${editUnsupportedProvider} image generation is text-to-image only and cannot edit input images. Configure an edit-capable provider (openai, openai-codex, antigravity, xai, openrouter, gemini) or retry without input images.`,
);
}
throw new AggregateError(
failures.map(failure => failure.error),
`Image generation failed for all credentialed providers: ${failures.map(failure => failure.provider).join(", ")}`,
);
});
},
};
export async function getImageGenTools(
_modelRegistry?: ModelRegistry,
_activeModel?: Model,
): Promise<Array<CustomTool<typeof imageGenSchema, ImageGenToolDetails>>> {
return [imageGenTool];
}
export async function getImageGenToolsWithRegistry(
_modelRegistry: ModelRegistry,
_activeModel?: Model,
): Promise<Array<CustomTool<typeof imageGenSchema, ImageGenToolDetails>>> {View on GitHub (pinned to 9690622007)
Solutions
- Inspect aggregate.errors — each element corresponds to a provider listed in the message and carries its HTTP status/detail.
- Fix the underlying per-provider causes (keys, quotas, model ids) identified in the nested errors.
- Retry after backoff if the nested errors are 429/5xx (transient).
- Configure one healthy provider with a funded account and a known-good image model.
- Reduce request complexity (size, count) if providers reject the parameters.
Defensive patterns
Strategy: try-catch
Validate before calling
const credentialed = providers.filter(p => hasCredential(p));
if (credentialed.length === 0) failFast('no image credentials');
if (credentialed.every(p => !p.healthy)) warn('all credentialed image providers recently failing'); Try / catch
try {
return await imageGen(params);
} catch (err) {
if (err instanceof AggregateError) {
for (const cause of err.errors) logProviderCause(cause); // per-provider status/detail
if (err.errors.every(isTransient)) return retryWithBackoff(() => imageGen(params));
}
throw err;
} Prevention
- Always inspect AggregateError.errors — the summary line only lists provider names
- Maintain at least one provider with a funded, verified account
- Classify nested errors (429/5xx = transient, 401/402 = config) before retrying
- Monitor provider status pages for correlated outages
When it happens
Trigger: All credentialed providers attempted and rejected — e.g. OpenAI 401 + Gemini 429 + OpenRouter 402 in one run — reaching image-gen.ts:1766; only possible when at least one credential existed (otherwise 2515 fires).
Common situations: Multiple keys expired or revoked at once; shared egress IP rate-limited across providers; transient multi-provider outage; all keys lacking image-model access; free-tier quotas exhausted everywhere.
Related errors
- OpenRouter image request failed (${resp.status}): ${message}
- Gemini image request failed (${resp.status}): ${message}
- inspect_image request failed.
- parallel: err.message (dynamic; thrown as SearchProviderErro
- timed out: {command}
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/1cb762348058b403.
Report an issue: GitHub.