Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/a2a/utils/proto_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ def task_state(cls, state: types.TaskState) -> a2a_pb2.TaskState:
return a2a_pb2.TaskState.TASK_STATE_INPUT_REQUIRED
case types.TaskState.auth_required:
return a2a_pb2.TaskState.TASK_STATE_AUTH_REQUIRED
case types.TaskState.rejected:
return a2a_pb2.TaskState.TASK_STATE_REJECTED
Comment on lines +233 to +234
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

This new case for types.TaskState.rejected is correct. To ensure this change is properly tested, please update the test_enum_conversions unit test in tests/utils/test_proto_utils.py. The test currently excludes types.TaskState.rejected from the round-trip conversion check. Please update the test to include this new state to ensure it's properly covered.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the tests

case _:
return a2a_pb2.TaskState.TASK_STATE_UNSPECIFIED

Expand Down Expand Up @@ -703,6 +705,8 @@ def task_state(cls, state: a2a_pb2.TaskState) -> types.TaskState:
return types.TaskState.input_required
case a2a_pb2.TaskState.TASK_STATE_AUTH_REQUIRED:
return types.TaskState.auth_required
case a2a_pb2.TaskState.TASK_STATE_REJECTED:
return types.TaskState.rejected
case _:
return types.TaskState.unknown

Expand Down
Loading