Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 14 files with indirect coverage changes 🚀 New features to boost your workflow:
|
2 of 6 tasks
HootRock
force-pushed
the
fix-concurrent-dropped-event-batches
branch
from
November 27, 2026 05:33
23a8c3b to
3743cd5
Compare
This branch has not been deployed
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.
Why are these changes needed?
Two concurrent
EventLogWriter.persist_dropped()calls can list the same existing segments and select the same next filename. Replacing that file withwrite()silently loses one complete batch, including when the writers share aSqliteKnowledgeStore.Append each serialized batch using the existing atomic
KnowledgeStore.append()contract and terminate it with a newline. Writers that select the same segment then retain both batches as valid JSONL. Numeric segment allocation and final snapshot replacement remain unchanged; concurrent batches may appear in either append order.The regression forces both public
list()calls to return their snapshots before either writer persists. It exercises real memory, disk, and SQLite backends, checks two multi-event batches, and verifies subsequent dropped and final events still load in order. All three cases fail on current main because one batch disappears, and pass with this change.Refreshed on current upstream main
1742d550b554e3ce2eb726d421b562c151eb27b9. The test import conflict is resolved by retaining both upstreamKnowledgePluginand the regression'sKnowledgeStoreimports. All current upstream knowledge tests are retained.Local validation with Python 3.12.12 on Windows:
python -m pytest test/knowledge -q: 117 passed, 27 skipped (existing platform/dependency skips).python -m ruff check --no-fix ag2/knowledge/log.py test/knowledge/test_knowledge.pyandpython -m ruff format --check ag2/knowledge/log.py test/knowledge/test_knowledge.py: passed.git diff --check HEAD: passed.The full repository suite, full pre-commit/mypy pipeline, Redis service, and cross-process filesystem behavior were not exercised locally. No model/provider calls were made.
Related issue number
Fixes #3482.
Checks
AI assistance
Codex assisted with the diagnosis, code, regression test, PR text, and an independent agent review. The diff and claims were checked against the source and the observed failing/passing test results.
reviewed and tested locally.