Summary
Add regression coverage for event compaction when ParallelAgent branches append events in an order different from their event timestamps.
Reproduction
With the current vendored ADK snapshot, this event sequence reproduces:
- branch B function call (timestamp 2.0),
- branch B function response (timestamp 3.0),
- branch A function call (timestamp 1.0, appended late),
- branch A function response (timestamp 4.0),
- a compaction range covering timestamps 0.0 through 3.0.
When assembling branch A's contents, timestamp-based compaction removes A's call while retaining A's response. The runner then raises:
ValueError: No function call event found for function responses ids: {'a1'}
This matches the failure observed in a three-branch ParallelAgent workload with token-threshold compaction.
Current status
The current main branch passes the minimal reproduction, apparently due to the self-contained compaction prefix and compacted-function-call recovery changes. This issue requests a focused regression test so that behavior remains protected.
Related: #4740 (compaction removing a pending function call), and commit 71b936b (prevent compaction from orphaning function responses).
Proposed test
Add a unit or runner-level regression test with explicitly out-of-order timestamps and parallel branch IDs. Assert that contents assembly does not raise and that the function call/response pair remains valid.
Summary
Add regression coverage for event compaction when ParallelAgent branches append events in an order different from their event timestamps.
Reproduction
With the current vendored ADK snapshot, this event sequence reproduces:
When assembling branch A's contents, timestamp-based compaction removes A's call while retaining A's response. The runner then raises:
ValueError: No function call event found for function responses ids: {'a1'}This matches the failure observed in a three-branch ParallelAgent workload with token-threshold compaction.
Current status
The current
mainbranch passes the minimal reproduction, apparently due to the self-contained compaction prefix and compacted-function-call recovery changes. This issue requests a focused regression test so that behavior remains protected.Related: #4740 (compaction removing a pending function call), and commit 71b936b (prevent compaction from orphaning function responses).
Proposed test
Add a unit or runner-level regression test with explicitly out-of-order timestamps and parallel branch IDs. Assert that contents assembly does not raise and that the function call/response pair remains valid.