[Superseded by #97] Add stateless backend-scoped task handles - #84
Merged
lucarlig merged 0 commit intoAug 18, 2026
Merged
Conversation
lucarlig
force-pushed
the
user/luca/issue-6185-task-handles
branch
from
August 11, 2026 11:01
232aac3 to
80d8ada
Compare
lucarlig
marked this pull request as ready for review
August 11, 2026 13:25
lucarlig
changed the base branch from
main
to
user/luca/stabilize-gateway-test-ports
August 18, 2026 08:46
lucarlig
force-pushed
the
user/luca/issue-6185-task-handles
branch
from
August 18, 2026 08:56
fe0a5e0 to
50b0dab
Compare
lucarlig
force-pushed
the
user/luca/stabilize-gateway-test-ports
branch
from
August 18, 2026 08:56
de44c04 to
70605f4
Compare
Contributor
Author
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.
Summary
cfth1stateless task-handle codec for modern MCP Tasksh2to patched0.4.16after the fresh CI advisory database flagged0.4.15Why this is needed
Modern MCP Tasks return identifiers that clients reuse later with
tasks/get,tasks/update, andtasks/cancel. Those identifiers are backend-specific and may behave like bearer tokens. Returning them directly would expose upstream details and would not safely preserve which backend owns a task.The future dataplane is horizontally scaled and stateless. A process-local task map would require session affinity, while a Redis task map would add hot-path state, expiry, and cleanup. An encrypted routing handle carries the minimum routing context and can be decoded by any replica sharing the key.
Binding the handle to the trusted authorization context, virtual host, configuration revision, backend ID, and backend generation prevents cross-tenant or cross-policy replay and fails closed after backend removal or reassignment. It also keeps authorization current: every lifecycle request must still validate the JWT, load effective configuration, enforce scope/RBAC policy, and verify the backend generation before making an upstream call.
This PR provides that security and routing primitive only. It does not expose Tasks methods or make the codec current handler behavior; those handlers remain follow-up work.
Validation
cargo fmt --all -- --checkcargo clippy --locked --workspace --all-targets -- -D warningscargo nextest run --locked --workspace— 231 passedcargo deny fetch && cargo deny check advisories licensescargo build --locked --workspacecargo shear --check-test-targets --deny-warnings --lockedmdbook build _context/wikimdbook test _context/wikiCloses IBM/mcp-context-forge#6185