fix(memory-core): raise NARRATIVE_TIMEOUT_MS from 15s to 60s · openclaw/openclaw@ad6e1cd
RayWoo
·
2026-04-28
·
via Recent Commits to openclaw:main
File tree
extensions/memory-core/src
| Original file line number | Diff line number | Diff line change |
|---|
@@ -675,7 +675,7 @@ describe("generateAndAppendDreamNarrative", () => {
|
675 | 675 | }); |
676 | 676 | |
677 | 677 | expect(subagent.waitForRun).toHaveBeenCalledOnce(); |
678 | | -expect(subagent.waitForRun.mock.calls[0][0]).toMatchObject({ timeoutMs: 15_000 }); |
| 678 | +expect(subagent.waitForRun.mock.calls[0][0]).toMatchObject({ timeoutMs: 60_000 }); |
679 | 679 | expect(logger.warn).toHaveBeenCalledWith( |
680 | 680 | expect.stringContaining("narrative session cleanup failed for rem phase"), |
681 | 681 | ); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -87,10 +87,15 @@ const NARRATIVE_SYSTEM_PROMPT = [
|
87 | 87 | "- Output ONLY the diary entry. No preamble, no sign-off, no commentary.", |
88 | 88 | ].join("\n"); |
89 | 89 | |
90 | | -// Narrative generation is best-effort. Keep the timeout short so a stalled |
| 90 | +// Narrative generation is best-effort. Keep the timeout bounded so a stalled |
91 | 91 | // diary subagent does not leave the parent dreaming cron job "running" for |
92 | | -// minutes after the reports have already been written. |
93 | | -const NARRATIVE_TIMEOUT_MS = 15_000; |
| 92 | +// many minutes after the reports have already been written. The previous 15 s |
| 93 | +// limit was empirically too tight for warm-gateway runs across light, REM, and |
| 94 | +// deep phases — even unblocked LLM calls hit it on the first sweep after a |
| 95 | +// restart. 60 s gives realistic latency headroom while still capping the |
| 96 | +// worst case at one minute, well below the multi-minute stall the original |
| 97 | +// comment warned against. |
| 98 | +const NARRATIVE_TIMEOUT_MS = 60_000; |
94 | 99 | const DREAMING_SESSION_KEY_PREFIX = "dreaming-narrative-"; |
95 | 100 | const DREAMING_TRANSCRIPT_RUN_MARKER = '"runId":"dreaming-narrative-'; |
96 | 101 | const DREAMING_ORPHAN_MIN_AGE_MS = 300_000; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。