Skip to content

#1 Persistent memory for AI coding agents based on real-world benchmarks

fix: increase systemic timeouts for summarization and consolidation (#213)

xuli5001771effa2c27e35
diff --git a/src/hooks/session-end.ts b/src/hooks/session-end.ts
index da352d29..31bef22e 100644
--- a/src/hooks/session-end.ts
+++ b/src/hooks/session-end.ts
@@ -37,7 +37,7 @@ async function main() {
method: "POST",
headers: authHeaders(),
body: JSON.stringify({ sessionId }),
- signal: AbortSignal.timeout(5000),
+ signal: AbortSignal.timeout(30000), // Increased from 5s
});
} catch {
// best-effort
@@ -49,7 +49,7 @@ async function main() {
method: "POST",
headers: authHeaders(),
body: JSON.stringify({ olderThanDays: 0 }),
- signal: AbortSignal.timeout(15000),
+ signal: AbortSignal.timeout(60000), // Increased from 15s
});
} catch {}
@@ -58,7 +58,7 @@ async function main() {
method: "POST",
headers: authHeaders(),
body: JSON.stringify({ tier: "all", force: true }),
- signal: AbortSignal.timeout(30000),
+ signal: AbortSignal.timeout(120000), // Increased from 30s
});
} catch {}
}
@@ -68,7 +68,7 @@ async function main() {
await fetch(`${REST_URL}/agentmemory/claude-bridge/sync`, {
method: "POST",
headers: authHeaders(),
- signal: AbortSignal.timeout(5000),
+ signal: AbortSignal.timeout(30000), // Increased from 5s
});
} catch {
// best-effort
@@ -76,4 +76,4 @@ async function main() {
}
}
-main();
+main();
\ No newline at end of file
diff --git a/src/hooks/stop.ts b/src/hooks/stop.ts
index 4a379287..1f2f5b8a 100644
--- a/src/hooks/stop.ts
+++ b/src/hooks/stop.ts
@@ -44,11 +44,11 @@ async function main() {
method: "POST",
headers: authHeaders(),
body: JSON.stringify({ sessionId }),
- signal: AbortSignal.timeout(30000),
+ signal: AbortSignal.timeout(120000), // Increased from 30s to 120s
});
} catch {
// summarize is best-effort
}
}
-main();
+main();
\ No newline at end of file
diff --git a/src/index.ts b/src/index.ts
index 484908e0..6385a96c 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -160,6 +160,7 @@ async function main() {
const sdk = registerWorker(config.engineUrl, {
workerName: "agentmemory",
+ invocationTimeoutMs: 180000,
otel: {
serviceName: OTEL_CONFIG.serviceName,
serviceVersion: OTEL_CONFIG.serviceVersion,