a2a-sdk 1.2.1__tar.gz → 1.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/acts-nightly.yaml +1 -1
  2. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/acts.yaml +1 -1
  3. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/itk.yaml +1 -1
  4. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/nightly.yaml +1 -1
  5. a2a_sdk-1.2.3/.release-please-manifest.json +3 -0
  6. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/CHANGELOG.md +35 -0
  7. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/PKG-INFO +1 -1
  8. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/card_resolver.py +8 -3
  9. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/client_factory.py +15 -7
  10. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/transports/rest.py +9 -3
  11. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/conversions.py +4 -2
  12. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/jsonrpc_adapter.py +8 -2
  13. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/proto_utils.py +22 -3
  14. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/rest_adapter.py +7 -3
  15. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/rest_transport.py +2 -0
  16. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/agent_execution/active_task.py +53 -12
  17. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/request_handlers/default_request_handler.py +31 -8
  18. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/request_handlers/default_request_handler_v2.py +18 -4
  19. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/request_handlers/response_helpers.py +4 -0
  20. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/routes/agent_card_routes.py +5 -0
  21. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/routes/common.py +31 -0
  22. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/routes/jsonrpc_dispatcher.py +12 -4
  23. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/routes/jsonrpc_routes.py +6 -0
  24. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/routes/rest_dispatcher.py +13 -2
  25. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/routes/rest_routes.py +7 -0
  26. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/base_push_notification_sender.py +32 -7
  27. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/database_push_notification_config_store.py +6 -6
  28. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/inmemory_push_notification_config_store.py +13 -7
  29. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/push_notification_config_store.py +20 -2
  30. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/push_notification_sender.py +6 -1
  31. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/_jcs.py +8 -3
  32. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/proto_utils.py +44 -0
  33. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/push_url_validator.py +18 -9
  34. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/signing.py +8 -3
  35. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/telemetry.py +17 -2
  36. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/uv.lock +15 -16
  37. a2a_sdk-1.2.1/.release-please-manifest.json +0 -3
  38. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.agents/skills/mistake-reflection/SKILL.md +0 -0
  39. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.gemini/config.yaml +0 -0
  40. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.git-blame-ignore-revs +0 -0
  41. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/CODEOWNERS +0 -0
  42. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/ISSUE_TEMPLATE/bug-report.yml +0 -0
  43. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/ISSUE_TEMPLATE/feature-request.yml +0 -0
  44. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  45. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/actions/spelling/advice.md +0 -0
  46. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/actions/spelling/allow.txt +0 -0
  47. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/actions/spelling/excludes.txt +0 -0
  48. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/actions/spelling/line_forbidden.patterns +0 -0
  49. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/actions/spelling/patterns.txt +0 -0
  50. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/conventional-commit-lint.yaml +0 -0
  51. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/dependabot.yml +0 -0
  52. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/auto-assign-new-issues.yaml +0 -0
  53. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/conventional-commits.yml +0 -0
  54. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/coverage-comment.yaml +0 -0
  55. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/install-smoke.yml +0 -0
  56. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/linter.yaml +0 -0
  57. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/python-publish.yml +0 -0
  58. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/release-please.yml +0 -0
  59. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/release-pr-approvals.yml +0 -0
  60. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/run-tck.yaml +0 -0
  61. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/security.yaml +0 -0
  62. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/spelling.yaml +0 -0
  63. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/stale.yaml +0 -0
  64. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.github/workflows/unit-tests.yml +0 -0
  65. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.gitignore +0 -0
  66. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.jscpd.json +0 -0
  67. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.pre-commit-config.yaml +0 -0
  68. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.python-version +0 -0
  69. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.vscode/extensions.json +0 -0
  70. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.vscode/launch.json +0 -0
  71. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/.vscode/settings.json +0 -0
  72. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/AGENTS.md +0 -0
  73. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/CODE_OF_CONDUCT.md +0 -0
  74. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/CONTRIBUTING.md +0 -0
  75. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/LICENSE +0 -0
  76. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/README.md +0 -0
  77. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/SECURITY.md +0 -0
  78. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/acts/sut-behaviors.yaml +0 -0
  79. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/buf.compat.gen.yaml +0 -0
  80. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/buf.gen.yaml +0 -0
  81. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/docs/ai/coding_conventions.md +0 -0
  82. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/docs/ai/evidence_rules.md +0 -0
  83. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/docs/ai/mandatory_checks.md +0 -0
  84. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/docs/migrations/v1_0/README.md +0 -0
  85. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/docs/migrations/v1_0/database/README.md +0 -0
  86. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/docs/migrations/v1_0/database/simple_migration.md +0 -0
  87. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/docs/migrations/v1_0/database/zero_downtime.md +0 -0
  88. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/itk/README.md +0 -0
  89. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/itk/__init__.py +0 -0
  90. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/itk/acts_behaviors.py +0 -0
  91. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/itk/acts_client_parse.py +0 -0
  92. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/itk/main.py +0 -0
  93. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/itk/pyproject.toml +0 -0
  94. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/itk/run_itk.sh +0 -0
  95. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/pyproject.toml +0 -0
  96. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/release-please-config.json +0 -0
  97. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/samples/README.md +0 -0
  98. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/samples/__init__.py +0 -0
  99. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/samples/agent_card_signing.py +0 -0
  100. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/samples/cli.py +0 -0
  101. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/samples/clustermode/README.md +0 -0
  102. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/samples/clustermode/__init__.py +0 -0
  103. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/samples/clustermode/cluster_common.py +0 -0
  104. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/samples/clustermode/exercise.py +0 -0
  105. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/samples/clustermode/run_cluster.py +0 -0
  106. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/samples/clustermode/server.py +0 -0
  107. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/samples/hello_world_agent.py +0 -0
  108. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/scripts/docker-compose.test.yml +0 -0
  109. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/scripts/format.sh +0 -0
  110. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/scripts/gen_proto.sh +0 -0
  111. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/scripts/gen_proto_compat.sh +0 -0
  112. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/scripts/lint.sh +0 -0
  113. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/scripts/run_db_tests.sh +0 -0
  114. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/scripts/test_install_smoke.sh +0 -0
  115. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/__init__.py +0 -0
  116. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/_base.py +0 -0
  117. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/a2a_db_cli.py +0 -0
  118. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/alembic.ini +0 -0
  119. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/auth/__init__.py +0 -0
  120. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/auth/user.py +0 -0
  121. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/__init__.py +0 -0
  122. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/auth/__init__.py +0 -0
  123. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/auth/credentials.py +0 -0
  124. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/auth/interceptor.py +0 -0
  125. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/base_client.py +0 -0
  126. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/client.py +0 -0
  127. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/errors.py +0 -0
  128. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/interceptors.py +0 -0
  129. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/optionals.py +0 -0
  130. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/service_parameters.py +0 -0
  131. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/transports/__init__.py +0 -0
  132. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/transports/base.py +0 -0
  133. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/transports/grpc.py +0 -0
  134. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/transports/http_helpers.py +0 -0
  135. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/transports/jsonrpc.py +0 -0
  136. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/client/transports/tenant_decorator.py +0 -0
  137. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/__init__.py +0 -0
  138. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/README.md +0 -0
  139. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/__init__.py +0 -0
  140. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/a2a_v0_3.proto +0 -0
  141. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/a2a_v0_3_pb2.py +0 -0
  142. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/a2a_v0_3_pb2.pyi +0 -0
  143. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/a2a_v0_3_pb2_grpc.py +0 -0
  144. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/buf.lock +0 -0
  145. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/buf.yaml +0 -0
  146. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/context_builders.py +0 -0
  147. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/extension_headers.py +0 -0
  148. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/grpc_handler.py +0 -0
  149. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/grpc_transport.py +0 -0
  150. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/jsonrpc_transport.py +0 -0
  151. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/model_conversions.py +0 -0
  152. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/request_handler.py +0 -0
  153. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/rest_handler.py +0 -0
  154. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/types.py +0 -0
  155. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/compat/v0_3/versions.py +0 -0
  156. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/extensions/__init__.py +0 -0
  157. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/extensions/common.py +0 -0
  158. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/helpers/__init__.py +0 -0
  159. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/helpers/agent_card.py +0 -0
  160. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/helpers/proto_helpers.py +0 -0
  161. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/migrations/README.md +0 -0
  162. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/migrations/__init__.py +0 -0
  163. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/migrations/env.py +0 -0
  164. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/migrations/migration_utils.py +0 -0
  165. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/migrations/script.py.mako +0 -0
  166. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/migrations/versions/38ce57e08137_add_column_protocol_version.py +0 -0
  167. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/migrations/versions/6419d2d130f6_add_columns_owner_last_updated.py +0 -0
  168. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/migrations/versions/__init__.py +0 -0
  169. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/migrations/versions/b5e3d1c8a2f7_add_task_version_and_task_events.py +0 -0
  170. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/py.typed +0 -0
  171. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/__init__.py +0 -0
  172. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/agent_execution/__init__.py +0 -0
  173. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/agent_execution/active_task_registry.py +0 -0
  174. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/agent_execution/agent_executor.py +0 -0
  175. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/agent_execution/context.py +0 -0
  176. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/agent_execution/request_context_builder.py +0 -0
  177. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/agent_execution/simple_request_context_builder.py +0 -0
  178. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/cluster/__init__.py +0 -0
  179. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/cluster/database_event_stream.py +0 -0
  180. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/cluster/database_task_store.py +0 -0
  181. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/cluster/event_stream.py +0 -0
  182. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/cluster/task_store.py +0 -0
  183. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/cluster/version.py +0 -0
  184. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/context.py +0 -0
  185. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/events/__init__.py +0 -0
  186. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/events/event_consumer.py +0 -0
  187. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/events/event_queue.py +0 -0
  188. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/events/event_queue_v2.py +0 -0
  189. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/events/in_memory_queue_manager.py +0 -0
  190. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/events/queue_manager.py +0 -0
  191. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/id_generator.py +0 -0
  192. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/jsonrpc_models.py +0 -0
  193. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/models.py +0 -0
  194. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/owner_resolver.py +0 -0
  195. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/request_handlers/__init__.py +0 -0
  196. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/request_handlers/grpc_handler.py +0 -0
  197. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/request_handlers/request_handler.py +0 -0
  198. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/routes/__init__.py +0 -0
  199. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/routes/_jsonrpc_schema.py +0 -0
  200. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/routes/_proto_schema.py +0 -0
  201. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/routes/fastapi_routes.py +0 -0
  202. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/__init__.py +0 -0
  203. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/copying_task_store.py +0 -0
  204. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/database_task_store.py +0 -0
  205. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/inmemory_task_store.py +0 -0
  206. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/result_aggregator.py +0 -0
  207. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/task_manager.py +0 -0
  208. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/task_store.py +0 -0
  209. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/server/tasks/task_updater.py +0 -0
  210. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/types/__init__.py +0 -0
  211. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/types/a2a_pb2.py +0 -0
  212. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/types/a2a_pb2.pyi +0 -0
  213. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/types/a2a_pb2_grpc.py +0 -0
  214. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/__init__.py +0 -0
  215. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/_async_queue_compat.py +0 -0
  216. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/constants.py +0 -0
  217. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/error_handlers.py +0 -0
  218. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/errors.py +0 -0
  219. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/grpc_status.py +0 -0
  220. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/input_mode_validator.py +0 -0
  221. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/json_utils.py +0 -0
  222. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/task.py +0 -0
  223. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/src/a2a/utils/version_validator.py +0 -0
  224. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/tck/__init__.py +0 -0
  225. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/tck/sut_agent.py +0 -0
  226. {a2a_sdk-1.2.1 → a2a_sdk-1.2.3}/tck/sut_agent_with_vertex_task_store.py +0 -0
