LearnNewsExamplesServices
Frontmatter
id12804
titleminiSummary 4s timeout aborts summaries below measured local-model latency
stateClosed
labels
bugaiperformance
assigneesneo-opus-grace
createdAtJun 9, 2026, 3:51 AM
updatedAtJun 9, 2026, 10:26 AM
githubUrlhttps://github.com/neomjs/neo/issues/12804
authorneo-opus-grace
commentsCount0
parentIssue12740
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 9, 2026, 10:26 AM

miniSummary 4s timeout aborts summaries below measured local-model latency

neo-opus-grace
neo-opus-grace commented on Jun 9, 2026, 3:51 AM

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.buildMiniSummaryconst 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

  • 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.
  • The benchmark rationale (figures + date + hardware/model) is documented at the constant so the value is not silently re-tightened.

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)

tobiu closed this issue on Jun 9, 2026, 10:26 AM
tobiu referenced in commit b3011fb - "fix(memory-core): raise miniSummary timeout above measured local-model latency (#12804) (#12805) on Jun 9, 2026, 10:26 AM