Skip to content

refactor: Update Task model fields to use protobuf types for statu…s, artifacts, and history.#819

Merged
sokoliva merged 6 commits intoa2aproject:1.0-devfrom
sokoliva:models-type
Mar 12, 2026
Merged

refactor: Update Task model fields to use protobuf types for statu…s, artifacts, and history.#819
sokoliva merged 6 commits intoa2aproject:1.0-devfrom
sokoliva:models-type

Conversation

@sokoliva
Copy link
Member

@sokoliva sokoliva commented Mar 12, 2026

This is a rollback of a change made in: #783

…s`, `artifacts`, and `history`. This is a rollback of change made in:
@sokoliva sokoliva requested a review from a team as a code owner March 12, 2026 10:03
@sokoliva sokoliva requested a review from guglielmo-san March 12, 2026 10:03
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 refactors the Task model by replacing generic type hints with specific protobuf-generated types for the status, artifacts, and history fields. This change improves type safety and consistency within the model, aligning it with defined protobuf structures. It also serves as a rollback, re-establishing the use of protobuf types after a previous alteration.

Highlights

  • Model Refactoring: The Task model's status, artifacts, and history fields have been updated to utilize specific protobuf-generated types (TaskStatus, Artifact, Message) instead of generic dictionary or list-of-dictionary type hints.
  • Type Safety: Introduced stronger type hinting for key fields in the TaskMixin to align with protobuf definitions, enhancing type safety and consistency across the application.
  • Rollback Context: This change is a rollback of a previous modification, indicating a re-application or correction of the approach to integrate protobuf types.
Changelog
  • src/a2a/server/models.py
    • Imported Artifact, Message, and TaskStatus from a2a.types.a2a_pb2.
    • Updated the type hints for TaskMixin.status to TaskStatus.
    • Updated the type hints for TaskMixin.artifacts to list[Artifact] | None.
    • Updated the type hints for TaskMixin.history to list[Message] | None.
Activity
  • No human activity has been recorded 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.

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 reverts a previous change, updating the Task model's status, artifacts, and history fields to use specific protobuf types instead of generic dictionaries. This improves type safety. My review identified a minor inconsistency in the type hint for the status field, which should be marked as optional to match the nullable database column. A code suggestion is provided to correct this.

@sokoliva sokoliva merged commit 494a92c into a2aproject:1.0-dev Mar 12, 2026
6 checks passed
@sokoliva sokoliva deleted the models-type branch March 12, 2026 10:41
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