Skip to content

Conversation

@secprog
Copy link

@secprog secprog commented Dec 5, 2025

This update introduces an optional task_store parameter to the to_a2a function, allowing users to provide a custom task store instance. If not specified, the function defaults to using InMemoryTaskStore. Additionally, unit tests have been added to verify the functionality with a custom task store.

Replaces my old closed PR #3639.

secprog and others added 21 commits November 20, 2025 13:51
This update introduces an optional `task_store` parameter to the `to_a2a` function, allowing users to provide a custom task store instance. If not specified, the function defaults to using `InMemoryTaskStore`. Additionally, unit tests have been added to verify the functionality with a custom task store.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Removed unused import of 'Any' from typing.
Fix type hint for task_store parameter.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Refactor the test to replace the mock of InMemoryTaskStore with TaskStore, ensuring consistency with the updated type hint for task_store. This change enhances the clarity and accuracy of the unit tests.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
… modules

Removed unnecessary blank lines and organized imports for better readability in `experiment.py` and `run_experiment.py`.

Also, updated import statements in `agent_to_a2a.py` and its corresponding test file to maintain consistency and clarity.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @secprog, 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 introduces a key enhancement to the to_a2a function, providing greater flexibility in how task management is handled within A2A applications. By allowing the injection of custom task store instances, it moves beyond a fixed in-memory solution, enabling more adaptable and scalable architectures. This change is accompanied by dedicated unit tests to confirm its proper functionality.

Highlights

  • Custom Task Store Support: The to_a2a function now accepts an optional task_store parameter, enabling users to provide their own custom task store implementation instead of relying solely on the default InMemoryTaskStore.
  • Enhanced Flexibility: This change significantly improves the extensibility of A2A applications by allowing developers to integrate diverse storage solutions for tasks, catering to specific application requirements.
  • Unit Test Coverage: New unit tests have been added to thoroughly verify the correct behavior of the to_a2a function when a custom task store is supplied, ensuring robustness and reliability.
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.

@secprog secprog closed this Dec 5, 2025
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 introduces a valuable feature by allowing a custom task_store to be passed to the to_a2a function, defaulting to InMemoryTaskStore if not provided. The implementation is clean and straightforward. The documentation has been updated effectively with a clear explanation and a helpful usage example. Furthermore, a new unit test has been added that thoroughly verifies the new functionality. I've noted one minor style suggestion regarding import formatting according to PEP 8. Overall, this is a well-executed and welcome enhancement.

Comment on lines 27 to 28
from google.genai import types

import utils
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

According to PEP 8, there should be a blank line separating third-party imports from local application imports. google.genai is a third-party import, while utils is a local import.

Suggested change
from google.genai import types
import utils
from google.genai import types
import utils
References
  1. PEP 8 recommends grouping imports into standard library, third-party, and local application sections, with a blank line between each group. (link)

@ryanaiagent ryanaiagent self-assigned this Dec 12, 2025
@ryanaiagent ryanaiagent added the a2a [Component] This issue is related a2a support inside ADK. label Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a2a [Component] This issue is related a2a support inside ADK.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants