Commit f380341
fix: use 'is not None' for related_request_id to handle id=0
When a JSON-RPC request uses id=0, notifications sent during tool
execution were not routed to the correct request stream because the
condition 'if related_request_id' evaluates to False for integer 0.
This caused notifications to be sent to the GET stream instead of the
POST stream for the specific request, making them invisible to clients
that don't have a GET SSE connection open (e.g. stateless mode).
Fix: change 'if related_request_id' to 'if related_request_id is not
None' in send_notification(), consistent with similar checks elsewhere
in the codebase (e.g. streamable_http.py line 984, 993, 997).
Fixes #1218
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 62575ed commit f380341
1 file changed
Lines changed: 1 addition & 1 deletion
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| |||
0 commit comments