modelcontextprotocol / modelcontextprotocol/csharp-sdk
Remove use of AsyncLocal to track Task input_required status
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Description
Do we really need to use the execution context to track the automatic status updates? Any request would be made via the request context. It also seems weird to me that this PR doesn't make any changes to McpSessionHandler. I figured a lot of the task handling would be the same for the client and server, so it makes sense for the logic tracking related requests to go there.
Originally posted by @halter73 in https://github.com/modelcontextprotocol/csharp-sdk/pull/1170#discussion_r2734583079
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the discussion in pull request 1170 and trace how AsyncLocal tracks automatic Task input_required status. Compare that path with the request context and McpSessionHandler, then determine whether related-request tracking can be shared for clients and servers. Done means the tracking no longer relies on execution context and the affected behavior remains covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend-api-design
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100