openclaw - ✅(Solved) Fix [Bug]: Embedded Agent timeout is hardcoded at 15 seconds and cannot be configured [1 pull requests, 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#49015Fetched 2026-04-08 00:49:43
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1cross-referenced ×1subscribed ×1

Embedded Agent timeout is hardcoded at 15 seconds (15000ms) in the source code and cannot be adjusted via openclaw.json config. This causes issues when using slow providers like MiniMax API.

Error Message

Error log: 16:22:06 [agent/embedded] embedded run timeout: runId=slug-gen-1773735707027 sessionId=slug-generator-1773735707027 timeoutMs=15000 16:22:06 [agent/embedded] Profile minimax-portal:default timed out. Trying next account... 16:22:06 [agent/embedded] embedded run failover decision: runId=slug-gen-1773735707027 stage=assistant decision=fallback_model reason=timeout provider=minimax-portal/MiniMax-M2.5 profile=sha256:9e08bd6be9c1 16:22:06 [diagnostic] lane task error: lane=main durationMs=19423 error="FailoverError: LLM request timed out."

Root cause (found in source code):

  • File: model-selection-CU2b7bN6.js
  • Line 108206: function waitForEmbeddedPiRunEnd(sessionId, timeoutMs = 15e3)
  • Line 117660: await waitForEmbeddedPiRunEnd(sessionId, 15e3);

Root Cause

Root cause (found in source code):

  • File: model-selection-CU2b7bN6.js
  • Line 108206: function waitForEmbeddedPiRunEnd(sessionId, timeoutMs = 15e3)
  • Line 117660: await waitForEmbeddedPiRunEnd(sessionId, 15e3);

Fix Action

Fixed

PR fix notes

PR #51131: feat(session-memory): make slug generation timeout configurable

Description (problem / solution / changelog)

Summary

  • Add optional timeoutMs parameter to generateSlugViaLLM() so callers can override the default 15 s timeout
  • Read slugTimeoutMs from the session-memory hook config and pass it through
  • Default behavior is unchanged (15 000 ms) when slugTimeoutMs is not set

Motivation

Slow providers (e.g. cursor-api-proxy) regularly exceed the hardcoded 15 s limit, logging "LLM request timed out" and falling back to a timestamp slug. Users can now raise the timeout without patching core code.

Config example

"session-memory": {
  "enabled": true,
  "slugTimeoutMs": 60000
}

Test plan

  • pnpm test -- src/hooks — 165 tests pass
  • pnpm tsgo — no type errors in touched files

Changed files

  • src/hooks/bundled/session-memory/handler.ts (modified, +5/-1)
  • src/hooks/llm-slug-generator.ts (modified, +2/-1)

Code Example

Error log:
16:22:06 [agent/embedded] embedded run timeout: runId=slug-gen-1773735707027 sessionId=slug-generator-1773735707027 timeoutMs=15000
16:22:06 [agent/embedded] Profile minimax-portal:default timed out. Trying next account...
16:22:06 [agent/embedded] embedded run failover decision: runId=slug-gen-1773735707027 stage=assistant decision=fallback_model reason=timeout provider=minimax-portal/MiniMax-M2.5 profile=sha256:9e08bd6be9c1
16:22:06 [diagnostic] lane task error: lane=main durationMs=19423 error="FailoverError: LLM request timed out."

Root cause (found in source code):
- File: model-selection-CU2b7bN6.js
- Line 108206: function waitForEmbeddedPiRunEnd(sessionId, timeoutMs = 15e3)
- Line 117660: await waitForEmbeddedPiRunEnd(sessionId, 15e3);
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

Embedded Agent timeout is hardcoded at 15 seconds (15000ms) in the source code and cannot be adjusted via openclaw.json config. This causes issues when using slow providers like MiniMax API.

Steps to reproduce

  1. Configure OpenClaw with minimax-portal as the provider
  2. Use embedded agent (sub-agent) for a task
  3. If the task takes longer than 15 seconds, it will timeout

Expected behavior

The embedded agent should have a configurable timeout (e.g., via agents.defaults.embeddedTimeoutMs in openclaw.json)

Actual behavior

The embedded agent times out after 15 seconds. Error log shows: "embedded run timeout: timeoutMs=15000". The timeout value is hardcoded in model-selection-CU2b7bN6.js at lines 108206 and 117660.

OpenClaw version

2026.3.x (npm global install)

Operating system

Windows 11

Install method

No response

Model

minimax-portal/MiniMax-M2.5

Provider / routing chain

openclaw -> minimax-portal

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Error log:
16:22:06 [agent/embedded] embedded run timeout: runId=slug-gen-1773735707027 sessionId=slug-generator-1773735707027 timeoutMs=15000
16:22:06 [agent/embedded] Profile minimax-portal:default timed out. Trying next account...
16:22:06 [agent/embedded] embedded run failover decision: runId=slug-gen-1773735707027 stage=assistant decision=fallback_model reason=timeout provider=minimax-portal/MiniMax-M2.5 profile=sha256:9e08bd6be9c1
16:22:06 [diagnostic] lane task error: lane=main durationMs=19423 error="FailoverError: LLM request timed out."

Root cause (found in source code):
- File: model-selection-CU2b7bN6.js
- Line 108206: function waitForEmbeddedPiRunEnd(sessionId, timeoutMs = 15e3)
- Line 117660: await waitForEmbeddedPiRunEnd(sessionId, 15e3);

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To fix the hardcoded timeout issue, we need to make the embedded agent timeout configurable via the openclaw.json file.

Here are the steps:

  • Update the model-selection-CU2b7bN6.js file to accept the timeout value from the configuration.
  • Add a new configuration option agents.defaults.embeddedTimeoutMs in the openclaw.json file.

Code Changes

// model-selection-CU2b7bN6.js
function waitForEmbeddedPiRunEnd(sessionId, timeoutMs) {
  // Use the timeoutMs from the config if provided
  if (!timeoutMs) {
    timeoutMs = getConfig('agents.defaults.embeddedTimeoutMs');
  }
  // ... rest of the function remains the same
}

// In another part of the code where waitForEmbeddedPiRunEnd is called
await waitForEmbeddedPiRunEnd(sessionId);
// openclaw.json
{
  "agents": {
    "defaults": {
      "embeddedTimeoutMs": 30000 // example timeout of 30 seconds
    }
  }
}

Verification

To verify the fix, you can:

  • Update the openclaw.json file with a new timeout value.
  • Run a task that takes longer than the previous timeout (15 seconds).
  • Check the logs to ensure that the task does not timeout after the new timeout value.

Extra Tips

  • Make sure to update the openclaw.json file correctly and restart the service after making changes.
  • You can also add error handling to ensure that the timeout value is a positive integer.

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 embedded agent should have a configurable timeout (e.g., via agents.defaults.embeddedTimeoutMs in openclaw.json)

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 [Bug]: Embedded Agent timeout is hardcoded at 15 seconds and cannot be configured [1 pull requests, 1 comments, 2 participants]