Skip to content

A2A integration: Fix event conversion issues to align with A2A <-> ADK Go implementation#178

Merged
kalenkevich merged 3 commits intomainfrom
a2a/part_4
Mar 6, 2026
Merged

A2A integration: Fix event conversion issues to align with A2A <-> ADK Go implementation#178
kalenkevich merged 3 commits intomainfrom
a2a/part_4

Conversation

@kalenkevich
Copy link
Collaborator

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

2. Or, if no issue exists, describe the change:

Problem:
The codebase required better separation of concerns and more robust handling for A2A Events. There was a need for improved conversion logic and accurate handling of event metadata, long-running tool IDs, and function call/response IDs as it previously relied on function names for tool matching (which is a bug!).

Solution:

  • Extracted A2A Event definitions and builder functions into a new dedicated module core/src/a2a/a2a_event.ts.
  • Updated core/src/a2a/event_converter_utils.ts to utilize the new event definitions and improved conversion logic between AdkEvent and A2AEvent (handling tasks, messages, and artifact updates).
  • Enhanced core/src/a2a/part_converter_utils.ts to accurately handle id properties for functionCall and functionResponse instead of relying on function names for matching long-running tools.
  • Updated metadata conversion utilities to safely handle missing optional fields.
  • Added and updated comprehensive unit tests across a2a_event_test.ts, event_converter_utils_test.ts, part_converter_utils_test.ts, and metadata_converter_utils_test.ts to ensure full coverage and correct behavior.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

All unit tests in core/test/a2a/ pass successfully.

Manual End-to-End (E2E) Tests:

N/A - This is a refactoring and internal logic update covered by unit tests.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

None

@kalenkevich kalenkevich force-pushed the a2a/part_4 branch 7 times, most recently from 995b27f to 2830e84 Compare March 6, 2026 01:30
@kalenkevich kalenkevich merged commit 43618ab into main Mar 6, 2026
6 checks passed
@kalenkevich kalenkevich deleted the a2a/part_4 branch March 6, 2026 01:43
@kalenkevich
Copy link
Collaborator Author

Related to #189

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