@@ -32,7 +32,7 @@ jobs:
32
32
  path: itk/a2a-itk
33
33
 
34
34
  - name: Set up Docker Buildx
35
- uses: docker/setup-buildx-action@v3
35
+ uses: docker/setup-buildx-action@v4
36
36
 
37
37
  - name: Build itk_service image (GHA layer cache)
38
38
  uses: docker/build-push-action@v7
@@ -41,7 +41,7 @@ jobs:
41
41
  path: itk/a2a-itk
42
42
 
43
43
  - name: Set up Docker Buildx
44
- uses: docker/setup-buildx-action@v3
44
+ uses: docker/setup-buildx-action@v4
45
45
 
46
46
  - name: Build itk_service image (GHA layer cache)
47
47
  uses: docker/build-push-action@v7
@@ -35,7 +35,7 @@ jobs:
35
35
  path: itk/a2a-itk
36
36
 
37
37
  - name: Set up Docker Buildx
38
- uses: docker/setup-buildx-action@v3
38
+ uses: docker/setup-buildx-action@v4
39
39
 
40
40
  - name: Build itk_service image (GHA layer cache)
41
41
  uses: docker/build-push-action@v7
@@ -28,7 +28,7 @@ jobs:
28
28
  path: itk/a2a-itk
29
29
 
