-
Notifications
You must be signed in to change notification settings - Fork 272
Description
What happened?
Environment
- a2a-python: v0.3.7
- Python: 3.13
- Transport: REST (RestTransport)
- Server: FastAPI + Uvicorn(A2A REST backend)
Expected behavior
history_length=0 should result in ?historyLength=0 being sent, yielding zero history items (or the field being omitted).
Actual behavior
No historyLength parameter is sent when 0 is provided, leading to full history being returned.
Steps to Reproduce
task = await client.get_task(TaskQueryParams(id=task_id, history_length=0))
It looks like request.history_length is evaluated directly here, so 0 is treated as falsy:
a2a-python/src/a2a/client/transports/rest.py
Lines 214 to 220 in 4a4b4a9
| response_data = await self._send_get_request( | |
| f'/v1/tasks/{request.id}', | |
| {'historyLength': str(request.history_length)} | |
| if request.history_length | |
| else {}, | |
| modified_kwargs, | |
| ) |
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels