From ee685047ea5d9aa9c7f8c139f8d1f27871d31d46 Mon Sep 17 00:00:00 2001 From: Holt Skinner Date: Thu, 17 Jul 2025 18:12:45 +0100 Subject: [PATCH 1/5] ci: Change commit message for update PRs and add formatting --- .github/workflows/update-a2a-types.yml | 6 +++--- scripts/generate_types.sh | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-a2a-types.yml b/.github/workflows/update-a2a-types.yml index a7f193c5d..7e5485305 100644 --- a/.github/workflows/update-a2a-types.yml +++ b/.github/workflows/update-a2a-types.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: "3.10" - name: Install uv uses: astral-sh/setup-uv@v6 - name: Configure uv shell @@ -47,8 +47,8 @@ jobs: token: ${{ secrets.A2A_BOT_PAT }} committer: a2a-bot author: a2a-bot - commit-message: 'feat: Update A2A types from specification 🤖' - title: 'feat: Update A2A types from specification 🤖' + commit-message: "feat(spec): Update A2A types from specification 🤖" + title: "feat(spec): Update A2A types from specification 🤖" body: | This PR updates `src/a2a/types.py` based on the latest `specification/json/a2a.json` from [a2aproject/A2A](https://github.com/a2aproject/A2A/commit/${{ github.event.client_payload.sha }}). branch: auto-update-a2a-types-${{ github.event.client_payload.sha }} diff --git a/scripts/generate_types.sh b/scripts/generate_types.sh index 546c20f96..c0a18e709 100644 --- a/scripts/generate_types.sh +++ b/scripts/generate_types.sh @@ -35,4 +35,6 @@ uv run datamodel-codegen \ --use-subclass-enum \ --base-class a2a._base.A2ABaseModel +uv run ruff format "$GENERATED_FILE" + echo "Codegen finished successfully." From 113b9ea4d10d5fcc7d065aaba26657e06ca6ea52 Mon Sep 17 00:00:00 2001 From: Holt Skinner Date: Thu, 17 Jul 2025 18:13:16 +0100 Subject: [PATCH 2/5] Formatting --- .github/workflows/update-a2a-types.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-a2a-types.yml b/.github/workflows/update-a2a-types.yml index 7e5485305..cba9c6107 100644 --- a/.github/workflows/update-a2a-types.yml +++ b/.github/workflows/update-a2a-types.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: '3.10' - name: Install uv uses: astral-sh/setup-uv@v6 - name: Configure uv shell @@ -47,8 +47,8 @@ jobs: token: ${{ secrets.A2A_BOT_PAT }} committer: a2a-bot author: a2a-bot - commit-message: "feat(spec): Update A2A types from specification 🤖" - title: "feat(spec): Update A2A types from specification 🤖" + commit-message: 'feat(spec): Update A2A types from specification 🤖' + title: 'feat(spec): Update A2A types from specification 🤖' body: | This PR updates `src/a2a/types.py` based on the latest `specification/json/a2a.json` from [a2aproject/A2A](https://github.com/a2aproject/A2A/commit/${{ github.event.client_payload.sha }}). branch: auto-update-a2a-types-${{ github.event.client_payload.sha }} From 9438bcd877ecb2fc585a80bd44358f858642f48f Mon Sep 17 00:00:00 2001 From: Holt Skinner Date: Thu, 17 Jul 2025 19:29:04 +0100 Subject: [PATCH 3/5] Remove format exclude --- .ruff.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/.ruff.toml b/.ruff.toml index 70f8ded31..9ebfa2800 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -143,7 +143,6 @@ inline-quotes = "single" [format] exclude = [ - "types.py", "src/a2a/grpc/**", ] docstring-code-format = true From 15bfc60898c5e192059cc418225f5d293cc7a638 Mon Sep 17 00:00:00 2001 From: Holt Skinner Date: Thu, 17 Jul 2025 19:31:18 +0100 Subject: [PATCH 4/5] Format types --- src/a2a/types.py | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/a2a/types.py b/src/a2a/types.py index 4962cbd0f..f4e2880db 100644 --- a/src/a2a/types.py +++ b/src/a2a/types.py @@ -133,7 +133,9 @@ class AgentSkill(A2ABaseModel): """ Supported media types for output. """ - tags: list[str] = Field(..., examples=[['cooking', 'customer support', 'billing']]) + tags: list[str] = Field( + ..., examples=[['cooking', 'customer support', 'billing']] + ) """ Set of tagwords describing classes of capabilities for this specific skill. """ @@ -1271,7 +1273,9 @@ class Artifact(A2ABaseModel): class DeleteTaskPushNotificationConfigResponse( - RootModel[JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse] + RootModel[ + JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse + ] ): root: JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse """ @@ -1280,7 +1284,9 @@ class DeleteTaskPushNotificationConfigResponse( class GetTaskPushNotificationConfigResponse( - RootModel[JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse] + RootModel[ + JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse + ] ): root: JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse """ @@ -1289,7 +1295,9 @@ class GetTaskPushNotificationConfigResponse( class ListTaskPushNotificationConfigResponse( - RootModel[JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse] + RootModel[ + JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse + ] ): root: JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse """ @@ -1444,7 +1452,9 @@ class SendStreamingMessageRequest(A2ABaseModel): class SetTaskPushNotificationConfigResponse( - RootModel[JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse] + RootModel[ + JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse + ] ): root: JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse """ @@ -1497,7 +1507,9 @@ class TaskStatus(A2ABaseModel): Additional status updates for client """ state: TaskState - timestamp: str | None = Field(default=None, examples=['2023-10-27T10:00:00Z']) + timestamp: str | None = Field( + default=None, examples=['2023-10-27T10:00:00Z'] + ) """ ISO 8601 datetime string when the status was recorded. """ @@ -1757,7 +1769,9 @@ class SendStreamingMessageSuccessResponse(A2ABaseModel): """ -class CancelTaskResponse(RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse]): +class CancelTaskResponse( + RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse] +): root: JSONRPCErrorResponse | CancelTaskSuccessResponse """ JSON-RPC response for the 'tasks/cancel' method. @@ -1800,7 +1814,9 @@ class JSONRPCResponse( """ -class SendMessageResponse(RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse]): +class SendMessageResponse( + RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse] +): root: JSONRPCErrorResponse | SendMessageSuccessResponse """ JSON-RPC response model for the 'message/send' method. From 571450e45ebe6b895e181eb9a4d84e2384915fe0 Mon Sep 17 00:00:00 2001 From: Holt Skinner <13262395+holtskinner@users.noreply.github.com> Date: Thu, 17 Jul 2025 19:43:52 +0100 Subject: [PATCH 5/5] Update scripts/generate_types.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- scripts/generate_types.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/generate_types.sh b/scripts/generate_types.sh index c0a18e709..64889c281 100644 --- a/scripts/generate_types.sh +++ b/scripts/generate_types.sh @@ -35,6 +35,7 @@ uv run datamodel-codegen \ --use-subclass-enum \ --base-class a2a._base.A2ABaseModel +echo "Formatting generated file with ruff..." uv run ruff format "$GENERATED_FILE" echo "Codegen finished successfully."