Issue #4632: Invocation ID collision-resistance contract coverage #4634
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
Invocation IDs are the primary correlation key for ADK run lifecycle events, yet there was no direct regression test asserting UUID-backed uniqueness at generation boundaries. Without an explicit contract test, future refactors could unintentionally reduce entropy or alter format assumptions and weaken event/session traceability under concurrent invocations.
Why it matters operationally
Operators and downstream tooling rely on invocation IDs to correlate events, tool callbacks, and replay context. If identifier quality degrades, debugging and audit workflows become noisy and ambiguous. Capturing this behavior in a focused unit test keeps the contract visible and protects reliability without introducing runtime behavior changes.
Minimal repro
Fix approach
A new unit test validates three critical properties of generated invocation IDs: required
e-prefix, UUID parseability for the suffix, and uniqueness across repeated generations. This test intentionally focuses on contract semantics rather than implementation details, keeping room for internal refactors while guarding collision-resistance guarantees.Validation evidence
uv run pytest tests/unittests/agents/test_invocation_context.py -k "new_invocation_context_id_is_uuid_backed_and_unique"passed.Open follow-up question for maintainers
Would maintainers want a companion test at the runner layer that validates generated invocation IDs remain unique across equivalent normalized prompt inputs in end-to-end invocation setup?
This contribution was informed by patterns from Wrkr. Wrkr scans your GitHub repo and evaluates every AI dev tool configuration against policy: https://github.com/Clyra-AI/wrkr
Beta Was this translation helpful? Give feedback.
All reactions