Repository navigation
ServerSession methods (create_message, elicit_form) don't expose progress_callback parameter #1671
Description
Activity
- addedenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedready for workEnough information for someone to start working onEnough information for someone to start working onP2Moderate issues affecting some users, edge cases, potentially valuable featureModerate issues affecting some users, edge cases, potentially valuable feature
on Nov 25, 2025 - added a commit that references this issue
on Feb 12, 2026 I'd like to take this on — PR incoming.
I've added
progress_callback: ProgressFnT | None = Nonetocreate_message(),elicit_form(),elicit_url(), and the deprecatedelicit()wrapper onServerSession, plus threaded it through theelicitation.pyhelpers andContextAPI. The approach mirrors howClientSession.call_tool()already handles it.Includes E2E tests for both sampling and elicitation flows. All existing tests pass.
- addedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implementand removedready for workEnough information for someone to start working onEnough information for someone to start working on
on Apr 17, 2026 Hi @felixweinberger @maxisbey — this one lost
ready for workand picked upneeds decisionback in April, so rather than leave it in limbo I wanted to ask for a keep-or-close call.A few things that might make the decision easy:
- It closes an internal asymmetry rather than adding new surface.
send_request()already acceptsprogress_callbackand maps it toon_progress; theServerSessionconvenience methods (create_message,elicit_form,elicit_url) just don't forward it. The client direction already exposes it (ClientSession.call_tool(progress_callback=...), feat: support progress_callback propagation in ClientSession #1248), so this restores client/server symmetry. - It follows the existing public convention — the same per-method
progress_callbackkwarg already onServerSession.send_requestandClient.call_tool. - It's spec- and parity-backed. The 2025-06-18 progress utility allows progress notifications on requests from either party, and sampling/elicitation are server-initiated; the TS SDK already supports this (
Server.createMessage/elicitInputtakeRequestOptions, which carriesonprogress). Python'sServerSessionis the remaining gap. - feat: expose progress_callback in ServerSession methods #2041 is ready: it implements exactly the change described in the issue body, is rebased on current
mainand green, every new param defaults toNone(non-breaking), with two E2E tests on the sampling and elicitation paths.
I realize the issue isn't
ready for workright now — I'm really just asking whether you'd be open to clearing theneeds decision. "Not until v2 settles" is a perfectly good answer too; I'll keep the branch rebased either way. Happy to add tests or adjust the approach.Disclosure: I used AI assistance on this change. I've reviewed and tested every line, understand the mechanism, and can answer questions on it directly.
- It closes an internal asymmetry rather than adding new surface.
Summary
The
ServerSessionhigh-level methods for sending requests to clients (create_message,elicit_form) don't expose theprogress_callbackparameter, even though the underlyingBaseSession.send_request()fully supports it.This means servers can't easily receive progress notifications from clients during sampling or elicitation requests.
Current Behavior
Expected Behavior
Context
notifications/progressback to servers during request handlingBaseSession.send_request()already supportsprogress_callbackparameterClientSession.call_tool()exposesprogress_callbackfor the client→server directionRequestOptions.onprogressin bothcreateMessage()andelicitInput()tests/shared/test_progress_notifications.pydemonstrate the bidirectional flow worksSuggested Fix
Add
progress_callback: ProgressFnT | None = Noneparameter to:ServerSession.create_message()ServerSession.elicit_form()ServerSessionmethods that send requests to clientsAnd pass it through to
send_request().