MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / windows_taskkill_tree

Function windows_taskkill_tree

scripts/run-test-wave.py:260–278  ·  view source on GitHub ↗

Force-terminate `pid` and its whole tree; True only on proven success. A tool that cannot start, cannot finish within its own budget, or reports failure is never read as success -- the caller refuses to call the tree clean.

(pid: int)

Source from the content-addressed store, hash-verified

258
259
260def windows_taskkill_tree(pid: int) -> bool:
261 """Force-terminate `pid` and its whole tree; True only on proven success.
262
263 A tool that cannot start, cannot finish within its own budget, or reports
264 failure is never read as success -- the caller refuses to call the tree
265 clean.
266 """
267 try:
268 completed = subprocess.run(
269 ["taskkill.exe", "/PID", str(pid), "/T", "/F"],
270 check=False,
271 stdin=subprocess.DEVNULL,
272 stdout=subprocess.DEVNULL,
273 stderr=subprocess.DEVNULL,
274 timeout=WINDOWS_TASKKILL_SECONDS,
275 )
276 except (OSError, subprocess.TimeoutExpired):
277 return False
278 return completed.returncode == 0
279
280
281def terminate_process_tree(active: ActiveSuite, kill_grace: int) -> None:

Callers 1

terminate_process_treeFunction · 0.85

Calls 2

strFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected