Skip to content

fix: return mandatory fields from list_tasks#710

Merged
ishymko merged 2 commits into1.0-devfrom
ishymko/list-tasks
Feb 19, 2026
Merged

fix: return mandatory fields from list_tasks#710
ishymko merged 2 commits into1.0-devfrom
ishymko/list-tasks

Conversation

@ishymko
Copy link
Member

@ishymko ishymko commented Feb 19, 2026

According to the spec all response fields are mandatory. Update implementation and add tests to cover.

Re #515

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ishymko, 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 addresses a compliance issue with the A2A protocol specification by ensuring that all mandatory fields in the ListTasksResponse are consistently returned. The changes involve streamlining the task processing within the default request handler and modifying the task store implementations to explicitly include total_size and page_size, while also refining how next_page_token is handled. Comprehensive tests have been added and updated to verify these changes.

Highlights

  • Protocol Compliance: Updated ListTasksResponse to ensure total_size and page_size are always returned, aligning with the A2A protocol specification for mandatory fields.
  • Code Refactoring: Refactored the on_list_tasks handler in default_request_handler.py to simplify task processing logic, removing redundant task copying.
  • Pagination Handling: Modified next_page_token handling in both database_task_store.py and inmemory_task_store.py to return None instead of an empty string when no next page exists, as per spec, and explicitly included page_size.
  • Test Coverage: Introduced new and updated existing integration and unit tests to validate the correct return of mandatory fields (total_size and page_size) in ListTasksResponse.
  • Subproject Addition: Added tck/a2a-tck as a Git subproject.
Changelog
  • src/a2a/server/request_handlers/default_request_handler.py
    • Simplified the logic for processing tasks in on_list_tasks by directly modifying the task object and returning the page object.
  • src/a2a/server/tasks/database_task_store.py
    • Modified list method to include page_size in the ListTasksResponse.
    • Removed the or '' fallback for next_page_token.
  • src/a2a/server/tasks/inmemory_task_store.py
    • Explicitly calculated and included page_size in the ListTasksResponse.
    • Removed the or '' fallback for next_page_token.
  • tck/a2a-tck
    • Added a new Git subproject.
  • tests/integration/test_client_server_integration.py
    • Updated LIST_TASKS_RESPONSE definition to include total_size and page_size.
    • Added assertions for total_size and page_size in test_http_transport_list_tasks.
  • tests/integration/test_end_to_end.py
    • Added assertions for total_size and page_size in the test_end_to_end_list_tasks integration test.
  • tests/server/tasks/test_database_task_store.py
    • Imported DEFAULT_LIST_TASKS_PAGE_SIZE.
    • Added an assertion for page.page_size in test_list_tasks.
  • tests/server/tasks/test_inmemory_task_store.py
    • Imported DEFAULT_LIST_TASKS_PAGE_SIZE.
    • Added an assertion for page.page_size in test_list_tasks.
Activity
  • No human activity has occurred on 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.

According to [the spec](https://a2a-protocol.org/latest/specification/#314-list-tasks) all response fields are mandatory. Update implementation and add tests to cover.
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 correctly updates the list_tasks implementation to return mandatory fields as per the specification, improving compliance and code clarity. The associated tests have also been updated. However, I've identified a regression where next_page_token is not handled correctly when it is None, which could lead to runtime errors. I've provided specific suggestions to address this. Overall, these are good changes.

@ishymko ishymko marked this pull request as ready for review February 19, 2026 09:17
@ishymko ishymko requested a review from a team as a code owner February 19, 2026 09:17
@ishymko ishymko enabled auto-merge (squash) February 19, 2026 09:18
@ishymko ishymko merged commit 6132053 into 1.0-dev Feb 19, 2026
9 checks passed
@ishymko ishymko deleted the ishymko/list-tasks branch February 19, 2026 09:25
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.

2 participants