Skip to content

Expose long-running synchronization through MCP Tasks #49

Open

Description

@pablontiv

Description

Expose long-running Backscroll synchronization through the optional MCP Tasks extension. Instead of holding a tool request open while discovery, hashing, parsing, and indexing complete, the server can return a durable task handle that clients poll or observe until completion.

MCP Tasks supports durable taskId handles, status polling, progress visibility, reconnect-safe retrieval, mid-flight input, and cooperative cancellation:

Tasks provide the protocol lifecycle for long operations; they do not provide mutual exclusion or automatic deduplication.

Prerequisites

This issue must use those components rather than introduce another synchronization implementation.

Goals

  • Return a durable MCP task when synchronization is expected to be long-running.
  • Map Backscroll sync progress and terminal errors into MCP task status.
  • Let disconnected clients resume polling with the same task ID within its TTL.
  • Deduplicate concurrent sync requests through Startup sync has quadratic session-text aggregation and can stall commands #46's coordinator so callers observe the same active operation where appropriate.
  • Keep search and other read operations available against the last committed snapshot while the task runs.
  • Define cancellation semantics that preserve database atomicity and index integrity.

Proposed Task Lifecycle

  1. A capable client calls the agreed sync operation.
  2. The server durably creates a task before returning resultType: "task".
  3. The task enters working while the Startup sync has quadratic session-text aggregation and can stall commands #46 coordinator owns synchronization.
  4. Progress/status messages report bounded phases such as discovery, hashing, parsing, and commit.
  5. tasks/get returns the current state and final result or error.
  6. Terminal states are immutable: completed, failed, or cancelled.
  7. Cooperative cancellation stops at a safe boundary and never exposes a partial transaction.

Non-goals

Acceptance Criteria

  • Tasks support is negotiated explicitly by both client and server.
  • Long-running sync can return a durable task handle with documented TTL and polling interval.
  • tasks/get exposes progress and a stable terminal result or structured error.
  • Reconnecting clients can retrieve a non-expired task without depending on the original connection or conversation.
  • Concurrent sync requests do not launch duplicate work and integrate with Startup sync has quadratic session-text aggregation and can stall commands #46's coordinator.
  • Cancellation is cooperative, documented, and cannot leave a partial SQLite transaction visible.
  • Clients without Tasks support receive a documented synchronous or unsupported-capability behavior.
  • Integration tests cover polling, reconnect, deduplication, failure, expiry, and cancellation.

Activity

  1. pablontiv commented on Sep 6, 2026

    @pablontiv
    OwnerAuthor

    [backscroll-team/investigador] 2026-09-06 UTC
    [backscroll-team] Estado: needs-info

    Reviewed main SHA: 1e698e58504bbb7ec83f835a675bbea32219f2f2. Static inspection unless explicitly stated otherwise; this is not a QA verdict.

    Dependency handoff

    Blocked on the accepted server surface in #48. #46 is closed; reuse its coordinator/ADR 0003 rather than implementing new mutual exclusion.

    Once #48 is specified, this ticket still needs an explicit mapping from sync operations to negotiated tasks, durable storage/TTL, reconnect semantics and cancellation boundaries that preserve SQLite atomicity. Do not invent TTLs, transports, authentication, or cancellation semantics. Verify the current official Tasks extension during that design step.

    No implementation PR was found. This comment records dependencies and decisions, not a protocol-conformance result or a reason to remove the existing proposal.

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

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions