Skip to content

[P24] tasks: SEP-1686 and SEP-2663 on server and client - #347

Merged
jeanmatthieu merged 4 commits into
rel/1.0.0from
conformance/p24-tasks
Nov 25, 2026
Merged

jeanmatthieu merged 4 commits into
rel/1.0.0from
conformance/p24-tasks

Conversation

@jeanmatthieu

@jeanmatthieu jeanmatthieu commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor
Part P24 of P0–P35, merged into rel/1.0.0 in order (previous: P23 (#348) · next: P25 (#346))
Branch conformance/p24-tasks
Base conformance/p23-harness (stacked: GitHub retargets this PR to rel/1.0.0 when the previous part merges)
Commits ecaa04b tasks: SEP-1686 and SEP-2663 on server and client
a08fd9f tasks: review fixes
2b13e8f tasks: second-pass review fixes
050807d tasks: third-pass review fixes
Size 59 files, +8010 / -278

Summary

Adds tasks for tools/call. One task model has two wire forms:

  • v1, at 2025-11-25 (SEP-1686): the client asks for a task with the task parameter, reads the
    outcome with tasks/result, and can list tasks with tasks/list.
  • v2, at 2026-07-28 (SEP-2663, the io.modelcontextprotocol/tasks extension): the server
    decides, tasks/get inlines the outcome, and the client answers input with tasks/update.

On the server, withTasks(_:) serves the task methods, and a tools/call handler returns
runAsTask { task in ... }. The SDK reads each tool's execution.taskSupport from the
tools/list handler, gates the call, and creates a task only when the client can use one. A
TaskManager runs the work and keeps the tasks in a TaskStore (InMemoryTaskStore by
default). On the client, Configuration.tasks opts in, and callTool drives a task it gets
back to its result at either revision. TaskHandle is the low-level handle.

Every tasks-* conformance scenario passes: the default-leg baseline goes from 25 server
entries to none. The interop matrix gains a tasks profile and a TypeScript SDK driver and task
server.

Motivation

  • The tasks-* scenarios of the default conformance leg failed with 25 entries; ROADMAP listed
    tasks as planned for both revisions.
  • 2025-11-25 and 2026-07-28 define tasks with wire forms that are not compatible (table in
    design/tasks.md). An application should write one handler, and the SDK should choose the
    wire form and the gating for each revision.
  • The harness tests only v2, as a server. The TypeScript SDK 1.x has a v1 runtime, so the
    interop matrix checks v1 against it in both directions.

Changes

Wire types (Sources/MCP/Base/TaskTypes.swift, new)

  • TaskStatus and TaskSupport: open structs (RawRepresentable, string literals).
  • TaskSnapshot: the task as the server reports it, in the create result, tasks/get and both
    status notifications. An internal generation selects the encoding: ttl/pollInterval
    and no outcome for v1; ttlMs (null when unlimited), pollIntervalMs and the inlined
    result or error for v2. Decoding accepts both forms and records which it read.
  • Methods: GetTask (tasks/get), UpdateTask (tasks/update, v2), CancelTask
    (tasks/cancel; the task at v1, an empty acknowledgement at v2), GetTaskPayload
    (tasks/result, v1), ListTasks (tasks/list, v1).
  • Notifications: TaskStatusNotification (notifications/tasks/status, v1) and
    TaskUpdatedNotification (notifications/tasks, v2).
  • TaskMetadata (the task request parameter), ExtensionID.tasks.
  • Sources/MCP/Server/Tools.swift: Tool.execution (Tool.Execution.taskSupport),
    CallTool.Parameters.task, CallTool.Result.task. A result that creates a task encodes flat
    with resultType: "task" at v2 and nested under task at v1. resultType == "task", or a
    top-level task without content, decodes into task.
  • Sources/MCP/Base/Results.swift: ResultType.task.
  • Sources/MCP/Base/MetaKeys.swift: MetaKey.relatedTask, Metadata.relatedTaskID.
  • Sources/MCP/Base/Versioning.swift: ProtocolProfile.usesTaskAugmentation (2025-11-25 and
    later handshake revisions) and usesTasksExtension (stateless revisions); internal
    taskGeneration.
  • Sources/MCP/Base/Subscriptions.swift: SubscriptionFilter.taskIds and an internal
    SubscriptionEvent.task, sent as notifications/tasks.
  • Sources/MCP/Base/Transports/MCPRequestHeaders.swift: Mcp-Name carries params.taskId of
    tasks/get, tasks/update and tasks/cancel. HTTPClientTransport and
    StatelessHTTPServerTransport use it.

Task manager and store (Sources/MCP/Server/TaskManager.swift, new)

  • TaskRecord: the stored form. Status, outcome (result value or MCPError), outstanding
    inputRequests, owner, creating revision, TTL and poll interval. A tool error completes the
    record; the v1 snapshot reports it as failed.
  • TaskStore protocol and InMemoryTaskStore.
  • TaskManager (actor): runs the work and keeps state behind the store. One manager serves
    every Server of a process, because a stateful HTTP transport makes a Server per session
    and a v1 task must outlive the session. While a task runs, an in-memory cache is
    authoritative and store writes are serialized, so a tasks/get right after the create result
    finds the task.
  • TaskManager.Configuration: defaultTTL (1 hour), maximumTTL (24 hours), pollInterval
    (1 second), maxActiveTasks (1000), maxActiveTasksPerPrincipal (100, only with a
    principal), sendsStatusNotifications (on).
  • Principal: an optional closure that binds each task to its caller. A foreign task reads as
    unknown (-32602). Without a principal, v1 does not declare tasks.list.
  • Expiry on access, and a sweep of the store every 64 creations. The work of an expired task
    is cancelled.
  • complete(_:with:) and fail(_:with:) finish a task whose work another system runs, and
    cancel its work. cancel(_:) cancels a task. record(id:) reads one.
  • TaskContext: what the work receives. taskID (nil inline), request (the creating
    request's HandlerContext), isTask, requestInput(_:), elicit(message:requestedSchema:),
    reportProgress(_:total:message:), setStatusMessage(_:), untilFinished().
    requestInput namespaces keys (key, key#2, ...), so a key is never reused in the task's
    life. A requestInput call that the work cancels withdraws its requests, and the task returns
    to working.
  • HandlerContext.runAsTask(ttl:pollInterval:_:) and Server.runAsTask(ttl:pollInterval:_:):
    create a task when the request can use one and run the body inline otherwise.

Rule at a task limit: a required tool, or a v1 call with task, fails with -32603 before the
work starts. Any other call runs inline. design/tasks.md gives the reason: a v1 client that
sent task cannot read a tool result in reply, and a required tool is one its author never
runs inline. The error comes before the work, so a retry is safe.

Server (Sources/MCP/Server/Server.swift, StatelessRequests.swift)

  • withTasks(_:) registers default handlers for the five task methods. A handler the
    application registered for a task method stays.

  • Before the tools/call handler runs, the server reads the tool's execution.taskSupport
    from the tools/list handler's output (cached with the x-mcp-header parameters until the
    tool list changes) and decides how the call may run:

    taskSupport 2025-11-25 2026-07-28
    absent, forbidden -32601 when the call has task never a task
    optional the client's choice a task for clients that declare the extension
    required -32601 when the call has no task -32021 for clients that do not declare the extension
  • Capabilities are derived per revision. At 2026-07-28, server/discover declares
    extensions["io.modelcontextprotocol/tasks"] and no tasks slot. At 2025-11-25, initialize
    declares capabilities.tasks (cancel, requests.tools.call, and list only with a
    principal). Before 2025-11-25, no task capability.

  • tools/list drops execution except at 2025-11-25.

  • v2: tasks/get, tasks/update and tasks/cancel refuse an undeclared client with -32021
    before any lookup. tasks/result and tasks/list are removed methods (-32601);
    tasks/update is stateless-only. Cancel on a finished task is an acknowledgement.

  • v1: tasks/result waits for the task to finish and returns what the call returned, with
    related-task _meta, or its JSON-RPC error; a cancelled task gives -32603. Meanwhile it
    sends the task's input requests on its own stream, with related-task _meta. A request the
    client fails fails the work that waits on it. A request left unanswered because the stream
    ended is sent by the next tasks/result. When the task finishes, delivery stops and the
    outstanding requests are withdrawn with notifications/cancelled. tasks/list pages the
    caller's tasks, 100 at a time. Cancel on a finished task is -32602.

  • Inline on a handshake connection, the work asks for input through server requests. Inline at
    2026-07-28 it cannot ask: requestInput fails with -32021.

  • A tools/call cancelled after its handler created a task gets no answer, and the server
    cancels the task: no client knows its id.

  • Notifications: the manager hands each change to each observer in order. v1: the server that
    created the task sends notifications/tasks/status on its connection when the status changes,
    without related-task metadata. TaskContext.reportProgress sends progress for the call's
    progress token for the task's life (and for the request when the work runs inline); v2 tasks
    report no progress. v2: a subscriptions/listen filter may name taskIds. The
    acknowledgement keeps the caller's own v2 tasks; a client that did not declare the extension
    is refused with -32021. Each change of a named task goes out as notifications/tasks with
    the task as tasks/get returns it. A server stops observing on stop().

Client (Sources/MCP/Client/Client.swift, Sources/MCP/Client/ClientTasks.swift, new)

  • Configuration.tasks (Configuration.Tasks, nil by default): poll bounds
    (minimumPollInterval 100 ms, maximumPollInterval 30 s, defaultPollInterval 1 s),
    augmentation, requestedTTL. When set, each 2026-07-28 request declares the extension.
  • Configuration.Tasks.Augmentation (open struct): whenRequired (default), whenSupported,
    never. At 2025-11-25 the client adds task only when the server declares
    tasks.requests.tools.call and the client listed the tool with a matching
    execution.taskSupport. The client records task support from every tools/list.
  • callTool drives a returned task with TaskHandle.result(). It polls tasks/get at the
    server's interval, within the configured bounds; a task notification ends the wait early,
    also when it arrived before the wait.
    • v2: answers new inputRequests with the registered handlers through tasks/update.
    • v1: calls tasks/result once the task waits for input or finished; the server's requests on
      that stream reach the same handlers.
    • Completed: the tool result. Failed: the error is thrown (v1 with a tool error: the isError
      result). Cancelled: TaskCancelledError, also when the task is cancelled while
      tasks/result waits.
    • A throwing handler, or cancellation of the caller, sends tasks/cancel.
  • callTool drives a task also when Configuration.tasks is nil.
  • When the answer to a tools/call the client cancelled arrives and names a task, the client
    sends tasks/cancel.
  • Low level: startToolCall returns a task-creating result as is; task(_:), task(id:),
    getTask, updateTask, cancelTask, taskResult, listTasks.

Conformance fixture (conformance/everything-server/Tasks.swift, new; main.swift)

  • The seven tools of the tasks-* scenarios: greet, slow_compute, failing_job,
    protocol_error_job, confirm_delete, multi_input, test_tool_with_task.
  • One TaskManager for every server of the process, poll interval 500 ms. Its principal is
    the Mcp-Session-Id header, so the fixture declares tasks.list at 2025-11-25.

Interop

  • interop/ts-client/ (new): package.json pins @modelcontextprotocol/sdk 1.32.2 and zod
    4.1.12, installed with npm ci from package-lock.json. client.mjs runs the tasks
    profile on the TypeScript SDK. server.mjs serves the task tools on the TypeScript SDK's
    SEP-1686 runtime, over HTTP (port 3401) and stdio. It has no protocol_error_job and no
    test_tool_with_task.
  • interop/swift-client/main.swift: the tasks profile, ten checks.
  • interop/go-client/main.go, interop/python-client/client.py: the tasks profile. The Go
    and Python SDKs have no tasks runtime: they skip the lifecycle checks and run
    task-tool-inline and task-required-refused.
  • scripts/run-interop.sh: installs the TypeScript SDK into .build/interop/ts, starts the
    TypeScript server, runs the tasks cells. interop/report.py: the ts SDK and the tasks
    profile.
  • interop/README.md, interop/RESULTS.md: the profile, its checks and the findings.

CI

  • scripts/ci/fuzz.sh: builds with --disable-build-manifest-caching. The fuzz package
    depends on the SDK by path, and with the cached build manifest a source file added to MCP
    was missing from the fuzz build until the scratch directory was cleared.
  • scripts/ci/interop.sh requires node. .github/workflows/ci.yml: the macOS interop job
    sets up Node 22.

Docs

  • design/tasks.md (new): the model, the two wire forms, storage and work, the handler API,
    serving each revision, notifications, the client, alternatives and open questions.
    design/design.md indexes it.
  • docs/src/server.src.md, docs/src/client.src.md: a Tasks section each, with snippets
    (Examples/Snippets/{Server,Client}/Tasks.swift) that the snippet tests run at both
    revisions. docs/src/protocol.src.md: taskIds on listen streams and the task error codes.
    docs/src/rough_edges.src.md: both task items are implemented. Generated docs/*.md and
    README.md are rewoven.
  • ROADMAP.md: tasks move from "Planned" to implemented. CHANGELOG.md: tasks among the 1.0.0
    features. docs/src/migration.src.md: tasks among the opt-in features. CLAUDE.md: the code
    layout.

Diagram

2026-07-28 (v2): the server decides.

sequenceDiagram
    participant C as Client
    participant S as Server
    participant M as TaskManager
    C->>S: tools/call, _meta declares io.modelcontextprotocol/tasks
    S->>S: read execution.taskSupport from tools/list
    S->>M: create the task and start the work
    S-->>C: resultType task, taskId, ttlMs, pollIntervalMs
    loop until the task is terminal
        C->>S: tasks/get (Mcp-Name is the taskId)
        S-->>C: status working, or input_required with inputRequests
        opt input_required
            C->>S: tasks/update with inputResponses
            S->>M: record the answers, the work resumes
        end
    end
    S-->>C: tasks/get, status completed, result inlined
Loading

2025-11-25 (v1): the client asks.

sequenceDiagram
    participant C as Client
    participant S as Server
    C->>S: initialize
    S-->>C: capabilities.tasks (cancel, requests.tools.call)
    C->>S: tools/call with task ttl
    S-->>C: result with task, status working
    C->>S: tasks/get
    S-->>C: status input_required
    C->>S: tasks/result
    S-->>C: elicitation/create with related-task _meta, on the tasks/result stream
    C->>S: elicitation result
    S-->>C: notifications/tasks/status, status working
    S-->>C: tasks/result answer, the call result with related-task _meta
Loading

API changes

Added

Symbol Notes
TaskStatus open struct: working, inputRequired, completed, failed, cancelled; isTerminal
TaskSupport open struct: forbidden, optional, required
TaskMetadata the task request parameter (ttl)
TaskSnapshot the reported task; callToolResult, createdDate, lastUpdatedDate
GetTask, UpdateTask, CancelTask, GetTaskPayload, ListTasks Method types
TaskStatusNotification, TaskUpdatedNotification Notification types
ExtensionID.tasks io.modelcontextprotocol/tasks
ResultType.task "task"
MetaKey.relatedTask, Metadata.relatedTaskID io.modelcontextprotocol/related-task
ProtocolProfile.usesTaskAugmentation, usesTasksExtension per-revision flags
SubscriptionFilter.taskIds new defaulted init parameter
Tool.execution, Tool.Execution new defaulted init parameter
CallTool.Parameters.task new defaulted init parameter
CallTool.Result.task internal(set): set only by the SDK
Server.Capabilities.tasks, Server.Capabilities.Tasks the 2025-11-25 slot; derived by withTasks
Server.withTasks(_:) default manager TaskManager()
HandlerContext.runAsTask(ttl:pollInterval:_:), Server.runAsTask(ttl:pollInterval:_:) inline outside a handler
TaskContext taskID, request, isTask, requestInput(_:), elicit(message:requestedSchema:), reportProgress(_:total:message:), setStatusMessage(_:), untilFinished()
TaskManager actor; Configuration, Principal, store, configuration, init(store:configuration:principal:), record(id:), complete(_:with:), fail(_:with:), cancel(_:)
TaskRecord the stored form; expiresAt, isExpired(at:)
TaskStore, InMemoryTaskStore protocol and actor
Client.Configuration.tasks, Client.Configuration.Tasks, Tasks.Augmentation new defaulted init parameter
TaskHandle id, initial, snapshot(), update(_:), cancel(), result()
TaskCancelledError taskID, statusMessage
Client.task(_:), task(id:), getTask(_:), updateTask(_:inputResponses:), cancelTask(_:), taskResult(_:), listTasks(cursor:) low-level calls

Changed

Symbol Change
Client.callTool(name:arguments:meta:) drives a returned task to its result; adds task at 2025-11-25 per augmentation
Client.startToolCall(name:arguments:meta:) adds task like callTool; returns a task-creating result as is

Removed: none.

Behavior changes

  • tools/list responses omit execution except at 2025-11-25.
  • With withTasks: a tools/call to a required tool is refused before its handler for a
    client that cannot use tasks (-32601 at 2025-11-25, -32021 at 2026-07-28), and a 2025-11-25
    call with task to a tool that does not allow tasks gets -32601.
  • With withTasks: the server declares tasks per revision (server/discover extension at
    2026-07-28, capabilities.tasks at 2025-11-25, nothing earlier).
  • At a task limit, a required tool or a 2025-11-25 call with task gets -32603 before the
    work; other calls run inline.
  • A tools/call cancelled after its handler created a task gets no answer, and its task is
    cancelled.
  • The client: callTool returns the task's outcome instead of a result without content when
    the server answers with a task. A late answer to a cancelled tools/call that names a task
    gets tasks/cancel.
  • With Configuration.tasks set, each 2026-07-28 request declares
    io.modelcontextprotocol/tasks in its client capabilities.
  • Server.Configuration.maxResourceSubscriptions also caps the task ids of one listen stream.

Conformance

Baseline entries (server / client):

Leg Before (P23 (#348)) After
--spec-version 2025-11-25 0 / 0 0 / 0
--spec-version 2026-07-28 0 / 0 0 / 0
default 25 / 0 0 / 0
  • Cleared in the default leg: the 25 server entries of nine tasks-* scenarios
    (tasks-capability-negotiation, tasks-dispatch-and-envelope, tasks-lifecycle,
    tasks-mrtr-composition, tasks-mrtr-input, tasks-request-headers,
    tasks-request-state-removal, tasks-required-task-error, tasks-wire-fields).
  • The harness has no 2025-11-25 tasks scenarios. The other legs and the tier scores do not
    change.

Interop

  • New profile tasks: 22 cells. Totals: 127 client-server cells (was 105), 1811 checks (was
    1569), 19 failures (was 11).
  • Cells: the Swift, Go and Python clients against the Swift everything-server in both eras, the
    TypeScript client against it at 2025-11-25, and every client against the TypeScript task
    server at 2025-11-25; HTTP and stdio each.
  • Checks: task-create, task-input, task-partial-input, task-tool-error,
    task-protocol-error, task-cancel, task-mrtr-composition (2026-07-28), task-list
    (2025-11-25), task-tool-inline, task-required-refused.
  • Swift and TypeScript at 2025-11-25: each SDK's client drives the other's tasks (creation,
    polling, input on the tasks/result stream, a tool error as a failed task, cancellation,
    listing). Every check that depends on the Swift SDK passes.
  • The 8 new failures are all task-required-refused against the TypeScript server, for every
    client. A tools/call without task to a tool with taskSupport: "required" comes back as
    an isError tool result whose text names -32601 (to the Go client, which sends no
    arguments, a -32603 error). 2025-11-25 says the server MUST answer -32601. The README
    records this as a TypeScript server bug.

Tests

  • Tests/MCPTests/TaskTests.swift (new), suites:
    • "Task wire types": both encodings, decoding of both generations, create results, cancel
      results, tasks/update parameters, Tool.execution, profiles, Mcp-Name, related-task
      metadata.
    • "Tasks at 2026-07-28": discovery, inline for undeclared clients, -32021 gating, removed
      methods, cancel, outcomes, input through tasks/update, unique keys, TTL, a cancelled call
      that created a task, withdrawn input, complete(_:with:), limits, principals, an
      input-required round that ends in a task.
    • "Tasks over HTTP at 2026-07-28": Mcp-Name must carry the task id.
    • "Client tasks at 2026-07-28", "Client tasks at 2025-11-25": driving, handlers, outcomes,
      cancellation, poll bounds, augmentation, low-level calls.
    • "Tasks at 2025-11-25": capabilities, nested create, tasks/result, input on its stream,
      withdrawal on cancel, tasks/list paging and visibility.
    • "Tasks at every revision": a task tool runs inline before 2025-11-25 and as a task from
      2025-11-25 on, for every revision from 2024-11-05 to 2026-07-28.
    • "Task notifications": status notifications, turning them off, v1 progress, no v2 progress,
      taskIds on listen streams, a notification that wakes the client's poll.
    • "Late task answers": a late answer that names a task gets tasks/cancel.
  • Examples/Tests/{Server,Client}SnippetTests.swift: the task snippets at both revisions.
  • At ecaa04b, swift test passes 981 swift-testing tests in MCPTests and 104 snippet tests on macOS, and 1069 tests on Linux (scripts/ci-linux.sh build-test).

Review notes

  • No public type is named Task (it would shadow Swift.Task): TaskSnapshot, TaskRecord,
    TaskHandle, TaskContext.
  • CallTool.Result.task has an internal setter. A handler cannot hand a task to a client that
    cannot use one: runAsTask decides.
  • Tool.execution decodes with try?: a malformed execution reads as absent (forbidden).
  • A task is a durable handle, not durable execution. The work, the input waits and the change
    waiters stay in memory. After a restart, the owner of a durable store marks working tasks
    failed.
  • Without a principal, tasks rely on 128-bit random ids, every task has the same owner, and
    only maxActiveTasks applies. There is no session default: it would break v1 tasks read from
    a new session, and 2026-07-28 has no sessions.
  • The cost of inline work at a limit: it can hold an HTTP request as long as it runs.
  • v1 input is sent only on the tasks/result stream, as the TypeScript SDK does; sending it
    also on the GET stream or stdio would duplicate JSON-RPC ids.
  • Not implemented: tasks hosted by the client (v1 task-augmented sampling and elicitation),
    and the SEP-2663 SHOULD that lets 2026-07-28 clients read 2025-11-25 tasks. The SDK reads a
    task only at its own generation.
  • tasks/list pages from the full list each time: fine for the in-memory store, a scan for
    large stores.
  • interop/RESULTS.md names 3aa22e7 as the last Sources/ change: a commit from before this
    PR was squashed. --check compares the result rows, not the header.

Verification

swift build
swift test
swift package generate-documentation --target MCP --warnings-as-errors
swift scripts/doc-coverage.swift
swift scripts/weave.swift --check
BIN=$(swift build --show-bin-path)
scripts/run-conformance.sh --spec-version 2025-11-25 --bin-path "$BIN"
scripts/run-conformance.sh --spec-version 2026-07-28 --bin-path "$BIN"
scripts/run-conformance.sh --bin-path "$BIN"
scripts/run-conformance.sh --requirements 2025-11-25 --bin-path "$BIN"
scripts/run-conformance.sh --requirements 2026-07-28 --bin-path "$BIN"
scripts/run-interop.sh --check
scripts/ci-linux.sh fuzz 60
  • The three conformance legs pass at their baselines; the default leg's baseline is empty.
  • The interop matrix matches interop/RESULTS.md.
  • On macOS scripts/ci/run-jobs.sh --strict and on Linux scripts/ci-linux.sh --strict all pass
    every job, the fuzz targets included.

AI usage disclosure: the changes, the tests, the commit messages and this description were written with Claude Opus 5.5 and reviewed by the authors.

Tasks for tools/call, with one model and two wire forms. At 2025-11-25
(SEP-1686) the client asks for a task with the task parameter and reads
the outcome with tasks/result. At 2026-07-28 (SEP-2663, the
io.modelcontextprotocol/tasks extension) the server decides, tasks/get
inlines the outcome, and the client answers input with tasks/update.

Server: withTasks(_:) serves the task methods, and a tools/call handler
returns runAsTask { task in ... }. The server reads each tool's
execution.taskSupport from the tools/list handler, gates the call, and
creates a task only when the client can use one. A TaskManager runs the
work over a TaskStore (InMemoryTaskStore), with limits, an optional
principal, expiry, status notifications, task progress and taskIds on
listen streams. Capabilities are derived for each revision, and
tools/list drops execution except at 2025-11-25. At a task limit, a
required tool or a 2025-11-25 call with task gets -32603 before the
work; other calls run inline. A task whose creating call was cancelled
is cancelled.

Client: Configuration.tasks opts in. callTool drives a returned task to
its result at either revision: it polls, answers input through
tasks/update or the tasks/result stream, and throws
TaskCancelledError for a cancelled task. TaskHandle and the low-level
task calls are public. A late answer to a cancelled tools/call that
names a task gets tasks/cancel.

The everything-server serves the tools of the tasks-* scenarios, so
the default-leg baseline is empty. The interop matrix gains a tasks
profile, and a TypeScript SDK driver and task server at 2025-11-25.
fuzz.sh builds with --disable-build-manifest-caching, so the fuzz build
sees new MCP sources. design/tasks.md and the guides describe it.
- Server reads tool schemas and task support from the tools/list handler
  once per tools/call, under the caller's context, instead of keeping the
  first caller's view for every later caller: a tool listed only for
  some callers was refused or never ran as a task for them. The header
  check and the task check of one call share the pass, a failed pass
  costs one walk per call, and cancelling the call cancels the walk
  (checked between pages). Server.stop() no longer touches the removed
  cache; it still cancels running handlers.
- TaskManager reclaims expired running tasks before a limit refuses a
  call, so expired tasks no longer hold the limit forever.
- waitUntilFinished returns once its task expired, and change waits end
  at the task's expiry, so tasks/result for an expired task answers
  -32602 instead of waiting 30 seconds.
- Change waiters are keyed by token and removed when the wait ends by
  timeout or cancellation; expiry and retirement wake and drop them.
- tasks/result for a stored task that does not run in this process polls
  the store at the task's poll interval instead of spinning.
- With a principal hook, a caller it returns nil for gets no tasks: none
  is created (a required tool fails with -32603, others run inline), it
  sees none and lists none. Callers without a principal no longer share
  one owner. The everything-server's hook names sessionless callers.
- tasks/result releases input it could not deliver because the server
  stopped or the transport failed, so the next tasks/result sends it
  again; only an error answer from the client fails the input. Bridged
  requests rethrow transport errors as they are.
- At 2026-07-28 the client reads a task created in a state other than
  working with tasks/get first: the create result carries no outcome,
  so a completed task failed and a failed one lost its error.
- A tools/call whose send fails, or whose pending request is otherwise
  dropped, leaves pendingToolCalls.
- TaskStore.update documents that it must not add back a task that is
  not stored.
- Updated tests that counted one tools/list pass across calls.
- everything-server: the task tool reads its seconds argument with
  Value.numberValue (main's #226).
- Correct the Mcp-Param-* docs (SEP-2243): a tools/call to a tool
  hidden for an invalid x-mcp-header annotation is refused with -32020
  when it carries arguments or Mcp-Param-* headers. A call with
  neither has nothing to check and runs; refusing it would cost a
  tools/list pass on every argument-less call. Updates the doc comment
  of Server.parameterHeaderError and the server, protocol and
  troubleshooting guides. No behaviour change.

- TaskManager.Configuration.maxActiveTasks and InMemoryTaskStore: document
  that finished tasks, with their results, stay in the store until their
  lifetime ends, so maximumTTL (or a store that limits what it keeps)
  bounds that memory.
- tasks/update for an unfinished task that this manager does not run (one a
  shared store holds for another process) fails with -32603 instead of
  answering success and dropping the responses, which the client then never
  sends again.
- TaskHandle.result(): a connectionClosed or transportError while polling or
  waiting on tasks/result is rethrown without sending tasks/cancel, so a
  network failure leaves the task for Client.task(id:) to drive again.
  Handler errors and cancelling the caller still cancel the task.
- Server: a 2025-11-25 task that expires before it finishes emits no last
  change, so its notifiedTasks entry stayed until stop(). The server keeps
  each task's expiry and forgets expired tasks when it tracks a new one.
- An unknown execution.taskSupport is treated as forbidden on the server,
  as TaskSupport documents and the client already does. Server compared
  against .forbidden, so an unknown value acted as optional: at
  2026-07-28 the tool ran as a task for a client that declared the
  extension, and at 2025-11-25 a call with task created one instead of
  failing with -32601. The tools/list pass now reads an unknown value as
  forbidden. The server and client guides and design/tasks.md say so.
- Client.detachConnection forgets the task state of the connection: the
  tools' task support, the pollers' wakeups and the notified tasks. A
  TaskHandle.result() waiting between polls slept until its poll timer
  (up to maximumPollInterval) and then failed with "Client connection
  not initialized"; it now ends at once with the connection's error, so
  a connectionClosed or transportError still leaves the task for
  Client.task(id:) to drive again. A wait that starts after the
  connection closed throws connectionClosed. After a reconnect, callTool
  no longer adds task for a tool the previous server listed as
  task-capable, until listTools runs on the new connection.
- Keep data: URL strings as written in a task's result. TaskManager
  converted a work's result and complete(_:with:)'s result with
  Value(_:), which turns "data:,hello" into .data, sent as
  "data:text/plain;base64,aGVsbG8=" by tasks/get, tasks/result and the
  2026-07-28 task notification, while the same tool's inline result
  keeps the string. These conversions, the notification's snapshot and
  the re-read of a tasks/update response now use Value.preservingStrings.
varun06
varun06 previously approved these changes Nov 25, 2026

@varun06 varun06 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Already reviewed and still looking good.

Base automatically changed from conformance/p23-harness to rel/1.0.0 November 25, 2026 12:49
@jeanmatthieu
jeanmatthieu dismissed varun06’s stale review November 25, 2026 12:49

The base branch was changed.

@jeanmatthieu
jeanmatthieu merged commit e27fd8e into rel/1.0.0 Nov 25, 2026
@jeanmatthieu
jeanmatthieu deleted the conformance/p24-tasks branch November 25, 2026 12:50
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