Skip to content

Commit 5305f9c

Browse files
fix(active-memory): preserve setup grace for embedded recall
Co-authored-by: volcano303 <[email protected]>
1 parent 153e4c5 commit 5305f9c

4 files changed

Lines changed: 8 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Docs: https://docs.openclaw.ai
1919

2020
### Fixes
2121

22+
- Active Memory: apply `setupGraceTimeoutMs` to the embedded recall runner as well as the outer prompt-build watchdog, so very-cold first recalls keep the configured setup grace end-to-end. (#74480) Thanks @volcano303.
2223
- Plugins/tools: keep disabled bundled tool plugins out of explicit runtime allowlist ownership and fall back from loaded-but-empty channel registries to tool-bearing plugin registries, so Active Memory can use bundled `memory-core` search/get tools even when `memory-lancedb` is disabled. Fixes #76603. Thanks @jwong-art.
2324
- Plugins/externalization: keep official ACPX, Google Chat, and LINE install specs on production package names, leaving beta-tag probing to the explicit OpenClaw beta update channel. Thanks @vincentkoc.
2425
- CLI/doctor: keep missing-plugin repair from overriding official catalog metadata with runtime fallbacks, so ACPX repairs preserve the official npm spec during the externalization rollout. Thanks @vincentkoc.

docs/concepts/active-memory.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -658,13 +658,9 @@ blocking prompt-build hook budget by default and move cold-start setup grace
658658
behind explicit `setupGraceTimeoutMs` config, so the plugin no longer silently
659659
extends 15000 ms configs to 45000 ms on the main lane."_
660660

661-
The embedded recall runner currently still receives the raw `timeoutMs` value
662-
as its inner budget; the in-flight fix to extend that with `setupGraceTimeoutMs`
663-
is tracked at [#74480](https://github.com/openclaw/openclaw/pull/74480). Until
664-
that lands, very-cold first recalls can still time out at the inner layer even
665-
with `setupGraceTimeoutMs` set — though the outer-layer setting still
666-
substantially mitigates the symptom by giving the prompt-build hook room to
667-
cover the warm-up window.
661+
The embedded recall runner uses the same effective timeout budget, so
662+
`setupGraceTimeoutMs` covers both the outer prompt-build watchdog and the inner
663+
blocking recall run.
668664

669665
For resource-tight gateways where cold-start latency is a known trade-off,
670666
lower values (5000–15000 ms) work too — the trade-off is a higher chance of
@@ -735,8 +731,7 @@ default `memory-core` path uses `memory_search`; `memory-lancedb` uses
735731
around the first eligible reply after a restart.
736732

737733
See [Cold-start grace](#cold-start-grace) under Recommended setup for the
738-
recommended `setupGraceTimeoutMs` value (and the open caveat about the
739-
embedded recall budget tracked at #74480).
734+
recommended `setupGraceTimeoutMs` value.
740735

741736
</Accordion>
742737
</AccordionGroup>

extensions/active-memory/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,7 @@ describe("active-memory plugin", () => {
22562256
);
22572257

22582258
expect(result?.prependContext).toContain("remember the ramen place");
2259-
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]?.timeoutMs).toBe(CONFIGURED_TIMEOUT_MS);
2259+
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]?.timeoutMs).toBe(CONFIGURED_TIMEOUT_MS + 100);
22602260
const infoLines = vi
22612261
.mocked(api.logger.info)
22622262
.mock.calls.map((call: unknown[]) => String(call[0]));

extensions/active-memory/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2273,6 +2273,7 @@ async function runRecallSubagent(params: {
22732273

22742274
try {
22752275
const embeddedConfig = applyActiveMemoryRuntimeConfigSnapshot(params.api.config, params.config);
2276+
const embeddedTimeoutMs = params.config.timeoutMs + params.config.setupGraceTimeoutMs;
22762277
const result = await params.api.runtime.agent.runEmbeddedPiAgent({
22772278
sessionId: subagentSessionId,
22782279
sessionKey: subagentSessionKey,
@@ -2286,7 +2287,7 @@ async function runRecallSubagent(params: {
22862287
prompt,
22872288
provider: modelRef.provider,
22882289
model: modelRef.model,
2289-
timeoutMs: params.config.timeoutMs,
2290+
timeoutMs: embeddedTimeoutMs,
22902291
runId: subagentSessionId,
22912292
trigger: "manual",
22922293
toolsAllow: ["memory_recall", "memory_search", "memory_get"],

0 commit comments

Comments
 (0)