openclaw - ✅(Solved) Fix [Bug]: Dreaming narrative generation times out for all 3 phases on v2026.4.25 warm gateway — #69487 fix appears regressed/incomplete [1 pull requests, 1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

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#72837Fetched 2026-04-28 06:31:41
View on GitHub
Comments
1
Participants
1
Timeline
11
Reactions
1
Author
Participants
Timeline (top)
referenced ×6closed ×1commented ×1cross-referenced ×1

On v2026.4.25 stable, memory-core narrative generation reliably times out for all three dreaming phases (light, rem, deep) regardless of gateway warm-up state. This contradicts the resolution of #69487 ("First dreaming-narrative subagent run after gateway idle exceeds NARRATIVE_TIMEOUT_MS due to plugin-host cold-start", closed 2026-04-25 by @steipete with "Closing this as implemented after Codex review").

Key difference from #69487: this is not cold-start — failures persist 22 minutes into a warmed gateway and across consecutive triggers. Underlying dream output (memory.dream.completed events with lineCount > 0, reportPath written) is unaffected; only the narrative prose-summary step fails.

Error Message

13:15:08.993 WARN memory-core: narrative generation ended with status=timeout for light phase. 13:17:03.143 WARN memory-core: narrative generation ended with status=timeout for rem phase. 13:17:03.151 WARN memory-core: narrative generation ended with status=timeout for deep phase. 13:31:46.973 WARN memory-core: narrative generation ended with status=timeout for light phase. 13:31:46.982 WARN memory-core: narrative generation ended with status=timeout for rem phase. 13:32:20.344 WARN memory-core: narrative generation ended with status=timeout for deep phase.

Root Cause

Suspected root cause: NARRATIVE_TIMEOUT_MS = 15000 is too aggressive

Fix Action

Fix / Workaround

Mitigation suggestion

PR fix notes

PR #72852: fix(memory-core): raise NARRATIVE_TIMEOUT_MS from 15s to 60s

Description (problem / solution / changelog)

What

Bumps NARRATIVE_TIMEOUT_MS in extensions/memory-core/src/dreaming-narrative.ts from 15 s → 60 s, and updates the matching unit-test assertion.

Why

Closes #72837.

On v2026.4.25 stable, narrative generation reliably times out for all three dreaming phases (light, REM, deep) regardless of gateway warm-up state. The memory.dream.completed event for each phase fires correctly (the underlying dream report is written to disk) but the prose-summary subagent run hits the 15 s limit before completion, so the diary entry is dropped and the gateway logs:

memory-core: narrative generation ended with status=timeout for <phase> phase.

The 15 s limit predates current model latencies — even unblocked LLM calls (OpenAI gpt-5.4-mini over a healthy network, p50 ≈ 3 s, p99 ≈ 12 s) brush against it on the first sweep after a restart, and reliably exceed it during load. Two consecutive openclaw cron run <jobId> triggers on the same machine 22 minutes apart both timed out for all 3 phases — full evidence in the linked issue.

Why 60 s (not raised further, not made configurable)

The existing comment above the constant captured the maintainer's concern explicitly:

// Narrative generation is best-effort. Keep the timeout short so a stalled // diary subagent does not leave the parent dreaming cron job "running" for // minutes after the reports have already been written.

60 s preserves that constraint — it's still well under "minutes" (plural) — while giving realistic LLM-call headroom. I considered exposing this as a dreaming.execution.narrativeTimeoutMs config field but CONTRIBUTING.md notes that new features generally aren't accepted, and a single constant bump is a tighter scope. Happy to convert to a config knob in a follow-up if you'd prefer that shape.

The new comment block reflects the empirical reasoning so a future reader doesn't need to dig through the issue history.

Testing

  • dreaming-narrative.test.ts "skips extra settle waits after timeout and still attempts cleanup" hard-codes the constant (expect(...).toMatchObject({ timeoutMs: 15_000 })); updated to 60_000 to match.
  • Local pnpm install not run (this fork is on a Linux host without a provisioned monorepo dev env; pulling all transitive deps was out of scope). Change is a literal-value swap with no logic or call-graph effect, so CI is the right verification surface.
  • No new tests added — the existing assertion already exercises the call path; adding a separate test for "timeout is 60_000" would just duplicate what's there.

Diff size

extensions/memory-core/src/dreaming-narrative.test.ts |  2 +-
extensions/memory-core/src/dreaming-narrative.ts      | 11 ++++++++---
2 files changed, 9 insertions(+), 4 deletions(-)

Related

  • #72837 — issue this closes
  • #69487 — closed bug about cold-start narrative timeouts; the resolution there assumes plugin-host warm-up explains the latency, but #72837 shows the timeout still fires on warm gateways with the plugin runtime fully loaded — so this PR addresses the underlying budget rather than the warm-up path

Changed files

  • extensions/memory-core/src/dreaming-narrative.test.ts (modified, +1/-1)
  • extensions/memory-core/src/dreaming-narrative.ts (modified, +8/-3)

Code Example

13:15:08.993  WARN  memory-core: narrative generation ended with status=timeout for light phase.
13:17:03.143  WARN  memory-core: narrative generation ended with status=timeout for rem phase.
13:17:03.151  WARN  memory-core: narrative generation ended with status=timeout for deep phase.

---

13:31:46.973  WARN  memory-core: narrative generation ended with status=timeout for light phase.
13:31:46.982  WARN  memory-core: narrative generation ended with status=timeout for rem phase.
13:32:20.344  WARN  memory-core: narrative generation ended with status=timeout for deep phase.

