Fix orphaned worker scan after reconnect system messages#525
Merged
Conversation
Compare worker completion timestamps against the orchestrator's last assistant synthesis message instead of its last message of any type. This avoids suppressing orphan warnings when reconnect/recovery adds a newer system message after app restart. Also adds a regression test covering the restore scenario where the orchestrator has a newer system message but an older assistant response, so unsynthesized worker results are still detected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Owner
Author
🔍 Multi-Model Code Review — PR #525CI StatusFindingsNo requested changes. All three reviewers independently agreed that this is a focused, correct fix:
Test Coverage Assessment✅ The new regression test directly covers the scenario this PR is intended to fix. Recommendation✅ Approve — the change is minimal, correct, and appropriately tested. |
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
Follow-up to the recent orphaned-worker scan work: after a crash/reconnect, the orchestrator can receive a fresh system message (for example, a recreated/reconnected marker) that is newer than a workers unsynthesized response. The existing scan compared against the orchestrators last message of any type, which could suppress the warning and miss the exact orphaned result it was meant to detect.
Changes
Validation
dotnet test PolyPilot.Tests/ --nologo -v qThis is a focused follow-up improvement based on the recent post-merge review of the multi-agent restore/orphan scan logic.