Context
The 2026-06-09 benchmark (MacBook M5 Max 128GB, gemma-4-31b-it via LM Studio at 127.0.0.1:1234) measured a ~5k-char → tweet-size miniSummary at ~5.3s warm (4.4–6.8s), ~13s cold. But MemoryService.buildMiniSummary caps each model call at TIMEOUT_MS = 4000 (4s) — below the real latency. Most summaries are aborted before completing → return null → the row stays pending.
This is the data-confirmed root of "the miniSummary backfill never drains" (the prio-0 v13 blocker) and of null inline summaries on add_memory. It is independent of the loop-bounding (#12746 / PR #12802): even a perfectly-bounded run drains 0 if every item aborts at 4s.
The Problem
buildMiniSummary (ai/services/memory-core/MemoryService.mjs:721) wraps the local model call in a 4s timeout (both the generateContent timeoutMs and the outer withTimeout). Local gemma-4-31b-it needs ~5.3s warm / ~13s cold per summary, so the 4s timeout fires first → null → deferred. Under the local-first default (#12742) the backfill (and the inline add_memory enrichment) therefore produce ≈0 summaries.
The Architectural Reality
MemoryService.buildMiniSummary — const TIMEOUT_MS = 4000 (the inner per-call cap; binding constraint).
- The backfill's outer per-item timeout is
MINI_SUMMARY_TIMEOUT_MS = 30000 (30s) — so the inner 4s is what actually fires.
- Benchmark evidence: ~5.3s warm, ~13s cold (3 runs, 5086-char input, contended-realistic).
The Fix
Raise the inner TIMEOUT_MS from 4000 to ~20000 (above the ~13s cold reading + headroom, under the 30s outer). Summaries then complete → the backfill drains and inline summaries populate. Pairs with PR #12802's run-budget (which bounds the now-completing batch under the supervisor watchdog).
Decision Record impact
aligned-with ADR 0019 (module constant; reads config at use site, no config mutation).
Acceptance Criteria
Out of Scope
- Run-budget / watchdog-kill loop (#12746 / PR #12802).
openAiCompatible.host config (:11434 vs live :1234) — separate. Deeper model-speed / ask-vs-Dream endpoint contention — #12799 / #12803. Backlog-depth observability — separate leaf.
Related
- #12740 (epic). #12746 / PR #12802 (run-budget sibling). #12799 (contention arbitration). #12803 (ask-side contention timeout).
- Benchmark: ~5k char → tweet miniSummary = ~5.3s warm / ~13s cold (
gemma-4-31b-it, M5 Max, LM Studio :1234), 2026-06-09.
Live latest-open sweep: checked latest 20 open issues at 2026-06-09T01:50:00Z; no equivalent (distinct from #12746 loop-bounding and #12803 ask-side contention timeout).
Authored by Claude Opus 4.8 (Claude Code)
Context
The 2026-06-09 benchmark (MacBook M5 Max 128GB,
gemma-4-31b-itvia LM Studio at127.0.0.1:1234) measured a ~5k-char → tweet-size miniSummary at ~5.3s warm (4.4–6.8s), ~13s cold. ButMemoryService.buildMiniSummarycaps each model call atTIMEOUT_MS = 4000(4s) — below the real latency. Most summaries are aborted before completing → returnnull→ the row stays pending.This is the data-confirmed root of "the miniSummary backfill never drains" (the prio-0 v13 blocker) and of null inline summaries on
add_memory. It is independent of the loop-bounding (#12746 / PR #12802): even a perfectly-bounded run drains 0 if every item aborts at 4s.The Problem
buildMiniSummary(ai/services/memory-core/MemoryService.mjs:721) wraps the local model call in a 4s timeout (both thegenerateContenttimeoutMsand the outerwithTimeout). Localgemma-4-31b-itneeds ~5.3s warm / ~13s cold per summary, so the 4s timeout fires first →null→ deferred. Under the local-first default (#12742) the backfill (and the inlineadd_memoryenrichment) therefore produce ≈0 summaries.The Architectural Reality
MemoryService.buildMiniSummary—const TIMEOUT_MS = 4000(the inner per-call cap; binding constraint).MINI_SUMMARY_TIMEOUT_MS = 30000(30s) — so the inner 4s is what actually fires.The Fix
Raise the inner
TIMEOUT_MSfrom 4000 to ~20000 (above the ~13s cold reading + headroom, under the 30s outer). Summaries then complete → the backfill drains and inline summaries populate. Pairs with PR #12802's run-budget (which bounds the now-completing batch under the supervisor watchdog).Decision Record impact
aligned-with ADR 0019(module constant; reads config at use site, no config mutation).Acceptance Criteria
buildMiniSummary's per-call timeout is calibrated above the measured local-model summary latency (~13s cold) with headroom, and below the 30s outer backfill timeout.Out of Scope
openAiCompatible.hostconfig (:11434 vs live :1234) — separate. Deeper model-speed / ask-vs-Dream endpoint contention — #12799 / #12803. Backlog-depth observability — separate leaf.Related
gemma-4-31b-it, M5 Max, LM Studio :1234), 2026-06-09.Live latest-open sweep: checked latest 20 open issues at 2026-06-09T01:50:00Z; no equivalent (distinct from #12746 loop-bounding and #12803 ask-side contention timeout).
Authored by Claude Opus 4.8 (Claude Code)