Skip to content

test: cover parallel compaction event ordering - #7326

Open
dat-lequoc wants to merge 2 commits into
google:mainfrom
dat-lequoc:test/parallel-compaction-ordering
Open

dat-lequoc wants to merge 2 commits into
google:mainfrom
dat-lequoc:test/parallel-compaction-ordering

Conversation

@dat-lequoc

@dat-lequoc dat-lequoc commented Sep 28, 2026 •

Copy link
Copy Markdown

Summary

Closes #7324.

Add regression coverage for event compaction when ParallelAgent branches append events in an order different from their timestamps. This is the failure mode that can leave a function response without its matching function call and raise:

ValueError: No function call event found for function responses ids: ...

The test models two branches: the reproducer's completed call/response is appended first, while the analyzer's earlier-timestamped call is appended later. A compaction range then covers the earlier timestamps. It asserts that the analyzer's function call appears exactly once and before its matching response during content assembly.

The relevant upstream recovery fix is commit 0c517e76, first included in release v2.5.0. Commit 71b936b alone does not fix this exact prompt-assembly reproduction. This PR deliberately contains regression coverage only.

Testing plan

  • Focused test: python -m pytest -q tests/unittests/apps/test_compaction.py -k parallel_timestamp — 1 passed.
  • Full app compaction suite: python -m pytest -q tests/unittests/apps/test_compaction.py — 58 passed.
  • pyink --check, ruff check, and git diff --check — passed.
  • The exact reproduction crashes on ADK v2.4.0 and passes on v2.5.0.
  • The immediate pre-fix revision also fails with the reported No function call event found exception.

All tests ran in the project .venv.

@dat-lequoc

Copy link
Copy Markdown
Author

The code checks, header check, and Google CLA check passed. The only failure was the repository's agent-triage-pull-request automation, which exited on a transient Gemini API error:

503 UNAVAILABLE: This model is currently experiencing high demand

I cannot rerun that check because GitHub requires repository-admin rights for reruns. Maintainers can rerun it if needed.

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.

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

1 participant