Skip to content

[WIP] Migrate to Tasks extension SDK - #2308

Draft
LucaButBoring wants to merge 3 commits into
modelcontextprotocol:mainfrom
LucaButBoring:feat/ext-tasks
Draft

[WIP] Migrate to Tasks extension SDK#2308
LucaButBoring wants to merge 3 commits into
modelcontextprotocol:mainfrom
LucaButBoring:feat/ext-tasks

Conversation

@LucaButBoring

@LucaButBoring LucaButBoring commented Sep 9, 2026

Copy link
Copy Markdown

Following discussion on Discord, this uses the extracted Tasks implementation (see modelcontextprotocol/ext-tasks#21) to replace the implementation here.

Publishing as a draft for reference and comments; this is unmergable until the actual extension SDK is merged and published to NPM (after which point I'll swap the new dependency to not be a local path).

Copilot AI balanced review requested due to automatic review settings September 9, 2026 20:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Connection lifecycle, degraded-mode tool calls, legacy timeouts, and bounded task-input handling have unresolved regressions.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Migrates Inspector task handling to the extracted ext-tasks SDK while retaining generation-neutral task APIs.

Changes:

  • Adds and externalizes the new Tasks SDK dependency.
  • Replaces custom requester/receiver task orchestration with SDK sessions.
  • Updates task types and refactors related test coverage.
File summaries
File Description
package.json Adds the local Tasks SDK dependency.
package-lock.json Locks the local package.
core/mcp/types.ts Defines neutral Inspector task types.
core/mcp/modernTaskSchemas.ts Re-exports SDK schemas and identifiers.
core/mcp/messageTrackingTransport.ts Simplifies raw-response consumption.
core/mcp/inspectorClientProtocol.ts Updates task API types and capabilities.
core/mcp/inspectorClientEventTarget.ts Migrates task event payload types.
core/mcp/inspectorClient.ts Integrates requester and receiver task sessions.
clients/web/tsup.runner.config.ts Externalizes the Tasks SDK.
clients/web/src/test/integration/mcp/inspectorClient.test.ts Removes superseded task tests.
clients/web/src/test/integration/mcp/inspectorClient-tasks-era.test.ts Removes the task input-round limit test.
clients/web/src/test/integration/mcp/inspectorClient-modern-era.test.ts Accepts the SDK’s revised error wording.
clients/web/src/test/integration/mcp/inspectorClient-coverage-backfill.test.ts Removes tests for deleted internals.
clients/web/src/test/core/mcp/modernTaskSchemas.test.ts Removes tests for replaced schemas.
clients/web/src/test/core/mcp/inspectorClient-raw-wire.test.ts Adds SDK-boundary and raw-dispatch tests.
clients/web/src/test/core/mcp/inspectorClient-peer-handler-timing.test.ts Updates session lifecycle tests.
clients/tui/tsup.config.ts Externalizes the Tasks SDK.
clients/cli/tsup.config.ts Externalizes the Tasks SDK.
Review details
  • Files reviewed: 16/18 changed files
  • Comments generated: 4
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread core/mcp/inspectorClient.ts
Comment thread core/mcp/inspectorClient.ts
Comment thread core/mcp/inspectorClient.ts Outdated
Comment thread core/mcp/inspectorClient.ts
Copilot AI review requested due to automatic review settings September 10, 2026 01:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Modern task calls currently regress progress delivery, timeout behavior, and protocol-error preservation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 16/18 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment on lines +1049 to +1051
const taskId = this.taskProgressIds.get(progressToken);
if (!taskId) return;
if (this.progress) this.dispatchTypedEvent("progressNotification", params);
const timeoutMs = this.requestTimeout ?? 30_000;
const raw = await new Promise<unknown>((resolve, reject) => {
const timer = setTimeout(() => {
const timeoutMs = timeoutOverride ?? this.requestTimeout ?? 30_000;
Comment on lines +3918 to +3923
} catch (error) {
const operationError = unwrapTaskDispatchError(error);
if (!(operationError instanceof ToolCallCancelledError)) {
this.emitTaskError(lastTask, operationError);
}
throw operationError;
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