Skip to content

[compaction] Add regression coverage for out-of-order ParallelAgent events #7324

Description

@dat-lequoc

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions