fix(active-memory): preserve setup grace for embedded recall

Apply setupGraceTimeoutMs to the embedded recall runner as well as the outer Active Memory watchdog.

Co-authored-by: volcano303 <75143900+volcano303@users.noreply.github.com>
This commit is contained in:
volcano303
2026-05-03 05:41:19 -06:00
committed by GitHub
parent 8a0e3b6422
commit 1d657b9d5f
4 changed files with 8 additions and 11 deletions

View File

@@ -2256,7 +2256,7 @@ describe("active-memory plugin", () => {
);
expect(result?.prependContext).toContain("remember the ramen place");
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]?.timeoutMs).toBe(CONFIGURED_TIMEOUT_MS);
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]?.timeoutMs).toBe(CONFIGURED_TIMEOUT_MS + 100);
const infoLines = vi
.mocked(api.logger.info)
.mock.calls.map((call: unknown[]) => String(call[0]));

View File

@@ -2273,6 +2273,7 @@ async function runRecallSubagent(params: {
try {
const embeddedConfig = applyActiveMemoryRuntimeConfigSnapshot(params.api.config, params.config);
const embeddedTimeoutMs = params.config.timeoutMs + params.config.setupGraceTimeoutMs;
const result = await params.api.runtime.agent.runEmbeddedPiAgent({
sessionId: subagentSessionId,
sessionKey: subagentSessionKey,
@@ -2286,7 +2287,7 @@ async function runRecallSubagent(params: {
prompt,
provider: modelRef.provider,
model: modelRef.model,
timeoutMs: params.config.timeoutMs,
timeoutMs: embeddedTimeoutMs,
runId: subagentSessionId,
trigger: "manual",
toolsAllow: ["memory_recall", "memory_search", "memory_get"],