File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ Pass `max_sse_event_size` when a server sends a large tool result or notificatio
5656
5757The default is 1 MiB per event, measured in bytes before the event is parsed. The limit applies to
5858POST responses, the GET stream, and resumed streams. An oversized event in a POST response or resumed
59- stream fails that request with an error naming the limit . On the background GET stream, the client logs
59+ stream fails that request with an SSE error . On the background GET stream, the client logs
6060the error and retries the stream. Set ` max_sse_event_size=None ` to disable the cap when you trust the
6161server and need larger events. JSON responses are unaffected. If you use ` ClientSessionGroup ` , set the
6262same option on ` StreamableHttpParameters ` .
Original file line number Diff line number Diff line change @@ -175,10 +175,12 @@ def handler(request: httpx2.Request) -> httpx2.Response:
175175 if request .method == "GET" :
176176 gets .append (request )
177177 if len (gets ) == 1 :
178- content = b'data : {"jsonrpc":"2.0","method":"notifications/message","params":{"data":"'
178+ content = b'retry: 0 \n \n data : {"jsonrpc":"2.0","method":"notifications/message","params":{"data":"'
179179 content += b"x" * 2048 + b'"}}\n \n '
180- else :
180+ elif len ( gets ) == 2 :
181181 content = b'data: {"jsonrpc":"2.0","method":"notifications/message","params":{"data":"ok"}}\n \n '
182+ else :
183+ return httpx2 .Response (500 )
182184 return httpx2 .Response (200 , content = content , headers = {"content-type" : "text/event-stream" })
183185 body = json .loads (request .content )
184186 if body .get ("method" ) == "initialize" :
You can’t perform that action at this time.
0 commit comments