---

const NARRATIVE_TIMEOUT_MS = 15e3;  // 15 seconds
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

On v2026.4.25 stable, memory-core narrative generation reliably times out for all three dreaming phases (light, rem, deep) regardless of gateway warm-up state. This contradicts the resolution of #69487 ("First dreaming-narrative subagent run after gateway idle exceeds NARRATIVE_TIMEOUT_MS due to plugin-host cold-start", closed 2026-04-25 by @steipete with "Closing this as implemented after Codex review").

Key difference from #69487: this is not cold-start — failures persist 22 minutes into a warmed gateway and across consecutive triggers. Underlying dream output (memory.dream.completed events with lineCount > 0, reportPath written) is unaffected; only the narrative prose-summary step fails.

Steps to reproduce

  1. Fresh install v2026.4.25 on Debian 11 (or restart existing v4.25 gateway)
  2. Wait ≥20 min after gateway becomes ready (long enough that #69487's "first sweep" cold-start excuse does not apply)
  3. Trigger dreaming via openclaw cron run <memoryDreamingPromotionJobId>
  4. Observe gateway log: grep 'narrative generation ended with status=timeout' /tmp/openclaw/openclaw-$(date +%Y-%m-%d).log

Expected behavior

Per #69487 resolution, narrative generation completes for all phases on a warm gateway within NARRATIVE_TIMEOUT_MS.

Actual behavior

Two consecutive runs on the same gateway, both failed identically:

Run 1 — cold (gateway just restarted, 4 min uptime)

13:15:08.993  WARN  memory-core: narrative generation ended with status=timeout for light phase.
13:17:03.143  WARN  memory-core: narrative generation ended with status=timeout for rem phase.
13:17:03.151  WARN  memory-core: narrative generation ended with status=timeout for deep phase.

Run 2 — warm (22 min uptime)

13:31:46.973  WARN  memory-core: narrative generation ended with status=timeout for light phase.
13:31:46.982  WARN  memory-core: narrative generation ended with status=timeout for rem phase.
13:32:20.344  WARN  memory-core: narrative generation ended with status=timeout for deep phase.

In both runs, dreams themselves completed (events.jsonl entries with memory.dream.completed for all 3 phases, storageMode: "separate"). Only the narrative prose-summary failed.

Suspected root cause: NARRATIVE_TIMEOUT_MS = 15000 is too aggressive

dist/dreaming-narrative-BzMUwuXQ.js:42:

const NARRATIVE_TIMEOUT_MS = 15e3;  // 15 seconds

15 seconds is short for any LLM call (Claude/GPT model calls regularly take 5–15s end-to-end for non-trivial prompts; under any provider latency or queueing, this is tight). #69487's discussion mentioned a 60s timeout — either v4.25 reduced this, or the symptom in #69487 was a different NARRATIVE_TIMEOUT_MS than the one in dreaming-narrative-BzMUwuXQ.js.

Environment

ItemValue
OpenClaw version2026.4.25 (stable)
OSDebian 11 (AWS Bitnami)
Node24.13.0 (NVM)
Modelsprimary openai/gpt-5.4-mini, fallback moonshot/kimi-k2.6
Memory searchopenai/text-embedding-3-small

Mitigation suggestion

Either (a) raise NARRATIVE_TIMEOUT_MS to 60s+ or expose it as a config knob, or (b) ensure narrative subagent reuses the gateway-bindable plugin runtime path described in #69487's closure note even on subsequent runs (not just the first).

Related

  • #69487 (closed 2026-04-25 — fix appears insufficient)
  • #72554 (narrative cleanup — different issue, same subsystem)

extent analysis

TL;DR

Increase the NARRATIVE_TIMEOUT_MS value to at least 60 seconds to prevent narrative generation timeouts.

Guidance

  • Review the NARRATIVE_TIMEOUT_MS value in dist/dreaming-narrative-BzMUwuXQ.js and consider increasing it to a higher value (e.g., 60 seconds or more) to accommodate potential latency or queueing in LLM calls.
  • Verify that the narrative generation completes successfully after increasing the timeout value by checking the gateway log for narrative generation ended with status=success messages.
  • If increasing the timeout value is not feasible, explore the option of exposing NARRATIVE_TIMEOUT_MS as a configurable knob to allow for more flexibility in setting the timeout value.
  • Investigate whether the narrative subagent is reusing the gateway-bindable plugin runtime path on subsequent runs, as mentioned in #69487's closure note, to ensure that the fix is properly implemented.

Example

const NARRATIVE_TIMEOUT_MS = 60e3;  // 60 seconds

Notes

The current NARRATIVE_TIMEOUT_MS value of 15 seconds may be too aggressive, leading to timeouts in narrative generation. Increasing this value or exposing it as a config knob may help mitigate the issue. However, further investigation is needed to determine the root cause and ensure that the fix is properly implemented.

Recommendation

Apply workaround: Increase the NARRATIVE_TIMEOUT_MS value to at least 60 seconds to prevent narrative generation timeouts, as this is a more straightforward and immediate solution to the problem.

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

Per #69487 resolution, narrative generation completes for all phases on a warm gateway within NARRATIVE_TIMEOUT_MS.

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]: Dreaming narrative generation times out for all 3 phases on v2026.4.25 warm gateway — #69487 fix appears regressed/incomplete [1 pull requests, 1 comments, 1 participants]