openclaw - 💡(How to fix) Fix active-memory plugin overrides before_prompt_build hook timeout to 45s, wedges main lane [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#75843Fetched 2026-05-02 05:29:11
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
4
Timeline (top)
commented ×1

The active-memory plugin registers before_prompt_build with { timeoutMs: config.timeoutMs + setupGraceTimeoutMs }, where setupGraceTimeoutMs defaults to 30000. With the typical config.timeoutMs: 15000, this caps the hook at 45s instead of the gateway default 15s — so when the embedded recall sub-agent's prep stages exceed the 15s budget, the hook blocks the main command lane for a full 45s.

Error Message

  • [diagnostic] lane task error: lane=main durationMs=45xxx error="CommandLaneTaskTimeoutError: Command lane \"main\" task timed out after 45000ms"

Root Cause

  • dist/extensions/active-memory/index.js line 31: const DEFAULT_SETUP_GRACE_TIMEOUT_MS = 3e4
  • Used at line 1463: const beforePromptBuildTimeoutMs = config.timeoutMs + setupGraceTimeoutMs (passed as the hook registration's timeoutMs)
  • And at line 1262 inside maybeResolveActiveRecall: watchdogTimeoutMs = config.timeoutMs + setupGraceTimeoutMs

The plugin's hook returns undefined cleanly on timeout (catch at line 1545), so the only thing keeping the lane held is the inflated cap.

Fix Action

Fix / Workaround

Workaround applied locally

One-line patch on the installed dist/extensions/active-memory/index.js:

-const DEFAULT_SETUP_GRACE_TIMEOUT_MS = 3e4;
+const DEFAULT_SETUP_GRACE_TIMEOUT_MS = 0;

Wiped on next package upgrade — hence this issue.

Code Example

-const DEFAULT_SETUP_GRACE_TIMEOUT_MS = 3e4;
+const DEFAULT_SETUP_GRACE_TIMEOUT_MS = 0;
RAW_BUFFERClick to expand / collapse

Summary

The active-memory plugin registers before_prompt_build with { timeoutMs: config.timeoutMs + setupGraceTimeoutMs }, where setupGraceTimeoutMs defaults to 30000. With the typical config.timeoutMs: 15000, this caps the hook at 45s instead of the gateway default 15s — so when the embedded recall sub-agent's prep stages exceed the 15s budget, the hook blocks the main command lane for a full 45s.

Reproduction

  • extensions.active-memory.config.timeoutMs: 15000 (default)
  • Any prompt where the recall sub-agent's prep stages (model-resolution, auth, bootstrap-context, system-prompt, session-resource-loader, stream-setup) exceed 15s — observed ~24–25s in our gateway.

Symptoms

  • [plugins] [hooks] before_prompt_build handler from active-memory failed: timed out after 45000ms
  • [diagnostic] lane task error: lane=main durationMs=45xxx error="CommandLaneTaskTimeoutError: Command lane \"main\" task timed out after 45000ms"
  • eventLoopUtilization=1, p99 7s–42s
  • New WS handshakes drop as closed before connect while the lane is wedged.

Root cause

  • dist/extensions/active-memory/index.js line 31: const DEFAULT_SETUP_GRACE_TIMEOUT_MS = 3e4
  • Used at line 1463: const beforePromptBuildTimeoutMs = config.timeoutMs + setupGraceTimeoutMs (passed as the hook registration's timeoutMs)
  • And at line 1262 inside maybeResolveActiveRecall: watchdogTimeoutMs = config.timeoutMs + setupGraceTimeoutMs

The plugin's hook returns undefined cleanly on timeout (catch at line 1545), so the only thing keeping the lane held is the inflated cap.

Proposed fix

Change DEFAULT_SETUP_GRACE_TIMEOUT_MS to 0 (or document/expose it as config). The 30s grace defeats the configured timeoutMs budget without operator visibility.

Workaround applied locally

One-line patch on the installed dist/extensions/active-memory/index.js:

-const DEFAULT_SETUP_GRACE_TIMEOUT_MS = 3e4;
+const DEFAULT_SETUP_GRACE_TIMEOUT_MS = 0;

Wiped on next package upgrade — hence this issue.

Environment

  • openclaw 2026.4.29
  • macOS 26.4.1 arm64, node 25.9.0

extent analysis

TL;DR

Change the DEFAULT_SETUP_GRACE_TIMEOUT_MS to 0 to prevent the inflated timeout from blocking the main command lane.

Guidance

  • Review the active-memory plugin configuration to understand the impact of the setupGraceTimeoutMs on the before_prompt_build hook timeout.
  • Verify that the recall sub-agent's prep stages are exceeding the 15s budget by checking the duration of these stages in the gateway logs.
  • Consider exposing the DEFAULT_SETUP_GRACE_TIMEOUT_MS as a configurable option to provide operator visibility and control over the timeout budget.
  • Test the proposed fix by applying the one-line patch to the dist/extensions/active-memory/index.js file and monitoring the gateway's behavior.

Example

-const DEFAULT_SETUP_GRACE_TIMEOUT_MS = 3e4;
+const DEFAULT_SETUP_GRACE_TIMEOUT_MS = 0;

This code snippet illustrates the proposed fix, which changes the default setup grace timeout to 0.

Notes

The proposed fix may have unintended consequences on the plugin's behavior, and further testing is necessary to ensure that it does not introduce new issues. Additionally, this fix may be wiped out on the next package upgrade, so a more permanent solution should be explored.

Recommendation

Apply the workaround by changing the DEFAULT_SETUP_GRACE_TIMEOUT_MS to 0, as it provides a temporary solution to the issue and allows for further testing and evaluation of the plugin's behavior.

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 - 💡(How to fix) Fix active-memory plugin overrides before_prompt_build hook timeout to 45s, wedges main lane [1 comments, 2 participants]