fix(#162): scope emitted-task-events to monitor session#266
Open
mvillmow wants to merge 2 commits into
Open
Conversation
mvillmow
commented
Jun 20, 2026
mvillmow
left a comment
Contributor
Author
There was a problem hiding this comment.
LGTM — emitted-events set correctly moved from instance state to a per-call local in _monitor_completion; instance attr + execute() reset removed cleanly; regression test reproduces the exact leak and guards the deleted attribute. No correctness or principle findings.
… instance Fixes issue #162: _emitted_task_events state leak between monitor calls. - Remove instance attribute from __init__ and per-execute() reset - Declare emitted_done as local variable in _monitor_completion() - Eliminates hidden coupling between execute() and _monitor_completion() - Each monitor session gets its own fresh emitted-events set - Add regression test verifying re-emission on second call Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
No additional follow-ups identified within scope. Deprecation warning deferred to separate maintenance task. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
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
Fixes issue #162: eliminate the
_emitted_task_eventsstate leak by scoping the "already-emitted" set to a single_monitor_completion()call rather than the executor instance.self._emitted_task_eventsinstance attribute from__init__emitted_doneas local variable in_monitor_completion()Test Plan
test_monitor_completion_does_not_leak_emitted_subjects_across_callspassestest_executor.pypass (21 tests)Closes #162