Skip to content

fix(#162): scope emitted-task-events to monitor session#266

Open
mvillmow wants to merge 2 commits into
mainfrom
162-auto-impl
Open

fix(#162): scope emitted-task-events to monitor session#266
mvillmow wants to merge 2 commits into
mainfrom
162-auto-impl

Conversation

@mvillmow

@mvillmow mvillmow commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes issue #162: eliminate the _emitted_task_events state leak by scoping the "already-emitted" set to a single _monitor_completion() call rather than the executor instance.

  • Remove self._emitted_task_events instance attribute from __init__
  • Remove per-execute() reset (now dead code)
  • Declare emitted_done as local variable in _monitor_completion()
  • Add regression test verifying callbacks re-emit on second call

Test Plan

  • New regression test test_monitor_completion_does_not_leak_emitted_subjects_across_calls passes
  • All existing tests in test_executor.py pass (21 tests)
  • Linting clean (ruff check)
  • No remaining references to deleted attribute

Closes #162

@mvillmow mvillmow left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

mvillmow and others added 2 commits June 28, 2026 09:46
… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MAJOR] §9: _emitted_task_events state leak between monitor calls

1 participant