-
Notifications
You must be signed in to change notification settings - Fork 395
Closed as duplicate of#625
Copy link
Labels
Description
What happened?
Observed behavior:
When a server sends a TaskStatusUpdateEvent with the state set to rejected, the client receives it as unknown.
Expected behavior:
The client should receive the state as rejected, matching the server's intent.
Root cause:
The task_state classmethod in a2a/utils/proto_utils.py handles mappings for all other TaskState variants (submitted, working, completed, cancelled, failed, input_required, auth_required) but does not include a case for TASK_STATE_REJECTED. As a result, the rejected state falls through to the default wildcard match and is mapped to unknown.
Relevant code (a2a/utils/proto_utils.py):
@classmethod
def task_state(cls, state: a2a_pb2.TaskState) -> types.TaskState:
match state:
case a2a_pb2.TaskState.TASK_STATE_SUBMITTED:
return types.TaskState.submitted
case a2a_pb2.TaskState.TASK_STATE_WORKING:
return types.TaskState.working
case a2a_pb2.TaskState.TASK_STATE_COMPLETED:
return types.TaskState.completed
case a2a_pb2.TaskState.TASK_STATE_CANCELLED:
return types.TaskState.canceled
case a2a_pb2.TaskState.TASK_STATE_FAILED:
return types.TaskState.failed
case a2a_pb2.TaskState.TASK_STATE_INPUT_REQUIRED:
return types.TaskState.input_required
case a2a_pb2.TaskState.TASK_STATE_AUTH_REQUIRED:
return types.TaskState.auth_required
case _:
return types.TaskState.unknown
# Missing: a2a_pb2.TaskState.TASK_STATE_REJECTED -> types.TaskState.rejectedHappy to submit a PR for this if that would be helpful
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable