feat: SEP-1686 Tasks#844
Open
devcrocod wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds SEP-1686 task augmentation support to existing MCP request types in kotlin-sdk-core, enabling callers to optionally request task-based (call-now / fetch-later) execution for tools and sampling.
Changes:
- Add optional
task: TaskMetadata?totools/callandsampling/createMessagerequest parameter types, plus convenience getters on the request wrappers. - Add/extend serialization tests ensuring
taskis encoded when present and omitted whennull(consistent withexplicitNulls = false). - Update the published API surface (
.apidump) to reflect the new parameters/getters.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| kotlin-sdk-core/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/types/ToolsTest.kt | Adds serialization tests for CallToolRequest with/without task augmentation. |
| kotlin-sdk-core/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/types/SamplingTest.kt | Adds encoding/round-trip tests for CreateMessageRequestParams.task. |
| kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/tools.kt | Introduces task into CallToolRequestParams and exposes it on CallToolRequest. |
| kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/sampling.kt | Introduces task into CreateMessageRequestParams and exposes it on CreateMessageRequest. |
| kotlin-sdk-core/api/kotlin-sdk-core.api | Updates API dump for the added task getter/parameter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+225
to
+226
| * @property task If specified, the caller is requesting task-augmented execution. The request | ||
| * will return a [CreateTaskResult] immediately, and the actual result can be retrieved later via `tasks/result`. |
Comment on lines
+225
to
+226
| * @property task If specified, the caller is requesting task-augmented execution. The request | ||
| * will return a [CreateTaskResult] immediately, and the actual result can be retrieved later via `tasks/result`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
finished SEP-1686
closes #421
Breaking Changes
none
Types of changes
Checklist