Skip to content

test: Add quality and features TCK tests for JSON-RPC#667

Open
lbobinski wants to merge 2 commits intoa2aproject:mainfrom
lbobinski:feat/enable-rest-transport
Open

test: Add quality and features TCK tests for JSON-RPC#667
lbobinski wants to merge 2 commits intoa2aproject:mainfrom
lbobinski:feat/enable-rest-transport

Conversation

@lbobinski
Copy link

Description

This PR enhances the TCK test coverage for the JSON-RPC transport by enabling the 'quality' and 'features' categories in the CI workflow.

This change aligns with Phase 1 of the transport coverage plan outlined in @docs/plan_python_639.md, ensuring the robustness and feature completeness of the existing JSON-RPC implementation before introducing additional transports.

Key changes:

  • Updated .github/workflows/run-tck.yaml to include test runs with --category quality and --category features for the jsonrpc transport.

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Follow the CONTRIBUTING Guide.
  • Make your Pull Request title in the https://www.conventionalcommits.org/ specification.
    • Important Prefixes for release-please:
      • fix: which represents bug fixes, and correlates to a SemVer patch.
      • feat: represents a new feature, and correlates to a SemVer minor.
      • feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.
  • Ensure the tests and linter pass (Run bash scripts/format.sh from the repository root to format)
  • Appropriate docs were updated (if necessary)

Partial fix for #639

@lbobinski lbobinski requested a review from a team as a code owner February 4, 2026 14:23
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lbobinski, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the robustness and feature coverage of the JSON-RPC transport by implementing stricter data validation and improving the TCK agent's ability to process diverse message components. These changes directly contribute to the 'quality' and 'features' categories of the transport coverage plan. Additionally, it prepares the TCK agent for future transport expansions by configuring it to expose a REST endpoint.

Highlights

  • Stricter Model Validation: Pydantic models derived from A2ABaseModel now forbid extra fields, enforcing stricter schema validation and improving data integrity.
  • Enhanced Message Part Validation: The TCK agent now includes robust validation for user message parts, ensuring messages are not empty and only contain supported types like TextPart, FilePart, and DataPart, failing gracefully for unsupported parts.
  • REST Transport Preparation in TCK Agent: The TCK agent has been updated to expose a new /a2a/rest endpoint using A2ARESTFastAPIApplication, laying the groundwork for future REST transport testing alongside the existing JSON-RPC.
Changelog
  • src/a2a/_base.py
    • Added extra='forbid' to model_config in A2ABaseModel to enforce strict schema validation for all derived models.
  • tck/sut_agent.py
    • Imported A2ARESTFastAPIApplication, FilePart, DataPart, InvalidParamsError, and ServerError to support new functionalities.
    • Implemented comprehensive validation for user_message.parts within the execute function, checking for empty messages and ensuring all parts are of known types (TextPart, FilePart, DataPart). Unsupported parts now trigger a failed task status.
    • Configured the TCK agent to serve a new /a2a/rest endpoint using A2ARESTFastAPIApplication, alongside the existing JSON-RPC endpoint, to enable future REST transport testing.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/run-tck.yaml
Activity
  • No specific activity (comments, reviews, etc.) has been provided for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the TCK test coverage for JSON-RPC by enabling 'quality' and 'features' tests. To pass these new tests, changes have been made to improve robustness. This includes adding extra='forbid' to the base Pydantic model to disallow unknown fields, and adding validation logic for message parts in the SUT agent. The SUT agent is also updated to run a REST server alongside the JSON-RPC server. Overall, the changes are good and improve the quality of the test agent. I have a couple of minor suggestions for code cleanup and style.

# Unwrap RootModel if present to get the actual part
actual_part = part
if hasattr(part, 'root'):
actual_part = part.root
Copy link
Contributor

Choose a reason for hiding this comment

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

low

There's a minor indentation issue here. This line has an extra space at the beginning. Please correct it for code style consistency.

Suggested change
actual_part = part.root
actual_part = part.root

Comment on lines +100 to +101
task_id=task_id,
context_id=context_id,
Copy link
Contributor

Choose a reason for hiding this comment

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

low

The task_id and context_id fields are already present in the parent TaskStatusUpdateEvent object. Including them again in this nested Message object is redundant. Consider removing them to improve code clarity and avoid data duplication.

@lbobinski lbobinski force-pushed the feat/enable-rest-transport branch from 9670b66 to 28c12b3 Compare February 4, 2026 14:30
@holtskinner holtskinner changed the title feat: Add quality and features TCK tests for JSON-RPC test: Add quality and features TCK tests for JSON-RPC Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant