Skip to content

feat(mcp): add async task support for long-running operations (#485)#487

Merged
RobertLD merged 3 commits intomainfrom
claude/fix-issue-485-pLtJ8
Mar 22, 2026
Merged

feat(mcp): add async task support for long-running operations (#485)#487
RobertLD merged 3 commits intomainfrom
claude/fix-issue-485-pLtJ8

Conversation

@RobertLD
Copy link
Copy Markdown
Owner

Adds opt-in async execution to index_document (submit-document), reindex_library (reindex-documents), install_pack (install-pack), and all sync_connector tools (sync-slack, sync-notion, sync-confluence, sync-obsidian-vault, sync-onenote).

  • New src/mcp/tasks.ts: in-memory TaskRegistry with AbortController- based cancellation, 1-hour TTL pruning, and progress tracking
  • async: true parameter on all 7 long-running tools returns a task ID immediately; reindex and install-pack report chunk/doc progress
  • New get-task MCP tool to poll status, progress, and result
  • New cancel-task MCP tool to abort pending/running tasks
  • 24 new unit tests covering the full task lifecycle

Backward compatible: omitting async preserves existing synchronous behaviour.

https://claude.ai/code/session_01HRL3F1CRkRw35sUtU1eot3

Adds opt-in async execution to index_document (submit-document),
reindex_library (reindex-documents), install_pack (install-pack), and
all sync_connector tools (sync-slack, sync-notion, sync-confluence,
sync-obsidian-vault, sync-onenote).

- New `src/mcp/tasks.ts`: in-memory TaskRegistry with AbortController-
  based cancellation, 1-hour TTL pruning, and progress tracking
- `async: true` parameter on all 7 long-running tools returns a task ID
  immediately; reindex and install-pack report chunk/doc progress
- New `get-task` MCP tool to poll status, progress, and result
- New `cancel-task` MCP tool to abort pending/running tasks
- 24 new unit tests covering the full task lifecycle

Backward compatible: omitting `async` preserves existing synchronous
behaviour.

https://claude.ai/code/session_01HRL3F1CRkRw35sUtU1eot3
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
libscope Ignored Ignored Preview Mar 22, 2026 1:54pm

RobertLD and others added 2 commits March 22, 2026 09:51
…r.ts

Extend startAsyncTask to pass signal and onProgress to the work
function, then replace the inline reindex_library and install_pack
async blocks (which duplicated the task create/update/result pattern)
with calls to the shared helper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@RobertLD RobertLD merged commit c31fc3b into main Mar 22, 2026
10 checks passed
@RobertLD RobertLD deleted the claude/fix-issue-485-pLtJ8 branch March 22, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants