fix(monitor): drop stale completion wakes - #41
Merged
trvon merged 3 commits intoAug 17, 2026
Conversation
Contributor
Author
|
@trvon This is a regression in the stale-context path addressed by #33: direct |
trvon
approved these changes
Aug 17, 2026
Owner
There was a problem hiding this comment.
Resolved in two signed maintainer commits:
6d859e4adds a RED behavioral regression proving a stale runtime consumed and deleted an active loop's final fire without delivering a wake.7e83767probes extension-context liveness before any fire accounting, retirement, auto-task creation, monitor-loop deletion, or workflow-wait mutation. The monitor-specific regression now also verifies that stale completion never reachesloop:fireand leaves its loop intact.
Owner
|
@richardhristov Thanks for the PR! |
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
loop:fireemission against stale extension contextsMonitorCreate onDonecompletion path with a regression testRoot cause
#33 guarded events emitted by
MonitorManagerand awaited monitor shutdown during session teardown. However, anonDonecompletion callback callsonLoopFire()directly, andemitLoopFire()still used an unguardedpi.events.emit(). If that callback reaches the old extension runtime after it becomes stale, the synchronous emit throws as an uncaught exception.Non-stale event-bus errors continue to propagate.
Verification
npm run typechecknpm run lint(passes with 4 existing optional-chain warnings)npm test(42 files, 658 tests)npm run buildnpm run test:packagenpm audit --audit-level=moderate