LearnNewsExamplesServices
Frontmatter
id12821
titlev13: log the session-summary backlog count on the orchestrator periodic sweep (parity with the mini-summary count)
stateClosed
labels
enhancementai
assigneesneo-opus-grace
createdAtJun 9, 2026, 1:42 PM
updatedAtJun 9, 2026, 2:35 PM
githubUrlhttps://github.com/neomjs/neo/issues/12821
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 9, 2026, 2:35 PM

v13: log the session-summary backlog count on the orchestrator periodic sweep (parity with the mini-summary count)

neo-opus-grace
neo-opus-grace commented on Jun 9, 2026, 1:42 PM

Problem (v13 observability)

#12810 added the mini-summary backlog count to the orchestrator log: the memory-summary-backfill task only fires when there's a backlog, so it always logs pending-memory-minisummary:N. The session-summary side has no equivalent on its dominant path:

  • The summary task's trigger (ai/daemons/orchestrator/scheduling/summary.mjs) logs pending-summarization:N only on the pending-summarization path (explicit SummarizationJobs markers).
  • When there are no markers, it fires via periodic-sweep with reason periodic-sweep:600000no backlog count. The periodic sweep is exactly the path that handles "ordinary unsummarized sessions," so the real session-summary backlog depth is invisible.

Net: we can see the mini-summary backlog drain but are blind to the session-summary backlog (the operator's "we need both").

Fix

  • Add getPendingSessionSummaryCount(db) to summary.mjs: a fail-soft graph-direct count of sessions with AGENT_MEMORY rows but no SESSION_SUMMARY (the real unsummarized-session backlog — parallel to the mini-summary count's "rows missing a miniSummary" semantics, not the capped SummarizationJobs marker fetch).
  • Thread it into buildSummaryTrigger's periodic-sweep reason so every periodic sweep logs the depth, e.g. periodic-sweep:600000 pending-session-summary:N. Wire the count fn in getDueTask (test seam, like #12810).

Acceptance Criteria

  • The summary periodic-sweep trigger reason includes the uncapped unsummarized-session count.
  • getPendingSessionSummaryCount is fail-soft (returns null when the table/graph is unavailable) and counts distinct AGENT_MEMORY sessionIds lacking a SESSION_SUMMARY.
  • Deterministic scheduling tests (pure-function, no live graph): periodic-sweep reason carries the count; fail-soft path.
  • Output shape otherwise unchanged (additive — backward-compatible, like #12810).

Relations

Parallel to #12810 (mini-summary backlog count). Relates to #12819 / #12820 (session-summary silent-gap fix), #12817 LEAF 1.

Authored by Claude Opus 4.8 (Claude Code)

tobiu closed this issue on Jun 9, 2026, 2:35 PM
tobiu referenced in commit 6a6b0bf - "feat(orchestrator): log the session-summary backlog count on the periodic sweep (#12821) (#12822) on Jun 9, 2026, 2:35 PM