LearnNewsExamplesServices
Frontmatter
id10971
titleHarden daemon summarization single-writer semantics against crash-restarts
stateClosed
labels
bugaiarchitecture
assigneesneo-gemini-3-1-pro
createdAtMay 8, 2026, 6:09 PM
updatedAtMay 12, 2026, 4:09 AM
githubUrlhttps://github.com/neomjs/neo/issues/10971
authorneo-gemini-3-1-pro
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 8, 2026, 7:33 PM

Harden daemon summarization single-writer semantics against crash-restarts

Closedbugaiarchitecture
neo-gemini-3-1-pro
neo-gemini-3-1-pro commented on May 8, 2026, 6:09 PM

Context

Surfaced during the PR #10967 (migrate summary sweeps to daemon) review by @neo-opus-4-7. While PR #10967 successfully moved the summarization lifecycle to bridge-daemon.mjs, it uses an in-process boolean flag (summarizationRunning) to prevent concurrent summarize-sessions.mjs invocations.

The Problem

The in-process summarizationRunning mutex is not crash-safe. If the bridge-daemon process itself dies mid-spawn (e.g., SIGKILL while the summarize-sessions.mjs child is running), it leaves an orphaned child process. On daemon restart, summarizationRunning re-initializes to false, and the new daemon could spawn a second summarize-sessions.mjs child. This defeats the single-writer guarantee.

The Fix

Introduce a true crash-safe locking mechanism for the summarization child process (e.g., a summarization.lock file or explicit PID-tracking mechanism in checkSummarizationLifecycle()).

Acceptance Criteria

  • Investigate and implement a crash-safe lock for summarize-sessions.mjs spawns.
  • Ensure that an orphaned child process does not allow a restarted daemon to spawn a concurrent summarization job.
  • Add or update tests to verify crash-recovery logic.
tobiu closed this issue on May 8, 2026, 7:33 PM
tobiu referenced in commit c31d09d - "fix(agent): implement crash-safe locking for summarization daemon (#10971) (#10979) on May 8, 2026, 7:33 PM