openclaw - ✅(Solved) Fix [Bug]: image tool uses hardcoded 30s timeout, ignores tools.media.models.timeoutSeconds config [5 pull requests, 1 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#62944Fetched 2026-04-09 08:00:23
View on GitHub
Comments
0
Participants
1
Timeline
14
Reactions
0
Participants
Timeline (top)
referenced ×7cross-referenced ×5labeled ×2

Error Message

{ "status": "error", "tool": "image", "error": "Image model failed (lmstudio/qwen3.5-122b-a10b): Request was aborted." }

Root Cause

Root cause (identified)

In src/agents/tools/image-tool.ts, runImagePrompt() passes timeoutMs: 30_000 hardcoded to describeImage / describeImages, without reading cfg?.tools?.media?.models?.timeoutSeconds.

Fix Action

Fixed

PR fix notes

PR #2: fix(agents): honor image tool timeoutSeconds

Description (problem / solution / changelog)

Summary

  • Fix the image tool always using a hardcoded 30s timeout by honoring tools.media.image.timeoutSeconds.
  • Keep backward compatibility by defaulting to 30s when unset.
  • Add a unit test to assert the configured timeout is forwarded as timeoutMs.

Linked Issue/PR

Fixes #62944

Tests

  • pnpm test src/agents/tools/image-tool.test.ts

Notes

  • The repo config contract uses tools.media.image.timeoutSeconds (not tools.media.models.timeoutSeconds).

Made with Cursor

Changed files

  • src/agents/tools/image-tool.test.ts (modified, +48/-0)
  • src/agents/tools/image-tool.ts (modified, +9/-3)

PR #62979: fix(agents): honor image tool timeoutSeconds #62944

Description (problem / solution / changelog)

Summary

  • Problem: The image tool always used a hardcoded 30s timeout, ignoring config.
  • Why it matters: Slow/self-hosted vision models can be aborted prematurely even when users configure longer timeouts.
  • What changed: The image tool now reads tools.media.image.timeoutSeconds (seconds) and forwards it as timeoutMs, defaulting to 30s when unset.
  • What did NOT change (scope boundary): No changes to provider selection/fallback logic; only timeout wiring for image tool requests.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Fixes #62944

User-visible / Behavior Changes

  • The image tool now honors tools.media.image.timeoutSeconds. If unset, it falls back to 30 seconds (backward compatible).

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Relevant config (redacted)

tools:
  media:
    image:
      timeoutSeconds: 120

Tests

  • pnpm test src/agents/tools/image-tool.test.ts

Implementation Notes

  • Code changes:
    • src/agents/tools/image-tool.ts
    • src/agents/tools/image-tool.test.ts
  • Note: The repo config contract is tools.media.image.timeoutSeconds (not tools.media.models.timeoutSeconds).

Changed files

  • src/agents/tools/image-tool.test.ts (modified, +146/-0)
  • src/agents/tools/image-tool.ts (modified, +9/-3)

PR #63046: fix: image tool respects tools.media.image.timeoutSeconds config

Description (problem / solution / changelog)

Summary

Fixes #62944.

Problem

The image tool's runImagePrompt() had timeoutMs hardcoded to 30_000 in three places, ignoring the user-configured tools.media.image.timeoutSeconds value. This caused slow image models to always abort after 30 seconds regardless of config.

Solution

Read the config via resolveTimeoutMs() (already used elsewhere in the media-understanding pipeline) and fall back to 30s when unset.

Changes

  • src/agents/tools/image-tool.ts: Import resolveTimeoutMs, compute timeoutMs from effectiveCfg?.tools?.media?.image?.timeoutSeconds with 30s default, replace all three hardcoded 30_000 values.

Testing

  • Existing tests pass (35/35)
  • Uses the same resolveTimeoutMs utility already validated in the media-understanding pipeline

<sub>🔧 Generated by issue-to-pr</sub>

Changed files

  • src/agents/tools/image-tool.ts (modified, +10/-3)

PR #63091: fix(image-tool): read timeoutSeconds from config instead of hardcoded 30s

Description (problem / solution / changelog)

Summary

runImagePrompt() passes a hardcoded timeoutMs: 30_000 to all three describeImage / describeImages call sites. The tools.media.image.timeoutSeconds config field has no effect on the image tool, even though the rest of the media-understanding pipeline (runner.entries.ts) already reads it via resolveTimeoutMs().

Users with slower self-hosted models (LMStudio, Ollama, vLLM on modest hardware) see every image request abort at exactly 30s regardless of their configured timeout.

Before

tools:
  media:
    image:
      timeoutSeconds: 120   # <-- ignored

→ image tool always aborts after 30s
→ "Image model failed: Request was aborted."

After

tools:
  media:
    image:
      timeoutSeconds: 120   # <-- respected

→ image tool waits up to 120s
→ default without config: 60s (matches DEFAULT_TIMEOUT_SECONDS.image)

What changed

  • src/agents/tools/image-tool.ts — replaced three hardcoded timeoutMs: 30_000 with a single resolveTimeoutMs(cfg?.tools?.media?.image?.timeoutSeconds, DEFAULT_TIMEOUT_SECONDS.image) call, reusing the same helpers the media-understanding runner already uses.
  • src/agents/tools/image-tool.test.ts — two new tests: one verifying a configured 120s timeout is forwarded as 120 000 ms, one verifying the unconfigured default is 60 000 ms.

The unconfigured default also changes from 30s → 60s, aligning with DEFAULT_TIMEOUT_SECONDS.image which audio/video tools already use.

Closes #62944

Changed files

  • src/agents/tools/image-tool.test.ts (modified, +101/-0)
  • src/agents/tools/image-tool.ts (modified, +9/-3)

PR #63483: fix(agents): honor image tool timeoutSeconds #62944

Description (problem / solution / changelog)

Summary

  • Problem: The image tool always used a hardcoded 30s timeout, ignoring config.
  • Why it matters: Slow/self-hosted vision models can be aborted prematurely even when users configure longer timeouts.
  • What changed: The image tool now reads tools.media.image.timeoutSeconds (seconds) and forwards it as timeoutMs, defaulting to 30s when unset.
  • What did NOT change (scope boundary): No changes to provider selection/fallback logic; only timeout wiring for image tool requests.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Fixes #62944

User-visible / Behavior Changes

  • The image tool now honors tools.media.image.timeoutSeconds. If unset, it falls back to 30 seconds (backward compatible).

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Relevant config (redacted)

tools:
  media:
    image:
      timeoutSeconds: 120

Tests

  • pnpm test src/agents/tools/image-tool.test.ts

Implementation Notes

  • Code changes:
    • src/agents/tools/image-tool.ts
    • src/agents/tools/image-tool.test.ts
  • Note: The repo config contract is tools.media.image.timeoutSeconds (not tools.media.models.timeoutSeconds).

Changed files

  • src/agents/tools/image-tool.test.ts (modified, +146/-0)
  • src/agents/tools/image-tool.ts (modified, +9/-3)

Code Example

tools:
     media:
       models:
         timeoutSeconds: 120

---

{
  "status": "error",
  "tool": "image",
  "error": "Image model failed (lmstudio/qwen3.5-122b-a10b): Request was aborted."
}

---

tools:
  media:
    models:
      timeoutSeconds: 120

---

{
  "status": "error",
  "tool": "image",
  "error": "Image model failed (custom-100-82-31-68-1234/qwen3.5-122b-a10b): Request was aborted."
}

---
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Environment

  • OS: Ubuntu 24.04
  • OpenClaw version: 20260407
  • Image model: lmstudio/qwen3.5-122b-a10b

Describe the bug

When using the image tool with a slow image model, the request is always aborted after 30 seconds regardless of the tools.media.models.timeoutSeconds config value.

The timeoutMs in src/agents/tools/image-tool.ts is hardcoded to 30_000 and never reads from the config.

Error message

{ "status": "error", "tool": "image", "error": "Image model failed (lmstudio/qwen3.5-122b-a10b): Request was aborted." }

Expected behavior

tools.media.models.timeoutSeconds in the config file should control the timeout used by the image tool, with 30s as the default fallback.

Suggested fix

In runImagePrompt(), read cfg?.tools?.media?.models?.timeoutSeconds, convert to ms, and pass it to describeImage / describeImages calls instead of the hardcoded 30_000.

Steps to reproduce

Steps to reproduce

  1. Configure a custom image model in your config file:

    tools:
      media:
        models:
          timeoutSeconds: 120
  2. Use an image model that takes more than 30 seconds to respond (e.g., lmstudio/qwen3.5-122b-a10b` on a self-hosted endpoint)

  3. Trigger the image tool from an agent (e.g., ask the agent to describe an image)

  4. Wait ~30 seconds

Actual result

The request is aborted after exactly 30 seconds with:

{
  "status": "error",
  "tool": "image",
  "error": "Image model failed (lmstudio/qwen3.5-122b-a10b): Request was aborted."
}

Expected result

The request should wait up to 120 seconds as configured in timeoutSeconds, not be cut off at the hardcoded 30s limit.

Root cause (identified)

In src/agents/tools/image-tool.ts, runImagePrompt() passes timeoutMs: 30_000 hardcoded to describeImage / describeImages, without reading cfg?.tools?.media?.models?.timeoutSeconds.

Expected behavior

Expected behavior

The image tool should respect the tools.media.models.timeoutSeconds value set in the config file and use it as the request timeout, instead of always aborting after a hardcoded 30 seconds.

For example, with the following config:

tools:
  media:
    models:
      timeoutSeconds: 120

The image model request should be allowed up to 120 seconds before timing out.

If timeoutSeconds is not set, the current default of 30 seconds should be kept as a fallback to preserve backward compatibility.

Actual behavior

Actual behavior

Regardless of the tools.media.models.timeoutSeconds config value, the image tool always aborts the request after exactly 30 seconds and returns the following error:

{
  "status": "error",
  "tool": "image",
  "error": "Image model failed (custom-100-82-31-68-1234/qwen3.5-122b-a10b): Request was aborted."
}

This is because timeoutMs is hardcoded to 30_000 in runImagePrompt() inside src/agents/tools/image-tool.ts, and the value of cfg?.tools?.media?.models?.timeoutSeconds is never read.

OpenClaw version

2026.4.7

Operating system

Ubuntu24.04

Install method

No response

Model

qwen3.5-122b-a10b

Provider / routing chain

openclaw->lmstudio

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can be fixed by modifying the runImagePrompt() function in src/agents/tools/image-tool.ts to read the timeoutSeconds value from the config and use it to set the timeoutMs instead of the hardcoded 30 seconds.

Guidance

  • Identify the runImagePrompt() function in src/agents/tools/image-tool.ts and locate the hardcoded timeoutMs value.
  • Modify the function to read the cfg?.tools?.media?.models?.timeoutSeconds value from the config and convert it to milliseconds.
  • Use the converted value to set the timeoutMs for the describeImage and describeImages calls.
  • Verify that the timeoutSeconds value is correctly read from the config and used to set the request timeout.

Example

const timeoutMs = (cfg?.tools?.media?.models?.timeoutSeconds || 30) * 1000;
// Use timeoutMs to set the request timeout for describeImage and describeImages calls

Notes

The fix assumes that the cfg?.tools?.media?.models?.timeoutSeconds value is correctly set in the config file and that the runImagePrompt() function is the only place where the timeoutMs value is hardcoded.

Recommendation

Apply the workaround by modifying the runImagePrompt() function to read the timeoutSeconds value from the config and use it to set the timeoutMs. This will allow the image tool to respect the configured timeout value instead of always aborting after 30 seconds.

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…

FAQ

Expected behavior

The image tool should respect the tools.media.models.timeoutSeconds value set in the config file and use it as the request timeout, instead of always aborting after a hardcoded 30 seconds.

For example, with the following config:

tools:
  media:
    models:
      timeoutSeconds: 120

The image model request should be allowed up to 120 seconds before timing out.

If timeoutSeconds is not set, the current default of 30 seconds should be kept as a fallback to preserve backward compatibility.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING