a2aproject / a2aproject/a2a-samples

a2a_mcp peer closed connection without sending complete message body

Đang mở
#144 4 bình luận 0 reaction 1 người được giao Được @rajeshvelicheti nhận Xem trên GitHub
Ngôn ngữ chính
Jupyter Notebook
Star
1.8k
Fork
751
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### What happened?

Using the projects cli tool to test the air ticketing agent, it closes the connection without sending the complete body.

### Relevant log output

```shell
python . --agent http://localhost:10103 ok | 3.13.4 a2a-samples py | 3.12 py
Will use headers: {}
======= Agent Card ========
{"capabilities":{"pushNotifications":true,"stateTransitionHistory":false,"streaming":true},"defaultInputModes":["text","text/plain"],"defaultOutputModes":["text","text/plain"],"description":"Helps book air tickets given a criteria","name":"Air Ticketing Agent","skills":[{"description":"Helps with booking air tickets given a criteria","examples":["Book return tickets from SFO to LHR, starting June 24 2025 and returning 30th June 2025"],"id":"book_air_tickets","name":"Book Air Tickets","tags":["Book air tickets"]}],"url":"http://localhost:10103/","version":"1.0.0"}
========= starting a new task ========

What do you want to send to the agent? (:q or quit to exit): book a flight from SFO
Select a file path to attach? (press enter to skip):
stream event => {"contextId":"395d8b92e6ad44e6a3f07523d1585ea6","history":[{"contextId":"395d8b92e6ad44e6a3f07523d1585ea6","kind":"message","messageId":"c81e9eea-1b07-41f6-860b-c01a5e2a758f","parts":[{"kind":"text","text":"book a flight from SFO"}],"role":"user","taskId":"3bbec46e-bb6a-46f5-a6b9-3efe8fb30505"}],"id":"3bbec46e-bb6a-46f5-a6b9-3efe8fb30505","kind":"task","status":{"state":"submitted"}}
Traceback (most recent call last):
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
yield
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpx/_transports/default.py", line 271, in __aiter__
async for part in self._httpcore_stream:
yield part
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpcore/_async/connection_pool.py", line 407, in __aiter__
raise exc from None
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpcore/_async/connection_pool.py", line 403, in __aiter__
async for part in self._stream:
yield part
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpcore/_async/http11.py", line 342, in __aiter__
raise exc
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpcore/_async/http11.py", line 334, in __aiter__
async for chunk in self._connection._receive_response_body(**kwargs):
yield chunk
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpcore/_async/http11.py", line 203, in _receive_response_body
event = await self._receive_event(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpcore/_async/http11.py", line 213, in _receive_event
with map_exceptions({h11.RemoteProtocolError: RemoteProtocolError}):
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.4/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 162, in __exit__
self.gen.throw(value)
~~~~~~~~~~~~~~^^^^^^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.RemoteProtocolError: peer closed connection without sending complete message body (incomplete chunked read)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/a2a/client/client.py", line 259, in send_message_streaming
async for sse in event_source.aiter_sse():
yield SendStreamingMessageResponse(**json.loads(sse.data))
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpx_sse/_api.py", line 39, in aiter_sse
async for line in self._response.aiter_lines():
...<3 lines>...
yield sse
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpx/_models.py", line 1031, in aiter_lines
async for text in self.aiter_text():
for line in decoder.decode(text):
yield line
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpx/_models.py", line 1018, in aiter_text
async for byte_content in self.aiter_bytes():
...<2 lines>...
yield chunk
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpx/_models.py", line 997, in aiter_bytes
async for raw_bytes in self.aiter_raw():
...<2 lines>...
yield chunk
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpx/_models.py", line 1055, in aiter_raw
async for raw_stream_bytes in self.stream:
...<2 lines>...
yield chunk
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpx/_client.py", line 176, in __aiter__
async for chunk in self._stream:
yield chunk
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpx/_transports/default.py", line 270, in __aiter__
with map_httpcore_exceptions():
~~~~~~~~~~~~~~~~~~~~~~~^^
File "/opt/homebrew/Cellar/python@3.13/3.13.4/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 162, in __exit__
self.gen.throw(value)
~~~~~~~~~~~~~~^^^^^^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.RemoteProtocolError: peer closed connection without sending complete message body (incomplete chunked read)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/hosts/cli/__main__.py", line 252, in
asyncio.run(cli())
~~~^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/asyncclick/core.py", line 1211, in __call__
return anyio.run(self._main, main, args, kwargs, **opts)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/anyio/_core/_eventloop.py", line 74, in run
return async_backend.run(func, args, {}, backend_options)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 2310, in run
return runner.run(wrapper())
~~~~~~~~~~^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.4/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.4/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 2298, in wrapper
return await func(*args)
^^^^^^^^^^^^^^^^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/asyncclick/core.py", line 1214, in _main
return await main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/asyncclick/core.py", line 1126, in main
rv = await self.invoke(ctx)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/asyncclick/core.py", line 1496, in invoke
return await ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/asyncclick/core.py", line 829, in invoke
rv = await rv
^^^^^^^^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/hosts/cli/__main__.py", line 84, in cli
continue_loop, _, taskId = await completeTask(
^^^^^^^^^^^^^^^^^^^
...<7 lines>...
)
^
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/hosts/cli/__main__.py", line 166, in completeTask
async for result in response_stream:
...<13 lines>...
print(f"stream event => {event.model_dump_json(exclude_none=True)}")
File "/Users/greg/Dev/a2a/a2a-samples/samples/python/.venv/lib/python3.13/site-packages/a2a/client/client.py", line 269, in send_message_streaming
raise A2AClientHTTPError(
503, f'Network communication error: {e}'
) from e
a2a.client.errors.A2AClientHTTPError: HTTP Error 503: Network communication error: peer closed connection without sending complete message body (incomplete chunked read)
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.