openclaw - 💡(How to fix) Fix Feature: Configurable timeout for image generation models [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#71675Fetched 2026-04-26 05:09:53
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1

Fix Action

Fix / Workaround

Current Workaround

Manually patching the dist file:

-const DEFAULT_TIMEOUT_MS = 9e4;
+const DEFAULT_TIMEOUT_MS = 18e4;

Code Example

-const DEFAULT_TIMEOUT_MS = 9e4;
+const DEFAULT_TIMEOUT_MS = 18e4;
RAW_BUFFERClick to expand / collapse

Problem

The image generation provider hardcodes DEFAULT_TIMEOUT_MS = 90000 (90s) in image-generation-provider-*.js. Models like OpenAI GPT-Image-2 via OpenRouter have average E2E latency of ~127s, causing consistent timeouts and silent fallbacks to lower-quality models (e.g. minimax/image-01).

Current Workaround

Manually patching the dist file:

-const DEFAULT_TIMEOUT_MS = 9e4;
+const DEFAULT_TIMEOUT_MS = 18e4;

This is fragile — it gets overwritten on every OpenClaw update.

Proposed Solution

  1. Add a timeoutMs field to agents.defaults.imageGenerationModel in openclaw.json config
  2. Allow per-call timeoutMs override via the image_generate tool (already exists as a parameter but doesn't propagate to the OpenRouter provider layer)
  3. Consider model-specific default timeouts for known slow models

Environment

  • OpenClaw v2026.4.23
  • Provider: OpenRouter (openrouter/openai/gpt-5.4-image-2)
  • OS: macOS Sequoia (arm64)

Reproduction

  1. Set imageGenerationModel.primary to openrouter/openai/gpt-5.4-image-2
  2. Run image_generate with any prompt
  3. Observe timeout fallback after 90s to minimax/image-01
  4. Average E2E latency for this model: 127.48s (per OpenRouter docs)

extent analysis

TL;DR

Increase the DEFAULT_TIMEOUT_MS value to accommodate the average E2E latency of the OpenAI GPT-Image-2 model via OpenRouter.

Guidance

  • Consider adding a timeoutMs field to agents.defaults.imageGenerationModel in openclaw.json config to make the timeout configurable.
  • Allow per-call timeoutMs override via the image_generate tool to provide flexibility.
  • Update the DEFAULT_TIMEOUT_MS value to at least 127s (or higher) to match the average E2E latency of the OpenAI GPT-Image-2 model.
  • Test the new timeout value to ensure it resolves the consistent timeouts and silent fallbacks to lower-quality models.

Example

-const DEFAULT_TIMEOUT_MS = 9e4;
+const DEFAULT_TIMEOUT_MS = 18e4; // or a higher value, e.g., 130e3

Notes

The proposed solution involves making changes to the openclaw.json config and the image_generate tool, which may require updates to the OpenClaw codebase.

Recommendation

Apply workaround by increasing the DEFAULT_TIMEOUT_MS value to at least 127s, as this is a more straightforward solution that can be implemented immediately, while the proposed solution is being developed and tested.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING