Ensure a summarizer stop request is respected after connecting#26776
Merged
kian-thompson merged 1 commit intomicrosoft:mainfrom Mar 20, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a race where a stop request (triggered while the summarizer is still being created) could be lost, causing the summarizer to continue running and eventually hit SummarizerStopTimeout. It adds a mechanism to remember the stop reason during async summarizer creation and replay it immediately once the summarizer instance is available.
Changes:
- Track a pending stop reason while awaiting
createSummarizerFn()and replay it immediately after the summarizer is created. - Clear pending stop intent during cleanup/dispose to avoid cross-cycle contamination.
- Add a targeted unit test covering “stop requested before summarizer creation completes” and validating last-summary behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/runtime/container-runtime/src/summary/summaryManager.ts | Adds pendingStopReason to persist and replay stop intent after async summarizer creation. |
| packages/runtime/container-runtime/src/test/summary/summaryManager.spec.ts | Adds a regression test for the stop-before-create race and test plumbing to observe stop reason + summarize events. |
shlevari
reviewed
Mar 19, 2026
shlevari
approved these changes
Mar 19, 2026
shlevari
left a comment
There was a problem hiding this comment.
Approved with suggestions for added comment
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.
When taking a look at summarizer telemetry, I observed a weird race condition around connection and last summaries. If the parent disconnects and reconnects before the summarizer finishes loading then it won't stop as the parent expects.
Example flow:
summarizer?.stop(...)does nothing since the summarizer has not finished loading (seecreateSummarizerFn())"SummarizerStopTimeout"since it expected its summarizer to stopThis PR adds a stop check right after step 6.
AB#61863