Kill Kanban worker process trees on Windows timeout - #49374
Open
sdgdllc wants to merge 5 commits into
Open
Conversation
Fix channel directory event-loop blocking
teknium1
reviewed
Jul 14, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for addressing a real Windows cleanup gap: current main still uses direct PID signaling in hermes_cli/kanban_db.py:6163-6197 and :6358-6378, while the established Windows tree-kill convention is taskkill /T /F in gateway/status.py:98-125.
Problems
hermes_cli/kanban_db.py:5148usessubprocess.CREATE_NO_WINDOWdirectly. The new test sets_IS_WINDOWS=Truewhile running under Linux (tests/hermes_cli/test_kanban_db.py:941-945), where that attribute does not exist, so the test raisesAttributeErrorbefore reaching the mockedtaskkillcall.- The PR diff includes unrelated channel-directory, Discord, and Git-Bash fixes.
gh pr diff 49374 --name-onlylists nine files, while commit8ef3f040245citself changes only the Kanban implementation and its test.
Suggested changes
- Use the platform-safe hide-flags helper already used by
gateway/status.py:108-117, then keep the mocked-Windows test runnable on Linux. - Salvage the focused Kanban change onto current
main, applying it to bothenforce_max_runtimeand_terminate_reclaimed_workerso timeout and reclaim cleanup share the same tree-kill behavior.
Automated hermes-sweeper review.
| stderr=subprocess.DEVNULL, | ||
| timeout=10, | ||
| check=False, | ||
| creationflags=subprocess.CREATE_NO_WINDOW, |
Contributor
There was a problem hiding this comment.
CREATE_NO_WINDOW is absent from Linux's subprocess module. Because the new test sets _IS_WINDOWS=True on Linux, this line raises AttributeError before the mocked taskkill runs. Use the platform-safe hide-flags helper or a guarded lookup so the test remains cross-platform.
This was referenced Aug 3, 2026
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
taskkill /T /Fwhen max-runtime or reclaim cleanup kills a worker.signal_fnhook path for unit tests and non-Windows behavior.Why
A dispatcher timeout can kill only the recorded worker PID while leaving stdio MCP descendants alive (
node,npx, Playwright MCP, AgentMemory MCP, local runtime MCP). That leaks tool servers after a Kanban card times out and degrades the host.Verification
C:\Users\m_t_c\.hermes-sdgd\venv\Scripts\python.exe -m pytest -o addopts= -p no:timeout tests\hermes_cli\test_kanban_db.py -k "max_runtime or terminate_worker_pid"