fix: call tasks/result when task status is input_required#1174
Open
galagaevdc wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
fix: call tasks/result when task status is input_required#1174galagaevdc wants to merge 1 commit intomodelcontextprotocol:mainfrom
galagaevdc wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
This was referenced Apr 3, 2026
Per the MCP spec (2025-11-25), when a client observes input_required status during task polling it must call tasks/result to give the server a chance to deliver queued elicitation/sampling requests. Previously the polling loop only called tasks/result after completed status, leaving the server unable to trigger elicitation. After elicitation is handled the task transitions back to working so taskCompleted is not set — polling continues until a terminal status is reached.
16384f1 to
4aae0ca
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
Fixes #1073
Per the MCP spec https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks#input-required-status, when a client observes input_required status during task polling it must call tasks/result to give the server a chance to deliver queued elicitation/sampling requests. Previously the polling loop only called tasks/result after completed status, leaving the server unable to trigger elicitation.
After elicitation is handled the task transitions back to working so taskCompleted is not set — polling continues until a terminal status is reached.
Type of Change
Changes Made
The fix adds an explicit input_required branch in the polling loop that calls tasks/result as required by the
https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks#input-required-status. After elicitation is handled the server transitions the task back to working, so the loop
continues polling until a terminal status is reached.
Related Issues
#1073
Testing
Test Results and/or Instructions
Screenshots are encouraged to share your testing results for this change.
Checklist
npm run prettier-fix)Breaking Changes
None