30
30
  - name: Set up Docker Buildx
31
- uses: docker/setup-buildx-action@v3
31
+ uses: docker/setup-buildx-action@v4
32
32
 
33
33
  - name: Build itk_service image (GHA layer cache)
34
34
  uses: docker/build-push-action@v7
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.2.3"
3
+ }
@@ -1,5 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.3](https://github.com/a2aproject/a2a-python/compare/v1.2.2...v1.2.3) (2026-10-17)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **client:** ignore the patch version when preferring a 1.0 interface ([#1304](https://github.com/a2aproject/a2a-python/issues/1304)) ([cbb2d84](https://github.com/a2aproject/a2a-python/commit/cbb2d8418df26567b4ed4ed9e160071dd04904d8))
9
+ * **client:** normalize malformed agent card parsing errors ([#1307](https://github.com/a2aproject/a2a-python/issues/1307)) ([486f0f6](https://github.com/a2aproject/a2a-python/commit/486f0f65b753077f401f2428490e26ca0eedc092))
10
+ * **compat:** block on a v0.3 gRPC and REST send without configuration ([#1334](https://github.com/a2aproject/a2a-python/issues/1334)) ([8160310](https://github.com/a2aproject/a2a-python/commit/8160310dd36e55ae33879d95692e2535e1cfdab8)), closes [#1321](https://github.com/a2aproject/a2a-python/issues/1321)
11
+ * **compat:** treat a v0.3 history_length of 0 as unlimited in JSON-RPC and REST ([#1312](https://github.com/a2aproject/a2a-python/issues/1312)) ([e86695c](https://github.com/a2aproject/a2a-python/commit/e86695cb2076874950f36f53d49771c8e09e185e))
12
+ * **jcs:** count open containers for the nesting bound, so an empty container leaf is refused ([#1294](https://github.com/a2aproject/a2a-python/issues/1294)) ([5653daf](https://github.com/a2aproject/a2a-python/commit/5653daf8315ab58c8dacc53be720c4ed632ee7ce))
13
+ * **server:** isolate push notification failures from the task lifecycle ([#1329](https://github.com/a2aproject/a2a-python/issues/1329)) ([0ee47d7](https://github.com/a2aproject/a2a-python/commit/0ee47d7baa47a706e33934a4e4c3d46bad16298f))
14
+ * **server:** mark internal lifecycle events done so a cancelled stream frees its producer ([#1336](https://github.com/a2aproject/a2a-python/issues/1336)) ([a4c4fc9](https://github.com/a2aproject/a2a-python/commit/a4c4fc91a22778f3d805e5e592bf690915a33033))
15
+ * **server:** reject push URLs in shared address space ([#1326](https://github.com/a2aproject/a2a-python/issues/1326)) ([01da00b](https://github.com/a2aproject/a2a-python/commit/01da00b0951ba6201af860d17b4c088be7902d43))
16
+ * **server:** release the ActiveTask after a direct Message response ([#1297](https://github.com/a2aproject/a2a-python/issues/1297)) ([49ebce6](https://github.com/a2aproject/a2a-python/commit/49ebce66389171dce38b74ebefb31ae4ad042e7e))
17
+ * **server:** run follow-up messages in the sender's contextvars ([#1317](https://github.com/a2aproject/a2a-python/issues/1317)) ([a016002](https://github.com/a2aproject/a2a-python/commit/a0160025d6d211b0be1762cb829e7a47c147191a))
18
+ * **server:** warn when an AgentCard is missing required fields ([#1279](https://github.com/a2aproject/a2a-python/issues/1279)) ([4f4101c](https://github.com/a2aproject/a2a-python/commit/4f4101cefd5e636a932c8017a8b3b11634be1d67))
19
+ * **telemetry:** let trace_function alone decide a span's status ([#1309](https://github.com/a2aproject/a2a-python/issues/1309)) ([59dcbfb](https://github.com/a2aproject/a2a-python/commit/59dcbfb16f73c7c596e6d60cb700ed71193c5cce))
20
+
21
+ ## [1.2.2](https://github.com/a2aproject/a2a-python/compare/v1.2.1...v1.2.2) (2026-10-03)
22
+
23
+
24
+ ### Features
25
+
26
+ * allow configuring SSE shutdown grace periods ([#1222](https://github.com/a2aproject/a2a-python/issues/1222)) ([6ff0a82](https://github.com/a2aproject/a2a-python/commit/6ff0a826b49a1814d05b6bb11e546d0fa3407c4c))
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * **client:** handle REST error bodies that are not a google.rpc.Status ([#1300](https://github.com/a2aproject/a2a-python/issues/1300)) ([ee61dc1](https://github.com/a2aproject/a2a-python/commit/ee61dc1328eed71d4fde53d26540bcdf3ab6ef91))
32
+ * **compat:** keep timestamp and three other fields in v0.3 gRPC conversion ([#1277](https://github.com/a2aproject/a2a-python/issues/1277)) ([fad0482](https://github.com/a2aproject/a2a-python/commit/fad04821ca9ca70f5378305c2f3ce9225d323e72)), closes [#1276](https://github.com/a2aproject/a2a-python/issues/1276)
33
+ * **compat:** treat an unset v0.3 history_length as unlimited ([#1306](https://github.com/a2aproject/a2a-python/issues/1306)) ([21fe836](https://github.com/a2aproject/a2a-python/commit/21fe836484f959f7d7c2541866f99a07b370211a)), closes [#1305](https://github.com/a2aproject/a2a-python/issues/1305)
34
+ * **server:** name the task state in terminal-state errors ([#1302](https://github.com/a2aproject/a2a-python/issues/1302)) ([fdca1d0](https://github.com/a2aproject/a2a-python/commit/fdca1d0f9ee75a4e136c199da3ee1757764cd3dd))
35
+ * **server:** return the stored id when creating a push notification config ([#1236](https://github.com/a2aproject/a2a-python/issues/1236)) ([dac7d9d](https://github.com/a2aproject/a2a-python/commit/dac7d9d4d01a56b1c9aad83b069326fbf8f114e8)), closes [#1237](https://github.com/a2aproject/a2a-python/issues/1237)
36
+ * **server:** stop printing a traceback to stderr for malformed JSON-RPC bodies ([#1301](https://github.com/a2aproject/a2a-python/issues/1301)) ([5a1a004](https://github.com/a2aproject/a2a-python/commit/5a1a004ecd9e3051223923f7e2db8c15401a20f7))
37
+
3
38
  ## [1.2.1](https://github.com/a2aproject/a2a-python/compare/v1.2.0...v1.2.1) (2026-09-30)
4
39
 
5
40
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: a2a-sdk
3
- Version: 1.2.1
3
+ Version: 1.2.3
4
4
  Summary: A2A Python SDK
5
5
  Project-URL: homepage, https://a2a-protocol.org/
6
6
  Project-URL: repository, https://github.com/a2aproject/a2a-python
@@ -20,9 +20,14 @@ logger = logging.getLogger(__name__)
20
20
 
21
21
  def parse_agent_card(agent_card_data: dict[str, Any]) -> AgentCard:
22
22
  """Parse AgentCard JSON dictionary and handle backward compatibility."""
23
- _handle_extended_card_compatibility(agent_card_data)
24
- _handle_connection_fields_compatibility(agent_card_data)
25
- _handle_security_compatibility(agent_card_data)
23
+ if not isinstance(agent_card_data, dict):
24
+ raise ParseError('Agent card must be a JSON object')
25
+ try:
26
+ _handle_extended_card_compatibility(agent_card_data)
27
+ _handle_connection_fields_compatibility(agent_card_data)
28
+ _handle_security_compatibility(agent_card_data)
29
+ except (TypeError, AttributeError) as e:
30
+ raise ParseError(f'Invalid agent card structure: {e}') from e
26
31
 
27
32
  return ParseDict(agent_card_data, AgentCard(), ignore_unknown_fields=True)
28
33
 
@@ -55,6 +55,12 @@ TransportProducer = Callable[
55
55
  ]
56
56
 
57
57
 
58
+ def major_minor(version: str) -> tuple[int, int]:
59
+ """Returns the `Major.Minor` release of a protocol version."""
60
+ v = Version(version)
61
+ return (v.major, v.minor)
62
+
63
+
58
64
  class ClientFactory:
59
65
  """Factory for creating clients that communicate with A2A agents.
60
66
 
@@ -229,10 +235,10 @@ class ClientFactory:
229
235
  if not candidates:
230
236
  return None
231
237
 
232
- # Prefer interface with version 1.0
233
- for i in candidates:
234
- if i.protocol_version == PROTOCOL_VERSION_1_0:
235
- return i
238
+ # Prefer interface with version 1.0. Patch versions must not affect
239
+ # negotiation, so '1.0.0' counts as '1.0'.
240
+ v1_0 = major_minor(PROTOCOL_VERSION_1_0)
241
+ v0_3 = major_minor(PROTOCOL_VERSION_0_3)
236
242
 
237
243
  best_gt_1_0 = None
238
244
  best_ge_0_3 = None
@@ -245,10 +251,12 @@ class ClientFactory:
245
251
  continue
246
252
 
247
253
  try:
248
- v = Version(i.protocol_version)
249
- if best_gt_1_0 is None and v > Version(PROTOCOL_VERSION_1_0):
254
+ v = major_minor(i.protocol_version)
255
+ if v == v1_0:
256
+ return i
257
+ if best_gt_1_0 is None and v > v1_0:
250
258
  best_gt_1_0 = i
251
- if best_ge_0_3 is None and v >= Version(PROTOCOL_VERSION_0_3):
259
+ if best_ge_0_3 is None and v >= v0_3:
252
260
  best_ge_0_3 = i
253
261
  except InvalidVersion:
254
262
  pass
@@ -42,19 +42,25 @@ logger = logging.getLogger(__name__)
42
42
 
43
43
 
44
44
  def _parse_rest_error(
45
- error_payload: dict[str, Any],
45
+ error_payload: Any,
46
46
  fallback_message: str,
47
47
  ) -> Exception | None:
48
48
  """Parses a REST error payload and returns the appropriate A2AError.
49
49
 
50
50
  Args:
51
- error_payload: The parsed JSON error payload.
51
+ error_payload: The parsed JSON error payload. Any JSON value is
52
+ accepted, since a proxy or gateway may answer with a body that
53
+ is not a ``google.rpc.Status``.
52
54
  fallback_message: Message to use if the payload has no ``message``.
53
55
 
54
56
  Returns:
55
57
  The mapped A2AError if a known reason was found, otherwise ``None``.
56
58
  """
57
- error_data = error_payload.get('error', {})
59
+ if not isinstance(error_payload, dict):
60
+ return None
61
+ error_data = error_payload.get('error')
62
+ if not isinstance(error_data, dict):
63
+ return None
58
64
  message = error_data.get('message', fallback_message)
59
65
  details = error_data.get('details', [])
60
66
  if not isinstance(details, list):
@@ -317,7 +317,8 @@ def to_core_send_message_configuration(
317
317
  compat_config.push_notification_config
318
318
  )
319
319
  )
320
- if compat_config.history_length is not None:
320
+ # v0.3 treats 0 as unlimited, so leave it unset.
321
+ if compat_config.history_length:
321
322
  core_config.history_length = compat_config.history_length
322
323
  if compat_config.blocking is not None:
323
324
  core_config.return_immediately = not compat_config.blocking
@@ -1074,7 +1075,8 @@ def to_core_get_task_request(
1074
1075
  """Convert get task request to v1.0 core type."""
1075
1076
  core_req = pb2_v10.GetTaskRequest()
1076
1077
  core_req.id = compat_req.params.id
1077
- if compat_req.params.history_length is not None:
1078
+ # v0.3 treats 0 as unlimited, so leave it unset.
1079
+ if compat_req.params.history_length:
1078
1080
  core_req.history_length = compat_req.params.history_length
1079
1081
  return core_req
1080
1082
 
@@ -39,6 +39,7 @@ from a2a.server.jsonrpc_models import (
39
39
  from a2a.server.routes.common import (
40
40
  DefaultServerCallContextBuilder,
41
41
  ServerCallContextBuilder,
42
+ create_event_source_response,
42
43
  )
43
44
  from a2a.utils import constants
44
45
  from a2a.utils.version_validator import validate_version
@@ -67,13 +68,15 @@ class JSONRPC03Adapter:
67
68
  self,
68
69
  http_handler: 'RequestHandler',
69
70
  context_builder: 'ServerCallContextBuilder | None' = None,
70
- ):
71
+ shutdown_grace_period: float = 0,
72
+ ) -> None:
71
73
  self.handler = RequestHandler03(
72
74
  request_handler=http_handler,
73
75
  )
74
76
  self._context_builder = V03ServerCallContextBuilder(
75
77
  context_builder or DefaultServerCallContextBuilder()
76
78
  )
79
+ self._shutdown_grace_period = shutdown_grace_period
77
80
 
78
81
  def supports_method(self, method: str) -> bool:
79
82
  """Returns True if the v0.3 adapter supports the given method name."""
@@ -277,4 +280,7 @@ class JSONRPC03Adapter:
277
280
  )
278
281
  }
279
282
 
280
- return EventSourceResponse(event_generator(stream_gen))
283
+ return create_event_source_response(
284
+ event_generator(stream_gen),
285
+ shutdown_grace_period=self._shutdown_grace_period,
286
+ )
@@ -211,10 +211,15 @@ class ToProto:
211
211
 
212
212
  @classmethod
213
213
  def task_status(cls, status: types.TaskStatus) -> a2a_pb2.TaskStatus:
214
- return a2a_pb2.TaskStatus(
214
+ proto_status = a2a_pb2.TaskStatus(
215
215
  state=cls.task_state(status.state),
216
216
  update=cls.message(status.message),
217
217
  )
218
+ if status.timestamp:
219
+ proto_status.timestamp.FromJsonString(
220
+ str(status.timestamp).replace('+00:00', 'Z')
221
+ )
222
+ return proto_status
218
223
 
219
224
  @classmethod
220
225
  def task_state(cls, state: types.TaskState) -> a2a_pb2.TaskState:
@@ -405,6 +410,7 @@ class ToProto:
405
410
  signatures=[cls.agent_card_signature(x) for x in card.signatures]
406
411
  if card.signatures
407
412
  else None,
413
+ icon_url=card.icon_url,
408
414
  )
409
415
 
410
416
  @classmethod
@@ -515,6 +521,7 @@ class ToProto:
515
521
  oauth2_security_scheme=a2a_pb2.OAuth2SecurityScheme(
516
522
  description=scheme.root.description,
517
523
  flows=cls.oauth2_flows(scheme.root.flows),
524
+ oauth2_metadata_url=scheme.root.oauth2_metadata_url,
518
525
  )
519
526
  )
520
527
  if isinstance(scheme.root, types.MutualTLSSecurityScheme):
@@ -577,6 +584,7 @@ class ToProto:
577
584
  examples=skill.examples,
578
585
  input_modes=skill.input_modes,
579
586
  output_modes=skill.output_modes,
587
+ security=cls.security(skill.security),
580
588
  )
581
589
 
582
590
  @classmethod
@@ -689,6 +697,9 @@ class FromProto:
689
697
  return types.TaskStatus(
690
698
  state=cls.task_state(status.state),
691
699
  message=cls.message(status.update),
700
+ timestamp=status.timestamp.ToJsonString()
701
+ if status.HasField('timestamp')
702
+ else None,
692
703
  )
693
704
 
694
705
  @classmethod
@@ -782,7 +793,9 @@ class FromProto:
782
793
  )
783
794
  if config.HasField('push_notification')
784
795
  else None,
785
- history_length=config.history_length,
796
+ history_length=config.history_length
797
+ if config.history_length
798
+ else None,
786
799
  blocking=config.blocking,
787
800
  )
788
801
 
@@ -791,7 +804,9 @@ class FromProto:
791
804
  cls, request: a2a_pb2.SendMessageRequest
792
805
  ) -> types.MessageSendParams:
793
806
  return types.MessageSendParams(
794
- configuration=cls.message_send_configuration(request.configuration),
807
+ configuration=cls.message_send_configuration(request.configuration)
808
+ if request.HasField('configuration')
809
+ else None,
795
810
  message=cls.message(request.request),
796
811
  metadata=cls.metadata(request.metadata),
797
812
  )
@@ -876,6 +891,7 @@ class FromProto:
876
891
  signatures=[cls.agent_card_signature(x) for x in card.signatures]
877
892
  if card.signatures
878
893
  else None,
894
+ icon_url=card.icon_url or None,
879
895
  )
880
896
 
881
897
  @classmethod
@@ -992,6 +1008,8 @@ class FromProto:
992
1008
  root=types.OAuth2SecurityScheme(
993
1009
  description=scheme.oauth2_security_scheme.description,
994
1010
  flows=cls.oauth2_flows(scheme.oauth2_security_scheme.flows),
1011
+ oauth2_metadata_url=scheme.oauth2_security_scheme.oauth2_metadata_url
1012
+ or None,
995
1013
  )
996
1014
  )
997
1015
  if scheme.HasField('mtls_security_scheme'):
@@ -1086,6 +1104,7 @@ class FromProto:
1086
1104
  examples=list(skill.examples),
1087
1105
  input_modes=list(skill.input_modes),
1088
1106
  output_modes=list(skill.output_modes),
1107
+ security=cls.security(list(skill.security)),
1089
1108
  )
1090
1109
 
1091
1110
  @classmethod
@@ -35,6 +35,7 @@ from a2a.compat.v0_3.rest_handler import REST03Handler
35
35
  from a2a.server.routes.common import (
36
36
  DefaultServerCallContextBuilder,
37
37
  ServerCallContextBuilder,
38
+ create_event_source_response,
38
39
  )
39
40
  from a2a.utils import json_utils
40
41
  from a2a.utils.error_handlers import (
@@ -59,11 +60,13 @@ class REST03Adapter:
59
60
  self,
60
61
  http_handler: 'RequestHandler',
61
62
  context_builder: 'ServerCallContextBuilder | None' = None,
62
- ):
63
+ shutdown_grace_period: float = 0,
64
+ ) -> None:
63
65
  self.handler = REST03Handler(request_handler=http_handler)
64
66
  self._context_builder = V03ServerCallContextBuilder(
65
67
  context_builder or DefaultServerCallContextBuilder()
66
68
  )
69
+ self._shutdown_grace_period = shutdown_grace_period
67
70
 
68
71
  @rest_error_handler
69
72
  async def _handle_request(
@@ -96,8 +99,9 @@ class REST03Adapter:
96
99
  async for item in stream:
97
100
  yield json_utils.dumps(item)
98
101
 
99
- return EventSourceResponse(
100
- event_generator(method(request, call_context))
102
+ return create_event_source_response(
103
+ event_generator(method(request, call_context)),
104
+ shutdown_grace_period=self._shutdown_grace_period,
101
105
  )
102
106
 
103
107
  def routes(self) -> dict[tuple[str, str], Callable[[Request], Any]]:
@@ -351,6 +351,8 @@ class CompatRestTransport(ClientTransport):
351
351
  error_data = e.response.json()
352
352
  except (json.JSONDecodeError, ValueError, httpx.ResponseNotRead):
353
353
  error_data = {}
354
+ if not isinstance(error_data, dict):
355
+ error_data = {}
354
356
 
355
357
  error_type = error_data.get('type')
356
358
  message = error_data.get('message', str(e))
@@ -36,6 +36,7 @@ Data Flow and Event Handling:
36
36
  from __future__ import annotations
37
37
 
38
38
  import asyncio
39
+ import contextvars
39
40
  import logging
40
41
  import uuid
41
42
 
@@ -237,6 +238,18 @@ class EventConsumer:
237
238
 
238
239
  await self._enqueue_to_subscribers(event, updated_task)
239
240
 
241
+ if isinstance(event, Message):
242
+ self._handle_message_completion()
243
+
244
+ def _handle_message_completion(self) -> None:
245
+ # A direct Message has no task to continue, so finish like a terminal state.
246
+ logger.debug(
247
+ 'Consumer[%s]: Message response, finishing',
248
+ self.active_task._task_id,
249
+ )
250
+ self.active_task._is_finished.set()
251
+ self.active_task._request_queue.shutdown(immediate=True)
252
+
240
253
  def _handle_message_event(self, event: Message) -> None:
241
254
  if self.task_mode is True:
242
255
  raise InvalidAgentResponseError(
@@ -345,9 +358,21 @@ class EventConsumer:
345
358
  'Consumer[%s]: Sending push notification',
346
359
  self.active_task._task_id,
347
360
  )
348
- await self.active_task._push_sender.send_notification(
349
- self.active_task._task_id, event
350
- )
361
+ try:
362
+ await self.active_task._push_sender.send_notification(
363
+ self.active_task._task_id, event
364
+ )
365
+ except Exception:
366
+ # Push delivery is best-effort: a sender failure must not
367
+ # fail the task or disturb the event stream. This guard is
368
+ # defense-in-depth on top of the boundary inside
369
+ # BasePushNotificationSender, and also protects against
370
+ # custom PushNotificationSender implementations.
371
+ logger.exception(
372
+ 'Consumer[%s]: Push notification sender raised; '
373
+ 'ignoring the failure.',
374
+ self.active_task._task_id,
375
+ )
351
376
 
352
377
  async def _handle_terminal_state(self, updated_task: Task) -> None:
353
378
  logger.debug(
@@ -468,9 +493,9 @@ class ActiveTask:
468
493
  self._reference_count = 0
469
494
 
470
495
  # Queue for incoming requests
471
- self._request_queue: AsyncQueue[tuple[RequestContext, uuid.UUID]] = (
472
- create_async_queue()
473
- )
496
+ self._request_queue: AsyncQueue[
497
+ tuple[RequestContext, uuid.UUID, contextvars.Context]
498
+ ] = create_async_queue()
474
499
 
475
500
  @property
476
501
  def task_id(self) -> str:
@@ -480,9 +505,16 @@ class ActiveTask:
480
505
  async def enqueue_request(
481
506
  self, request_context: RequestContext
482
507
  ) -> uuid.UUID:
483
- """Enqueues a request for the active task to process."""
508
+ """Enqueues a request for the active task to process.
509
+
510
+ The caller's contextvars are captured so the producer runs
511
+ `AgentExecutor.execute` in the context of the request that sent the
512
+ message, not the request that started the producer.
513
+ """
484
514
  request_id = uuid.uuid4()
485
- await self._request_queue.put((request_context, request_id))
515
+ await self._request_queue.put(
516
+ (request_context, request_id, contextvars.copy_context())
517
+ )
486
518
  return request_id
487
519
 
488
520
  async def start(
@@ -528,7 +560,7 @@ class ActiveTask:
528
560
  self._task_created.set()
529
561
  if task.status.state in TERMINAL_TASK_STATES:
530
562
  raise UnsupportedOperationError(
531
- message=f'Task {task.id} is in terminal state: {task.status.state}'
563
+ message=f'Task {task.id} is in terminal state: {TaskState.Name(task.status.state)}'
532
564
  )
533
565
  elif not create_task_if_missing:
534
566
  raise TaskNotFoundError
@@ -573,6 +605,7 @@ class ActiveTask:
573
605
  (
574
606
  request_context,
575
607
  request_id,
608
+ sender_context,
576
609
  ) = await self._request_queue.get()
577
610
  await self._request_lock.acquire()
578
611
  # TODO: Should we create task manager every time?
@@ -590,7 +623,7 @@ class ActiveTask:
590
623
  and task.status.state in TERMINAL_TASK_STATES
591
624
  ):
592
625
  raise UnsupportedOperationError(
593
- message=f'Task {task.id} is in terminal state: {task.status.state}'
626
+ message=f'Task {task.id} is in terminal state: {TaskState.Name(task.status.state)}'
594
627
  )
595
628
  request_context.current_task = task
596
629
 
@@ -607,8 +640,12 @@ class ActiveTask:
607
640
  _RequestStarted(request_id, request_context),
608
641
  )
609
642
  )
610
- await self._agent_executor.execute(
611
- request_context, self._event_queue_agent
643
+ # Awaiting the child task propagates producer cancellation.
644
+ await sender_context.run(
645
+ asyncio.create_task,
646
+ self._agent_executor.execute(
647
+ request_context, self._event_queue_agent
648
+ ),
612
649
  )
613
650
  logger.debug(
614
651
  'Producer[%s]: Execution finished successfully',
@@ -736,6 +773,7 @@ class ActiveTask:
736
773
  self._task_id,
737
774
  event,
738
775
  )
776
+ tapped_queue.task_done()
739
777
  raise event
740
778
 
741
779
  if replace_status_update_with_task and isinstance(
@@ -747,6 +785,9 @@ class ActiveTask:
747
785
  updated_task,
748
786
  )
749
787
  event = updated_task
788
+ # Acknowledge internal lifecycle events before skipping them.
789
+ if isinstance(event, _RequestStarted | _RequestCompleted):
790
+ tapped_queue.task_done()
750
791
  if isinstance(event, _RequestCompleted):
751
792
  if (
752
793
  request_id is not None
@@ -32,6 +32,9 @@ from a2a.server.tasks import (
32
32
  TaskManager,
33
33
  TaskStore,
34
34
  )
35
+ from a2a.server.tasks.push_notification_config_store import (
36
+ normalize_push_notification_config,
37
+ )
35
38
  from a2a.types.a2a_pb2 import (
36
39
  AgentCard,
37
40
  CancelTaskRequest,
@@ -60,6 +63,7 @@ from a2a.utils.errors import (
60
63
  UnsupportedOperationError,
61
64
  )
62
65
  from a2a.utils.input_mode_validator import validate_input_modes
66
+ from a2a.utils.proto_utils import warn_on_missing_required_fields
63
67
  from a2a.utils.task import (
64
68
  apply_history_length,
65
69
  validate_history_length,
@@ -143,6 +147,14 @@ class LegacyRequestHandler(RequestHandler):
143
147
  self._validate_input_modes = validate_input_modes
144
148
  self.extended_agent_card = extended_agent_card
145
149
  self.extended_card_modifier = extended_card_modifier
150
+ warn_on_missing_required_fields(
151
+ agent_card, 'agent_card passed to DefaultRequestHandler:'
152
+ )
153
+ if extended_agent_card is not None:
154
+ warn_on_missing_required_fields(
155
+ extended_agent_card,
156
+ 'extended_agent_card passed to DefaultRequestHandler:',
157
+ )
146
158
  self._request_context_builder = (
147
159
  request_context_builder
148
160
  or SimpleRequestContextBuilder(
@@ -219,7 +231,7 @@ class LegacyRequestHandler(RequestHandler):
219
231
  # Check if task is in a non-cancelable state (completed, canceled, failed, rejected)
220
232
  if task.status.state in TERMINAL_TASK_STATES:
221
233
  raise TaskNotCancelableError(
222
- message=f'Task cannot be canceled - current state: {task.status.state}'
234
+ message=f'Task cannot be canceled - current state: {TaskState.Name(task.status.state)}'
223
235
  )
224
236
 
225
237
  task_manager = TaskManager(
@@ -258,7 +270,7 @@ class LegacyRequestHandler(RequestHandler):
258
270
 
259
271
  if result.status.state != TaskState.TASK_STATE_CANCELED:
260
272
  raise TaskNotCancelableError(
261
- message=f'Task cannot be canceled - current state: {result.status.state}'
273
+ message=f'Task cannot be canceled - current state: {TaskState.Name(result.status.state)}'
262
274
  )
263
275
 
264
276
  return result
@@ -306,7 +318,7 @@ class LegacyRequestHandler(RequestHandler):
306
318
  if task:
307
319
  if task.status.state in TERMINAL_TASK_STATES:
308
320
  raise UnsupportedOperationError(
309
- message=f'Task {task.id} is in terminal state: {task.status.state}'
321
+ message=f'Task {task.id} is in terminal state: {TaskState.Name(task.status.state)}'
310
322
  )
311
323
 
312
324
  task = task_manager.update_with_message(params.message, task)
@@ -370,7 +382,16 @@ class LegacyRequestHandler(RequestHandler):
370
382
  and task_id
371
383
  and isinstance(event, PushNotificationEvent)
372
384
  ):
373
- await self._push_sender.send_notification(task_id, event)
385
+ try:
386
+ await self._push_sender.send_notification(task_id, event)
387
+ except Exception:
388
+ # Push delivery is best-effort: a sender failure must not
389
+ # fail the task or disturb the event stream.
390
+ logger.exception(
391
+ 'Push notification sender raised for task_id=%s; '
392
+ 'ignoring the failure.',
393
+ task_id,
394
+ )
374
395
 
375
396
  @validate_request_params
376
397
  async def on_message_send(
@@ -560,13 +581,15 @@ class LegacyRequestHandler(RequestHandler):
560
581
 
561
582
  await self._reject_unsafe_push_url(params.url)
562
583
 
563
- await self._push_config_store.set_info(
584
+ stored = await self._push_config_store.set_info(
564
585
  task_id,
565
586
  params,
566
587
  context,
567
588
  )
568
-
569
- return params
589
+ if stored is not None:
590
+ return stored
591
+ # Custom stores written before set_info returned the stored config.
592
+ return normalize_push_notification_config(task_id, params)
570
593
 
571
594
  @validate_request_params
572
595
  @validate(
@@ -624,7 +647,7 @@ class LegacyRequestHandler(RequestHandler):
624
647
 
625
648
  if task.status.state in TERMINAL_TASK_STATES:
626
649
  raise UnsupportedOperationError(
627
- message=f'Task {task.id} is in terminal state: {task.status.state}'
650
+ message=f'Task {task.id} is in terminal state: {TaskState.Name(task.status.state)}'
628
651
  )
629
652
 
630
653
  # The operation MUST return a Task object as the first event in the stream