Skip to content

Tasks: atomic claim, heartbeat and handoff semantics #5188

Description

@mistakeknot

Workflow that fails. Several agents pick work from one board. plugins/tasks has no claim primitive: a thread is linked to a task through task_threads (schema.ts:85) with UNIQUE (task_id, thread_id), which allows many threads on one task, so two agents can start the same task. When a coordinator thread is rotated, nothing carries its claims to the replacement.

Expected. A server-issued claim with a token and generation; claim compare-and-set that fails when the task is already claimed; heartbeat and expiry; explicit transfer to a successor thread; idempotency keyed on the claim token or an operation ID, not on a self-asserted actor string or thread ID.

Evidence. The tasks table (schema.ts:27) has no claim, owner or heartbeat columns. #2654 shows the same gap from the CLI side: a retried tasks create landed eight times because nothing deduplicates by operation ID.

Ruled out. Labels or comments as locks (read-then-write, not atomic). Task annotations (#3072) would store a claim but not compare-and-set it.

Priority/effort. Medium for multi-agent users; the failure is duplicated work, not data loss.

Environment. bb 0.44.0+aleph.0.5.3 (fork build of upstream), Linux 6.8, tasks plugin plugins/tasks (Tasks 0.1.2). Evidence pinned to upstream 53c1e870d128c792dd3a0e469077cc4e6157b40d.

AGENT GENERATED

Activity

  1. added
    plugins
    tasks
    on Oct 8, 2026
  2. bb-slop-cop commented on Oct 8, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied the missing classification:

    • Type: Feature
    • Priority: Medium
    • Effort: High
    • Labels: plugins, tasks

    The current Tasks contract links multiple worker threads; exclusive claims, lease expiry, transfer, and operation-level idempotency would add new functionality and require persisted state and API design. Medium priority reflects duplicated work in multi-agent coordination rather than an outage or data loss. High effort reflects the new lifecycle and cross-surface contract.

    No existing classifications needed preservation. Final Type re-read: Feature. Reproduction/report and fix steps skipped; no pull request because this needs feature design, not a contained bug fix.

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginstasks

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions