Skip to content

Conversation

@yarolegovich
Copy link
Member

This is the third refactoring towards multi-process task processor (re #115).

This is a breaking change of a2asrv.TaskStore and eventqueue.Queue. The migration for a single process server is straightforward as a2a.TaskVersionMissing can be returned without affecting any functionality.

  • Introduce a2a.TaskVersion interface.
  • Extend a2asrv.TaskStore method signatures. Save now takes event which led to Task update and the last known task version.
  • Extend eventqueue.Queue method signatures to make task version propagation possible. This will be used for gap and duplicate notification detection when remote executions are added.
  • In ./internal/taskexec introduced an exported executionHandler to unify cancelation and execution event processing. The same code is going to be used by remote execution as well.

@gemini-code-assist
Copy link

Summary of Changes

Hello @yarolegovich, 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 is a significant refactoring step towards enabling a multi-process task processor. It introduces a TaskVersion concept to allow for optimistic concurrency control when updating tasks. Core interfaces like TaskStore and eventqueue.Queue are updated to incorporate this versioning, and the task execution event processing flow is centralized into a new executionHandler to unify logic and pave the way for remote execution scenarios.

Highlights

  • Introduce TaskVersion Concept: A new a2a.TaskVersion interface and its TaskVersionInt implementation have been introduced to track the version of a task, crucial for optimistic concurrency control in a multi-process environment.
  • Update TaskStore Interface: The a2asrv.TaskStore interface has been updated. Its Save method now accepts the event that led to the task update and the last known task version, returning the new task version. The Get method now also returns the task's version.
  • Extend EventQueue Interfaces: The eventqueue.Queue interfaces (Reader and Writer) have been extended to propagate the TaskVersion. A new WriteVersioned method is added to the Writer interface, enabling gap and duplicate notification detection for remote executions.
  • Refactor Task Execution Logic: Task execution and cancellation event processing logic has been unified into a new internal/taskexec/execution_handler.go component. This refactoring streamlines event handling and prepares the system for future remote execution capabilities.
  • Breaking Changes: This pull request introduces breaking changes to a2asrv.TaskStore and eventqueue.Queue method signatures due to the integration of the TaskVersion concept. Migration for single-process servers is straightforward by returning a2a.TaskVersionMissing.
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

@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 the TaskVersion concept, a significant and necessary refactoring to support multi-process task processors. The changes are extensive, touching on task storage, event queues, and execution logic. My review focused on the correctness and consistency of the new versioning mechanism. I've identified a critical issue in the version comparison logic and a missed opportunity to implement optimistic locking in the in-memory task store, which is crucial for the feature's goal. Additionally, I've provided suggestions to improve error handling, ensure consistent event propagation, and fix a test case. Overall, this is a solid step towards the goal, and addressing these points will make the implementation more robust and correct.

@yarolegovich yarolegovich changed the title feat: introduce and integrate TaskVersion concept feat: introduce and integrate TaskVersion Jan 2, 2026
@yarolegovich yarolegovich requested a review from ishymko January 5, 2026 14:45
@yarolegovich yarolegovich requested a review from ishymko January 8, 2026 16:19
@yarolegovich yarolegovich merged commit 5cf0332 into main Jan 8, 2026
4 checks passed
@yarolegovich yarolegovich deleted the yarolegovich/task-version branch January 8, 2026 16:45
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.

3 participants