openclaw - ✅(Solved) Fix Image understanding tool has hardcoded 60s timeout, ignoring configured timeoutSeconds [2 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#67889Fetched 2026-04-17 08:29:03
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2referenced ×1

The image tool has a hardcoded AbortSignal.timeout(6e4) (60 seconds) in the image understanding pipeline that overrides the configured tools.media.image.timeoutSeconds value.

Root Cause

The image tool has a hardcoded AbortSignal.timeout(6e4) (60 seconds) in the image understanding pipeline that overrides the configured tools.media.image.timeoutSeconds value.

Fix Action

Workaround

Use cloud-based models for image understanding (faster inference, completes within 60s). Local models are unusable for vision through OpenClaw's image tool despite working correctly when called directly.

PR fix notes

PR #67897: Agents/image tool: honor tools.media.image.timeoutSeconds (#67889)

Description (problem / solution / changelog)

Summary

  • Problem: the agent-facing `image` tool hardcoded a 30s abort timeout for every `describeImage`/`describeImages` call, silently overriding the documented `tools.media.image.timeoutSeconds` config. Self-hosted / local vision models (Ollama, etc.) that need longer than 30s got aborted even when operators explicitly set a larger value. Separately, `minimaxUnderstandImage` used a hardcoded `AbortSignal.timeout(60_000)` regardless of caller-supplied timeouts, so the MiniMax VLM path could not pick up the operator's configured value either.
  • Why it matters: users following the public docs ("Timeout in seconds for each image understanding request before it is aborted. Increase for high-resolution analysis...") would see their configured timeout ignored by the `image` tool, reproducing #67889.
  • What changed:
    • `src/agents/tools/image-tool.ts`: resolve the effective timeout from `cfg.tools.media.image.timeoutSeconds` (falling back to `DEFAULT_TIMEOUT_SECONDS.image` = 60s, via the existing `resolveTimeoutMs` helper) and pass it to every `describeImage` / `describeImages` call instead of the hardcoded `30_000`.
    • `src/media-understanding/image.ts`: forward `params.timeoutMs` into the MiniMax branch (`describeImagesWithMinimax`).
    • `src/agents/minimax-vlm.ts`: accept an optional `timeoutMs` parameter and use it for `AbortSignal.timeout(...)` instead of the hardcoded `60_000` (falls back to 60s when not supplied, preserving existing behavior for any callers that do not plumb a timeout).
  • What did NOT change (scope boundary):
    • No config schema, default value, help text, or label changes. `tools.media.image.timeoutSeconds` already existed with a documented 60s default; this PR makes the tool honor what was already documented.
    • No public Plugin SDK surface changes.
    • No network, fs, sandbox, permission, or model-selection behavior changes.
    • The auto-attachment image-understanding path (`src/media-understanding/runner.entries.ts`) already honored this config — unchanged here.

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Skills / tool execution

Linked Issue/PR

  • Closes #67889
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: `src/agents/tools/image-tool.ts` threaded a hardcoded `timeoutMs: 30_000` into all three `describeImage`/`describeImages` call sites, completely bypassing `cfg.tools.media.image.timeoutSeconds`. Additionally, `src/agents/minimax-vlm.ts` used `AbortSignal.timeout(60_000)` regardless of caller input, so even if a caller had wanted to override the MiniMax branch's timeout it had nowhere to flow.
  • Missing detection / guardrail: no test asserted that `tools.media.image.timeoutSeconds` flowed through to the tool's underlying `describeImage`/`describeImages` calls. The existing image-tool tests covered model selection, sandbox, workspace policy, and MiniMax routing, but not timeout plumbing.
  • Contributing context: the auto-attachment path (`runner.entries.ts`) did honor the config correctly via `resolveTimeoutMs`, which hid the tool-side divergence from casual inspection.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
  • Target test or file: `src/agents/tools/image-tool.test.ts`
  • Scenario the test should lock in: the effective `timeoutMs` passed into the mocked `describeImageWithModel`/`describeImagesWithModel` (and into `AbortSignal.timeout` on the MiniMax path) matches `cfg.tools.media.image.timeoutSeconds` (with the 60s default when unset, and the 1000ms floor from `resolveTimeoutMs`).
  • Why this is the smallest reliable guardrail: captures timeout at the exact seam where the bug lived (tool → describe call site, and minimax helper → `AbortSignal.timeout`). No network, no vision model, no fake timers.

Added tests:

  • `describe("image tool timeout configuration (#67889)")` — 4 cases:
    • default (no config) → 60,000 ms (aligned with `DEFAULT_TIMEOUT_SECONDS.image`)
    • `tools.media.image.timeoutSeconds: 180` single-image → 180,000 ms
    • `tools.media.image.timeoutSeconds: 300` multi-image → 300,000 ms
    • sub-second value (`0.2`) clamps to the `resolveTimeoutMs` 1000 ms floor
  • `describe("minimaxUnderstandImage timeout plumbing (#67889)")` — 3 cases:
    • explicit `timeoutMs` → used verbatim on `AbortSignal.timeout`
    • no `timeoutMs` → 60,000 ms default
    • non-finite / non-positive `timeoutMs` → 60,000 ms default

User-visible / Behavior Changes

  • Operators who set `tools.media.image.timeoutSeconds` now see that value respected by the `image` tool (including the MiniMax VLM branch), matching the existing docs and the already-correct auto-attachment path.
  • Default timeout for the `image` tool changes from the previously-hardcoded 30s to `DEFAULT_TIMEOUT_SECONDS.image` (60s), aligning with the image-understanding default used elsewhere in the system. Admins who want a tighter cap can set `tools.media.image.timeoutSeconds` to the desired number of seconds (minimum 1s floor).

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No (same outbound calls, only the wall-clock timeout before they abort changes)
  • Command/tool execution surface changed? No (same tool surface, same fs/sandbox/workspace policy)
  • Data access scope changed? No
  • Security/runtime controls unchanged by this PR:
    • Trusted local `MEDIA:` tool-result passthrough and built-in tool name collision enforcement (unchanged).
    • Image tool sandbox, workspace, and `tools.fs.workspaceOnly` policy (unchanged — existing image-tool tests covering these still pass).
    • Remote URL blocking in sandboxed image tool (unchanged).
    • Auth / model selection / provider registry (unchanged).
    • Timeout enforcement itself remains runtime-enforced via `resolveTimeoutMs` → `setTimeout` / `AbortSignal.timeout`, never derived from prompt text; the admin-controlled config value is the source of truth.

Repro + Verification

Environment

  • OS: macOS (any); also applies to Linux/Windows
  • Runtime/container: Node 22+, `pnpm`
  • Model/provider: any vision model (issue reported with a local Ollama model; also affects MiniMax VLM)
  • Integration/channel (if any): N/A (reproduces directly through the `image` agent tool)
  • Relevant config (redacted): `tools.media.image.timeoutSeconds: <any value > 30>`, e.g. `180`

Steps

  1. Configure `tools.media.image.timeoutSeconds: 180`.
  2. Have the agent invoke the `image` tool against a model whose first-byte latency exceeds 30s (e.g. a large local vision model).

Expected

  • The request is aborted only after the configured 180s timeout.

Actual (before this PR)

  • The request is aborted after ~30s regardless of the configured value.

Evidence

  • Failing test/log before + passing after — added regression tests fail against the old hardcoded timeouts and pass against the new implementation (`pnpm test src/agents/tools/image-tool.test.ts -t "#67889"`: 7 passed).

Human Verification (required)

  • Verified scenarios:
    • `pnpm test src/agents/tools/image-tool.test.ts` — 42 passed, 0 failed.
    • `pnpm test src/media-understanding/image.test.ts` — 5 passed, 0 failed.
    • `pnpm lint` on touched files — clean (remaining lint errors are in unrelated `extensions/qa-lab/src/providers/aimock/server.ts`, pre-existing on `origin/main`).
    • `pnpm tsgo` on touched files — clean (same pre-existing `aimock` errors on `origin/main`, unrelated).
    • `pnpm format` — clean on touched files.
  • Edge cases checked:
    • Unset config → 60s default.
    • `timeoutSeconds: 0.2` → clamped to 1000ms floor by `resolveTimeoutMs`.
    • MiniMax branch with no `timeoutMs` supplied → still 60s default (existing behavior preserved for any other callers).
    • MiniMax branch with non-finite / non-positive `timeoutMs` → falls back to 60s default (hardening).
  • What I did not verify:
    • Full `pnpm test` suite (long runtime; CI covers it).
    • Full `pnpm check` (blocked by pre-existing unrelated failures on main).
    • Live end-to-end run against a real slow local vision model (the regression tests directly capture the timeout value at the seam that failed, which is the exact source of the bug).

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes — configs without `tools.media.image.timeoutSeconds` now get the documented 60s default (previously the tool silently capped at 30s).
  • Config/env changes? No
  • Migration needed? No

Risks and Mitigations

  • Risk: users who implicitly depended on the old 30s cap see image-tool calls run up to 60s by default.
    • Mitigation: the 60s default matches the already-documented capability default used everywhere else in media understanding; admins who want a stricter cap can set `tools.media.image.timeoutSeconds` explicitly (with a 1s floor).

Made with Cursor

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/agents/minimax-vlm.ts (modified, +17/-1)
  • src/agents/tools/image-tool.test.ts (modified, +176/-0)
  • src/agents/tools/image-tool.ts (modified, +21/-3)
  • src/media-understanding/image.ts (modified, +4/-0)

PR #67929: fix(image): respect configured timeout on MiniMax VLM fallback path

Description (problem / solution / changelog)

Summary

  • add optional timeoutMs to minimaxUnderstandImage
  • use configured timeout (with 60s default fallback) instead of always forcing 60s
  • pass image-tool timeout through MiniMax VLM fallback path
  • add regression test for custom timeout propagation

Why

The image understanding tool currently ignores configured tools.media.image.timeoutSeconds on the MiniMax VLM path due to a hardcoded AbortSignal.timeout(60_000).

Fixes #67889

Testing

  • ./node_modules/.bin/vitest src/agents/minimax-vlm.normalizes-api-key.test.ts src/media-understanding/image.test.ts

Changed files

  • extensions/imessage/src/monitor/inbound-processing.test.ts (modified, +27/-0)
  • src/agents/minimax-vlm.normalizes-api-key.test.ts (modified, +24/-0)
  • src/agents/minimax-vlm.ts (modified, +8/-1)
  • src/media-understanding/image.ts (modified, +4/-0)
RAW_BUFFERClick to expand / collapse

Description

The image tool has a hardcoded AbortSignal.timeout(6e4) (60 seconds) in the image understanding pipeline that overrides the configured tools.media.image.timeoutSeconds value.

Steps to Reproduce

  1. Configure a local Ollama model for image understanding (e.g., gemma4:26b-a4b-it-q4_K_M)
  2. Set tools.media.image.timeoutSeconds to 180 or 300
  3. Set tools.media.image.models with the local model and a per-model timeoutSeconds: 300
  4. Send an image via Telegram to the bot
  5. The image tool always aborts after ~60 seconds, ignoring all configured timeouts

Expected Behavior

The image tool should respect the configured tools.media.image.timeoutSeconds and per-model timeoutSeconds overrides. Local models need more time for inference (20-60s+ for image processing on consumer hardware).

Actual Behavior

The tool aborts with "This operation was aborted" after 60 seconds regardless of configuration.

Evidence

  • Direct API call to http://192.168.0.25:11434/api/chat with the same model and image completes in ~23 seconds and returns correct results
  • Open WebUI on the same Ollama server processes images with the same model without issue
  • The hardcoded timeout appears in dist/minimax-vlm-ONacdeuV.js:152 as AbortSignal.timeout(6e4)
  • The configured timeout path (timeoutMs) exists in the media understanding providers but does not override this hardcoded limit for the Ollama provider path

Workaround

Use cloud-based models for image understanding (faster inference, completes within 60s). Local models are unusable for vision through OpenClaw's image tool despite working correctly when called directly.

Environment

  • OpenClaw: 2026.4.14
  • OS: Debian 13 (trixie) aarch64
  • Hardware: Raspberry Pi 4, 4GB RAM
  • Ollama server: 192.168.0.25:11434 (separate machine)

extent analysis

TL;DR

Remove the hardcoded AbortSignal.timeout(6e4) in the image understanding pipeline to respect the configured tools.media.image.timeoutSeconds value.

Guidance

  • Identify the source code location of the hardcoded timeout (dist/minimax-vlm-ONacdeuV.js:152) and consider modifying it to use the configured timeout value.
  • Verify that the configured timeout path (timeoutMs) is correctly propagated to the Ollama provider path.
  • Test the image tool with a modified timeout value to ensure it respects the configured timeout.
  • Consider using a cloud-based model as a temporary workaround, as local models are currently unusable due to the hardcoded timeout.

Example

No code snippet is provided, as the issue implies a modification to the existing codebase.

Notes

The solution may require modifications to the OpenClaw codebase, which could introduce compatibility issues or require additional testing. The hardcoded timeout may have been introduced for a specific reason, and removing it could have unintended consequences.

Recommendation

Apply workaround: Use cloud-based models for image understanding until the hardcoded timeout can be removed or modified to respect the configured timeout value. This is because local models are currently unusable due to the hardcoded timeout, and cloud-based models can provide faster inference times within the 60-second limit.

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

openclaw - ✅(Solved) Fix Image understanding tool has hardcoded 60s timeout, ignoring configured timeoutSeconds [2 pull requests, 1 participants]