openclaw - 💡(How to fix) Fix Feature: expose before_prompt_build modifying-hook timeout as config [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#74908Fetched 2026-05-01 05:40:04
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Author
Timeline (top)
closed ×1commented ×1

Expose the outer plugin hook-runner timeout for modifying hooks (especially before_prompt_build) as configuration instead of keeping it hardcoded at 15s.

Root Cause

Active Memory is useful in direct chat, but model latency varies. A hardcoded outer 15s cap forces users to choose only models that reliably finish under 15s, even if they are willing to trade a slightly longer foreground budget for better recall quality. Making the cap configurable avoids local code patches and makes the behavior explicit.

Fix Action

Fix / Workaround

Exact schema is not important; the important part is that operators can tune the outer hook cap without patching OpenClaw's bundled JS.

Active Memory is useful in direct chat, but model latency varies. A hardcoded outer 15s cap forces users to choose only models that reliably finish under 15s, even if they are willing to trade a slightly longer foreground budget for better recall quality. Making the cap configurable avoids local code patches and makes the behavior explicit.

Code Example

active-memory ... activeModel=qwen3.6-active-memory:latest done status=ok elapsedMs=9967 summaryChars=114
active-memory ... activeModel=qwen3.6-active-memory:latest done status=ok elapsedMs=10449 summaryChars=115
active-memory ... activeModel=qwen3.6-active-memory:latest done status=timeout elapsedMs=15189 summaryChars=0
active-memory ... activeModel=qwen3.6-active-memory:latest done status=timeout elapsedMs=15492 summaryChars=0

---

{
  "plugins": {
    "hookTimeouts": {
      "before_prompt_build": 30000
    },
    "entries": {
      "active-memory": {
        "hooks": {
          "before_prompt_build": {
            "timeoutMs": 30000,
            "onTimeout": "skip" // fail open for recall/context plugins
          }
        }
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Summary

Expose the outer plugin hook-runner timeout for modifying hooks (especially before_prompt_build) as configuration instead of keeping it hardcoded at 15s.

Problem

active-memory has its own timeoutMs config, but in current installed builds there is also an outer hook-runner deadline for modifying hooks. For before_prompt_build, that deadline is hardcoded to ~15s. In practice this means a plugin can configure a longer model/recall timeout, but the hook still gets aborted by the outer hook cap first.

This is especially visible with Active Memory recall models that sometimes complete in ~10-12s but occasionally need slightly longer. The plugin-level config gives the impression that the budget is tunable, but the actual foreground hook budget is capped elsewhere.

Example local behavior:

active-memory ... activeModel=qwen3.6-active-memory:latest done status=ok elapsedMs=9967 summaryChars=114
active-memory ... activeModel=qwen3.6-active-memory:latest done status=ok elapsedMs=10449 summaryChars=115
active-memory ... activeModel=qwen3.6-active-memory:latest done status=timeout elapsedMs=15189 summaryChars=0
active-memory ... activeModel=qwen3.6-active-memory:latest done status=timeout elapsedMs=15492 summaryChars=0

The plugin config was set to timeoutMs: 15000; raising it would not solve the real limit if the hook runner still enforces a hard 15s before_prompt_build modifying-hook deadline.

Proposed solution

Add a documented config path for the modifying-hook runner timeout, ideally with per-hook and/or per-plugin override support.

Possible shape:

{
  "plugins": {
    "hookTimeouts": {
      "before_prompt_build": 30000
    },
    "entries": {
      "active-memory": {
        "hooks": {
          "before_prompt_build": {
            "timeoutMs": 30000,
            "onTimeout": "skip" // fail open for recall/context plugins
          }
        }
      }
    }
  }
}

Exact schema is not important; the important part is that operators can tune the outer hook cap without patching OpenClaw's bundled JS.

Desired behavior

  • before_prompt_build modifying-hook timeout is configurable.
  • Defaults remain safe and responsive for normal users.
  • Context/recall plugins such as Active Memory should fail open on timeout unless explicitly configured otherwise.
  • Logs should identify whether timeout came from plugin-level timeoutMs or the outer hook-runner cap.
  • Documentation should clarify the relationship between Active Memory timeoutMs and hook-runner timeout.

Why this matters

Active Memory is useful in direct chat, but model latency varies. A hardcoded outer 15s cap forces users to choose only models that reliably finish under 15s, even if they are willing to trade a slightly longer foreground budget for better recall quality. Making the cap configurable avoids local code patches and makes the behavior explicit.

Related issues

  • #62702 - broader non-blocking async plugin hooks / configurable timeout work
  • #65309 - Active Memory blocks direct-chat turns and times out across model configs
  • #69182 - Active Memory can block chat replies
  • #66804 / #73306 - Active Memory 15s timeout reports

extent analysis

TL;DR

Exposing the outer plugin hook-runner timeout as a configurable option can help resolve the issue of hardcoded 15s timeout for modifying hooks like before_prompt_build.

Guidance

  • Introduce a new configuration path for the modifying-hook runner timeout, allowing per-hook and/or per-plugin override support.
  • Set a default value for the before_prompt_build modifying-hook timeout that is safe and responsive for normal users.
  • Implement a fail-open behavior for context/recall plugins like Active Memory on timeout, unless explicitly configured otherwise.
  • Update logs to identify whether timeout came from plugin-level timeoutMs or the outer hook-runner cap.

Example

A possible configuration shape could be:

{
  "plugins": {
    "hookTimeouts": {
      "before_prompt_build": 30000
    },
    "entries": {
      "active-memory": {
        "hooks": {
          "before_prompt_build": {
            "timeoutMs": 30000,
            "onTimeout": "skip"
          }
        }
      }
    }
  }
}

Notes

The exact schema for the configuration is not crucial, but it is essential to provide operators with the ability to tune the outer hook cap without modifying the bundled JavaScript code.

Recommendation

Apply a workaround by introducing a configurable outer plugin hook-runner timeout, allowing users to adjust the timeout according to their needs, rather than relying on a hardcoded value. This approach provides more flexibility and avoids the need for local code patches.

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 Feature: expose before_prompt_build modifying-hook timeout as config [1 comments, 2 participants]