test: cover parallel compaction event ordering - #7326
Open
dat-lequoc wants to merge 2 commits into
Open
dat-lequoc wants to merge 2 commits into
dat-lequoc wants to merge 2 commits into
Conversation
Author
|
The code checks, header check, and Google CLA check passed. The only failure was the repository's
I cannot rerun that check because GitHub requires repository-admin rights for reruns. Maintainers can rerun it if needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
python -m pytest -q tests/unittests/apps/test_compaction.py -k parallel_timestamp— 1 passed.python -m pytest -q tests/unittests/apps/test_compaction.py— 58 passed.pyink --check,ruff check, andgit diff --check— passed.No function call event foundexception.All tests ran in the project
.venv.