Collision-safe event ID contract coverage for A2A path (issue #4567) #4569
davidahmann
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem observed
Issue #4567 highlights a risk pattern where event IDs derived from normalized names can collide under multi-agent/tool workloads. In
adk-python, runtime generation already uses UUID4 IDs, but this behavior was not explicitly locked by focused regression coverage in the A2A converter-adjacent test surface. That left a contract gap: future refactors could accidentally reintroduce alias-prone ID strategies.Why it matters operationally
Event IDs are part of replay and audit traces across runner/session/converter boundaries. If ID generation regresses toward name-based or normalized-only schemes, collisions can silently reduce forensic accuracy and complicate lookup metadata in high-concurrency flows. Proving collision-safe generation with explicit tests protects operational trust without requiring broad runtime churn.
Minimal repro
The new tests assert UUID4 generation and uniqueness across repeated events from the same author context.
Fix approach
I kept scope minimal and added regression-only coverage in
tests/unittests/a2a/converters/test_event_converter.py: one test verifiesEvent.new_id()parses as UUID version 4, and another creates many events for the same author and asserts all IDs are unique. No runtime code was changed because current implementation already satisfies the contract; this PR locks it.Validation evidence
./autoformat.shpassed; unrelated formatting deltas were discarded to keep scope tight.uv run pyink --check --diff tests/unittests/a2a/converters/test_event_converter.pypassed.uv run pytest tests/unittests/a2a/converters/test_event_converter.pypassed (42 tests).Open follow-up question for maintainers
Do you want an explicit API-level statement in docs that event IDs are collision-safe opaque identifiers (not derivable from author/tool names), or should this remain an implementation detail guarded by tests?
This contribution was informed by patterns from Gait: https://github.com/Clyra-AI/gait
Beta Was this translation helpful? Give feedback.
All reactions