You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ui): ensure correct event order in streaming callbacks - #811
⚠️First-time contributor? This PR cannot be merged until you sign the CLA.
The CLA Assistant bot will post a comment below — reply to it with exactly: I have read the CLA Document and I hereby sign the CLA
(Separate from this: all commits must also be signed off with git commit -s — see the Checklist.)
Summary
Introduce OrderedEventQueue to serialize concurrent event processing during agent runs and sessions
Add custom Detekt rule UnsafeLaunchInStreamingCallback to prevent unsafe scope.launch usage in streaming contexts
Add Lincheck concurrency tests and unit tests to verify thread safety and ordering guarantees
Integrate Kover test coverage reporting and configure CI build workflows for test verification
- Introduce OrderedEventQueue to serialize concurrent event processing during agent runs and sessions
- Add custom Detekt rule UnsafeLaunchInStreamingCallback to prevent unsafe scope.launch usage in streaming contexts
- Add Lincheck concurrency tests and unit tests to verify thread safety and ordering guarantees
- Integrate Kover test coverage reporting and configure CI build workflows for test verification
This PR fixes out-of-order streaming updates by serializing session and agent callbacks through FIFO event queues. It also adds static analysis, concurrency tests, coverage tooling, and CI integration.
Changes:
Added OrderedEventQueue integration for session and agent timeline processing.
Added the UnsafeLaunchInStreamingCallback Detekt rule and supporting tests.
Added Lincheck tests, Kover coverage reporting, Gradle verification, and CI workflows.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Active critical and moderate findings remain in the Kover build configuration, coverage regression baseline handling, and agent turn lifecycle, preventing reliable build verification and correct concurrent turn behavior.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The change still contains a build-configuration error and unguarded asynchronous turn-finalization races that can corrupt newer runs, while coverage task wiring may omit per-module reports.
The local response builder fixes one shared-field race, but this completion path still mutates shared messages, completedGroups, activeAgentSessionId, and invokes onRunCompleted() after isRunning was set false and the coroutine suspended in join(). A new turn can start in that window, so the old turn can finalize the new turn's streaming message and save its record under the new conversation. Keep turn ownership until all finalization is complete, or guard every shared-state write and callback with the captured turnId.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Approval is blocked by a critical race in turn finalization that can corrupt persisted timeline data, along with a moderate test-helper issue that mutates the developer or CI user's global Testcontainers configuration.
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
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
Related Issue(s)
#804
Type of Change
What Changed & Why
How to Test
./gradlew testScreenshots / Recordings (if applicable)
Checklist
main./gradlew spotlessApplyand./gradlew detektlocally./gradlew testand all tests passgit commit -sAdditional Notes