What happened?
Legacy EventConsumer.is_final_event (src/a2a/server/events/event_consumer.py) includes TASK_STATE_UNSPECIFIED in the stop set. That is the proto default (value 0), not a finished state.
Spec 4.1.3: unspecified is unknown/indeterminate. Terminal is COMPLETED / FAILED / CANCELED / REJECTED. V2 TERMINAL_TASK_STATES already omits unspecified.
If an agent enqueues a Task without setting status, or a status update that omits state, consume_all closes the queue. Later WORKING/COMPLETED events never arrive on the legacy message/send, stream, cancel, and subscribe paths.
Repro
- Enqueue
Task(id=..., context_id=...) with default status.
- Then enqueue WORKING and COMPLETED updates.
Observed: only the first Task is yielded and the queue is closed.
Expected: unspecified is non-final; WORKING and COMPLETED are still consumed.
Relevant log output
n/a. Covered by a consume_all unit test.
Code of Conduct
What happened?
Legacy
EventConsumer.is_final_event(src/a2a/server/events/event_consumer.py) includesTASK_STATE_UNSPECIFIEDin the stop set. That is the proto default (value 0), not a finished state.Spec 4.1.3: unspecified is unknown/indeterminate. Terminal is COMPLETED / FAILED / CANCELED / REJECTED. V2
TERMINAL_TASK_STATESalready omits unspecified.If an agent enqueues a
Taskwithout setting status, or a status update that omits state,consume_allcloses the queue. Later WORKING/COMPLETED events never arrive on the legacy message/send, stream, cancel, and subscribe paths.Repro
Task(id=..., context_id=...)with default status.Observed: only the first Task is yielded and the queue is closed.
Expected: unspecified is non-final; WORKING and COMPLETED are still consumed.
Relevant log output
n/a. Covered by a
consume_allunit test.Code of Conduct