Skip to content

Conversation

@flex-myeonghyeon
Copy link
Contributor

@flex-myeonghyeon flex-myeonghyeon commented Oct 31, 2025

Description

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 pass
  • Appropriate READMEs were updated (if necessary)

Fixes #426 🦕

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @flex-myeonghyeon, 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 resolves a bug where task metadata was being inadvertently overwritten during status updates. By implementing a merge strategy, the system now correctly combines new metadata from TaskStatusUpdateEvent with existing task metadata, ensuring data integrity and preventing unintended loss of information. This fix improves the robustness of task management by allowing incremental updates to metadata.

Highlights

  • Metadata Handling: The core change modifies how metadata is handled during a TaskStatusUpdateEvent. Previously, new metadata would completely overwrite existing task metadata. Now, incoming metadata is merged with the existing metadata, preserving existing fields unless explicitly updated by the event.
  • Test Updates: Corresponding test cases in TaskManagerTest.java have been updated to reflect and verify the new metadata merging behavior. A test method was renamed, and its assertions were adjusted to confirm that metadata is merged rather than replaced.
  • Dependency Imports: Necessary java.util.HashMap and java.util.Map imports were added to TaskManager.java to facilitate the new metadata merging logic.
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 correctly addresses the issue of metadata being replaced instead of merged. The change in TaskManager.java to merge metadata from a TaskStatusUpdateEvent is implemented correctly and safely, ensuring that existing metadata is preserved and updated. The corresponding test in TaskManagerTest.java has been updated effectively to validate this new merging behavior. The changes are well-implemented and the fix is solid.


@Test
public void testSaveTaskEventMetadataUpdateOverwritesExisting() throws A2AServerException {
public void testSaveTaskEventMetadataMergeExisting() throws A2AServerException {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While the test method name has been correctly updated to reflect the new merging logic, the comment on the following line (592) is now outdated and misleading, as it still refers to overwriting metadata. To improve clarity and prevent confusion, please update the comment to align with the test's new purpose.

For example:

// Test that metadata update merges with existing metadata

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @flex-myeonghyeon Thank you for your PR! Would you be able to update this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kabir
I’ve updated the comment.
Thank you.

@kabir kabir merged commit 425508d into a2aproject:main Nov 3, 2025
10 checks passed
kabir pushed a commit to kabir/a2a-java that referenced this pull request Nov 3, 2025
kabir pushed a commit to kabir/a2a-java that referenced this pull request Nov 3, 2025
kabir pushed a commit to kabir/a2a-java that referenced this pull request Dec 23, 2025
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.

Enhancement: Merge metadata instead of replacing it in TaskManager.TaskStatusUpdateEvent

4 participants