Add stateless backend-scoped task handles - #97
Open
lucarlig wants to merge 3 commits into
Open
Conversation
lucarlig
force-pushed
the
user/luca/issue-6185-task-handles
branch
2 times, most recently
from
August 18, 2026 09:24
797be0f to
1e26c44
Compare
lucarlig
changed the base branch from
main
to
user/luca/stabilize-gateway-test-ports
August 18, 2026 09:24
Base automatically changed from
user/luca/stabilize-gateway-test-ports
to
main
August 18, 2026 09:25
Signed-off-by: lucarlig <luca.carlig@ibm.com>
Signed-off-by: lucarlig <luca.carlig@ibm.com>
Signed-off-by: lucarlig <luca.carlig@ibm.com>
lucarlig
force-pushed
the
user/luca/issue-6185-task-handles
branch
from
August 18, 2026 09:25
1e26c44 to
e8cc86c
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.
Summary
cfth1stateless task-handle codec for modern MCP TasksWhy this is needed
Modern MCP Tasks return identifiers that clients later reuse 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 only the routing context and can be decoded by any replica sharing the key.
Binding the handle to trusted typed identities prevents accidental use of caller-controlled strings, cross-tenant or cross-policy replay, and routing after backend removal or reassignment. Lifecycle requests 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 the security and routing primitive only. It does not expose Tasks methods or add unused runtime configuration ahead of the handlers that will consume it.
Stack
This is the top layer of native GitHub stack #100, above the independent test-listener stabilization in PR #95. Its review diff against #95 is limited to task-handle code, dependencies, and matching architecture documentation.
This supersedes #84. During correction of an earlier stack order, GitHub recorded #84 as merged into PR #95's branch; it was not merged into
main.Validation
cargo fmt --all -- --checkcargo clippy --locked --workspace --all-targets -- -D warningscargo nextest run --locked --workspace— 231 passedcargo deny checkcargo build --locked --workspacecargo shear --check-test-targets --deny-warnings --lockedmdbook build _context/wikimdbook test _context/wikigit diff --check user/luca/stabilize-gateway-test-ports...HEADCloses IBM/mcp-context-forge#6185