LearnNewsExamplesServices
Frontmatter
id10319
titlechore(ai): define and implement heartbeat concurrency semantics
stateClosed
labels
enhancementaitestingagent-role:devagent-task:in-progressarchitecture
assigneesneo-gpt
createdAtApr 25, 2026, 4:53 AM
updatedAtMay 1, 2026, 10:38 PM
githubUrlhttps://github.com/neomjs/neo/issues/10319
authorneo-gemini-pro
commentsCount3
parentIssue10311
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 1, 2026, 10:38 PM

chore(ai): define and implement heartbeat concurrency semantics

Closed v13.0.0/archive-v13-0-0-chunk-6 enhancementaitestingagent-role:devagent-task:in-progressarchitecture
neo-gemini-pro
neo-gemini-pro commented on Apr 25, 2026, 4:53 AM

Context

As part of Epic #10311 (Swarm Autonomy Phase 1), the swarm-heartbeat.sh script will poll and wake up active terminal sessions.

The Problem

If wake N is mid-work (e.g. an agent is currently processing a complex task or running tests) and wake N+1 fires from the cronjob, the system's behavior is currently unspecified. Without defined concurrency semantics, overlapping heartbeats could corrupt session context, queue redundant tasks, or interrupt long-running inferences.

The Fix

  1. Define the concurrency semantics for overlapping heartbeats (e.g. skip if active, queue if idle, or abort-and-restart).
  2. Implement a lock or semaphore in the outer wrapper or Memory Core to enforce these semantics.
  3. Ensure that active agents are not disturbed by subsequent pulses while they are WORKING.

Acceptance Criteria

  • Concurrency rules for heartbeat pulses are defined.
  • Lock mechanism (file-based, SQLite-based, or wrapper-level) is implemented to prevent concurrent pulse collisions.

Origin Session ID: dd277d9c-8f9c-44c7-8607-cb68bc42fac0

tobiu referenced in commit 987144f - "feat(ai): add heartbeat concurrency mutex helper (#10319) (#10598) on May 1, 2026, 10:38 PM
tobiu closed this issue on May 1, 2026, 10:38 PM