Skip to content

fix: call tasks/result when task status is input_required#1174

Open
galagaevdc wants to merge 1 commit intomodelcontextprotocol:mainfrom
galagaevdc:fix/task-input-required-status
Open

fix: call tasks/result when task status is input_required#1174
galagaevdc wants to merge 1 commit intomodelcontextprotocol:mainfrom
galagaevdc:fix/task-input-required-status

Conversation

@galagaevdc
Copy link
Copy Markdown

@galagaevdc galagaevdc commented Apr 3, 2026

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

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Refactoring (no functional changes)
  • Test updates
  • Build/CI improvements

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

  • Tested in UI mode
  • Tested in CLI mode
  • Tested with STDIO transport
  • Tested with SSE transport
  • Tested with Streamable HTTP transport
  • Added/updated automated tests
  • Manual testing performed

Test Results and/or Instructions

Screenshots are encouraged to share your testing results for this change.

Checklist

  • Code follows the style guidelines (ran npm run prettier-fix)
  • Self-review completed
  • Code is commented where necessary
  • Documentation updated (README, comments, etc.)

Breaking Changes

None

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.
@galagaevdc galagaevdc force-pushed the fix/task-input-required-status branch from 16384f1 to 4aae0ca Compare April 5, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

input_required not being handled correctly

1 participant