Repository navigation
feat(mcp): adopt MCP Tasks for aether.task.send, with caller cancel - #22
Merged
Merged
Conversation
Contributor
Author
|
TLC result for |
Migration 020 adds "cancelled" to the sent_tasks state check. cancel_sent_task moves a waiting or working row to cancelled in one conditional update, so a delivery round that ends later cannot overwrite it. A task that the host may have, because it is working, has an attempt, or is in delivery, also gets one best-effort A2A Cancel frame over the direct or relay path. Released hosts already accept this frame. The Outbox spec models the caller cancel as a terminal state.
The server advertises io.modelcontextprotocol/tasks. A client that declares it gets a task handle at once, with the Aether task ID. tasks/get and tasks/cancel read the durable sent-task store, so a client that restarts can continue. tasks/cancel uses the caller cancel. A failed or undelivered task is completed with isError, as the spec requires for tool errors. Other clients keep the 20 s wait and the inbox tools.
TudorAndrei
force-pushed
the
feat/mcp-tasks
branch
from
November 30, 2026 12:18
e38b662 to
1cd4eff
Compare
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.
Why
A caller whose task takes longer than 20 s gets
status: waitingand must poll our own inbox tools. MCP has a standard for long tool calls: the Tasks extension (io.modelcontextprotocol/tasks). Tasks also needstasks/cancel, and Aether had no way for a caller to cancel a task that it sent.aether.task.cancelcancels only tasks that this node runs as host. Stacked on #20.What changes
stateDiagram-v2 [*] --> waiting: tools/call aether.task.send (client declares Tasks: task handle at once) waiting --> working: host takes the task waiting --> not_delivered: deadline working --> answered: host answers working --> failed: host fails, rejects, or its owner cancels waiting --> cancelled: tasks/cancel (no wire traffic, unless the task is in delivery) working --> cancelled: tasks/cancel (one best-effort A2A Cancel frame)tasks/getstatuswaiting,workingworking, with astatusMessageansweredcompleted,result= the same result asaether.task.sendfailed,not_deliveredcompletedwithisError(the spec reservesfailedfor JSON-RPC errors)cancelled(new)cancelledtasks/getandtasks/cancelread the durable sent-task store, not rmcp's in-memoryTaskManager. The stdio server stops with its client, and a client that restarts must be able to continue with the same task ID.aether.inbox.readandaether.inbox.list.aether.task.cancelkeeps its meaning (a task that this node runs for someone else). Its description now says so.Look at:
cancel_sentincrates/aether/src/outbox.rsand migration020_sent_task_cancelled.sql.Evidence
mise run fmt: pass.mise run lint: pass.cargo test --workspace: pass (486 + 82 + 8 + 3 tests, 98 feature scenarios).mise run hermes-plugin-test: OK, 3 skipped (Hermes is not onPYTHONPATH).sh scripts/tla.sh Outbox: the spec now has aCallerCancelaction. Result: pending at the time of writing. I will add it in a comment.tasks/getfor each state,tasks/cancel, andtasks/getfrom a new server instance (restart).Merge danger
Door: one-way
Blast radius: one node
Migration 020 rebuilds
sent_tasksto addcancelledto its state check. An older binary that opens this database can read acancelledrow that it does not know. The A2A Cancel frame is not new on the wire: released hosts already handle it (cancel_from). Race that stays: when a Cancel frame reaches the host before the task request does, the host ignores it and runs the task.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.