Skip to content

fix(tasks): report cancelled fixture status consistently - #487

Open
1fanwang wants to merge 3 commits into
modelcontextprotocol:mainfrom
1fanwang:1fannnw/fix-tasks-lifecycle-cancelled-status
Open

1fanwang wants to merge 3 commits into
modelcontextprotocol:mainfrom
1fanwang:1fannnw/fix-tasks-lifecycle-cancelled-status

Conversation

@1fanwang

@1fanwang 1fanwang commented Sep 3, 2026 •

Copy link
Copy Markdown

Motivation and Context

The tasks-lifecycle report omitted its cancelled-status check when task creation or polling failed. It also accepted a completed status for the cancellable fixture. The check now requires that fixture's cancelled status and reports missing prerequisites as failures. MCP cancellation remains cooperative.

Closes #485.

How Has This Been Tested?

On Node 22.17.0, the lifecycle regressions drive the real runner against local HTTP task fixtures. They require SUCCESS for cancelled, FAILURE for completed/failed, and an untestable failure for missing tasks or polling timeouts.

Before: 7169291. After: this PR's head. The dependency manifests are identical.

npm ci --ignore-scripts --cache .work-cache/npm
# On the before checkout, bring in the regression test:
git restore --source=897bb9830f0ba0dcd59ad77934b293a99464412f -- src/scenarios/server/tasks/lifecycle.test.ts
# Run on both checkouts:
npm test -- src/scenarios/server/tasks/lifecycle.test.ts --reporter=verbose --maxWorkers=2
Raw log excerpts

Before, completed fixture:

AssertionError: expected [] to deeply equal [ ObjectContaining{…} ]
- [
-   ObjectContaining {
-     "details": {
-       "statusAfterCancel": "completed",
-     },
-     "errorMessage": "slow_compute fixture contract requires status:\"cancelled\" after cancellation while running; got \"completed\"",
-     "status": "FAILURE",
-   },
- ]
+ []

      Tests  5 failed (5)
exit_code=1

After, including both cancelled and completed assertions:

      Tests  5 passed (5)
exit_code=0

Breaking Changes

None. Missing prerequisites now appear as a failure row.

Types of changes

  • Bug fix

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • Focused tests pass locally; full suite not run
  • I have added appropriate error handling
  • I have updated documentation as needed

Additional context

These fixtures are not an independent task-capable SDK.

AI disclosure: GitHub Copilot CLI wrote this change and its tests, and an automated coordinator reviewed the diff and test output before submission.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
@pcarleton

Copy link
Copy Markdown
Member

@panyam would you be willing to give this one a review?

@panyam

panyam commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Hey @pcarleton and @1fanwang very sorry about the late one. Went through it. Thanks heaps for this. Left a couple of (minor) comments.

Also added a live SDK run results. Branch merged onto 7169291, tasks-lifecycle run against three servers:

server lifecycle sep-2663-tasks-get-status-cancelled
C# SDK cbd8a58 (ConformanceServer, /stateless) 10/10 SUCCESS SUCCESS, statusAfterCancel: "cancelled"
Go SDK 8075fb3 (conformance/everything-server, no tasks support) 9 emitted, 8 FAILURE absent from the report
mcpkit f70e1488 (examples/tasks-v2) 10/10 SUCCESS SUCCESS, statusAfterCancel: "cancelled"

Nice to see 2 independent implementations satisfy the new check, both going from 9 to 10 green. I could not find task support in the official Go SDK, and its run is what the inline note above is about (did I miss something).

Also, the branch is based on 74edef3, where the eight wire-schema-valid failures that main has since fixed are still live. So a verification run on it would look redder than it should be. Worth doing a rebase.

Comment thread src/scenarios/server/tasks/lifecycle.ts
Comment thread src/scenarios/server/tasks/lifecycle.ts Outdated
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Signed-off-by: 1fanwang <1fannnw@gmail.com>
@1fanwang 1fanwang changed the title fix(tasks): validate cancelled terminal status fix(tasks): report cancelled fixture status consistently Sep 22, 2026
@panyam

panyam commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Thanks for the quick turn around @1fanwang - Ran it against the new head and both emit now. LGTM. @pcarleton good from my side.

This branch has not been deployed

No deployments
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.

tasks-lifecycle accepts completed status from its cancellable fixture

3 participants