kshitijk4poor
547f985286
refactor(deadline): consolidate site-local tree-kills onto agent.deadline.kill_process_tree ( #85125 4d)
...
Per-site decisions:
1. hermes_cli/_subprocess_compat.py kill_process_tree(proc) -> None:
MIGRATED. Body now delegates to agent.deadline.kill_process_tree(proc.pid)
via a function-local import; keeps the swallow-everything fail-open
contract and the (proc) -> None signature (agent/shell_hooks.py imports
it by name; _kill_git_process_tree alias preserved). The old body is kept
verbatim as _legacy_kill_process_tree and used as fallback when the
delegation import/call fails. A final proc.kill() is retained on the
happy path so Popen bookkeeping sees the exit (matches old behavior).
2. tools/browser_tool.py _kill_process_tree(proc): MIGRATED, same pattern
(delegate + _legacy_kill_process_tree fallback). Behavior delta: the old
body sent SIGTERM then SIGKILL with zero grace between them; the shared
primitive sends SIGKILL only. With no grace period the observable effect
is identical, and the psutil descendant sweep now also reaches
agent-browser's setsid'd daemon grandchild, which killpg alone missed.
tests/tools/test_browser_npx_warmup.py's TestKillProcessTree repointed at
the legacy fallback (its assertions describe the fallback's internals).
3. tools/code_execution_tool.py _kill_process_group(proc, escalate):
MIGRATED. It was a plain parent+descendants terminate (then wait 5s +
kill when escalate=True) — expressed as two delegated calls:
kill_process_tree(pid, sig=SIGTERM), then on escalate-timeout
kill_process_tree(pid, sig=SIGKILL). Delegation failure degrades to
proc.kill(), mirroring the old psutil-failure fallback. Delta: the old
body terminated children before the parent; the shared primitive
signals the group atomically (child is a session leader via
start_new_session=True) plus an identity-aware descendant sweep —
strictly wider coverage, same signals.
4. gateway/status.py: KEPT BOTH SITES.
- terminate_pid (~l305) taskkill wrapper: NOT migrated. Its contract is
incompatible with the shared primitive — it must RAISE OSError with
taskkill's stderr on non-zero exit (callers branch on that), falls back
to os.kill on FileNotFoundError, and its POSIX branch is deliberately a
single-PID SIGTERM/SIGKILL, not a tree kill. Wrapping the bool-returning
fail-soft primitive would invert the error contract.
- reap_gateway_children (~l2029): NOT migrated. It operates on a
pre-snapshotted child list from a parent that is already dead
(psutil.Process(pid) on the parent would fail), and every signal is
wrapped in identity/ownership checks the primitive lacks: is_running()
identity, zombie skip, and the skip-if-ppid-still-equals-parent guard,
plus SIGTERM -> wait_procs -> SIGKILL staging and a reaped-count return.
The coupling is the feature; migrating would delete the safety logic.
5. scripts/run_tests_parallel.py _kill_process_tree (~l253): NOT migrated.
Dev tooling that intentionally kills by CAPTURED pgid because the direct
child is usually already reaped (psutil/pid-based primitive cannot find
it), and it avoids the psutil import on the test-runner hot path. Its
docstring already documents why psutil is the wrong tool there.
New tests: tests/agent/test_treekill_consolidation.py — delegation +
raise-swallowing tests per migrated wrapper, consumer-identity checks, and
a live end-to-end probe (setsid grandchild dies through the compat wrapper,
zero survivors).
2026-08-25 01:34:56 +05:30
..
2026-08-14 21:17:00 -07:00
2026-08-23 02:14:35 -07:00
2026-07-29 13:10:23 -07:00
2026-08-13 02:03:40 -07:00
2026-08-14 21:54:56 -07:00
2026-08-09 22:09:49 -04:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-12 23:47:28 -07:00
2026-08-14 21:27:05 -07:00
2026-08-15 00:34:29 -07:00
2026-08-18 20:34:46 -04:00
2026-06-10 20:45:16 -07:00
2026-08-20 12:29:11 -05:00
2026-08-01 16:42:51 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-23 02:54:30 -07:00
2026-08-16 19:53:07 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-04 15:44:50 -07:00
2026-07-29 15:37:24 -07:00
2026-08-13 11:41:59 -07:00
2026-07-15 07:47:18 -07:00
2026-07-29 13:10:23 -07:00
2026-07-01 17:00:30 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-24 15:29:45 +05:30
2026-07-29 13:10:23 -07:00
2026-08-03 23:01:03 +05:30
2026-07-29 13:10:23 -07:00
2026-08-13 11:45:27 -07:00
2026-08-02 22:15:20 +05:30
2026-08-11 23:36:47 -05:00
2026-07-29 13:10:23 -07:00
2026-08-02 20:12:50 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-16 10:27:52 -07:00
2026-07-29 13:10:23 -07:00
2026-08-22 19:30:10 -07:00
2026-07-29 13:10:23 -07:00
2026-08-22 19:30:10 -07:00
2026-08-16 01:55:00 -07:00
2026-07-29 13:10:23 -07:00
2026-08-14 21:54:56 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-14 13:56:58 -07:00
2026-07-29 13:10:23 -07:00
2026-07-31 23:16:58 -07:00
2026-08-20 20:20:23 -07:00
2026-08-02 11:52:59 +05:30
2026-08-07 16:57:11 +05:30
2026-07-29 13:10:23 -07:00
2026-06-27 11:43:08 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 01:04:19 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 01:04:19 -07:00
2026-08-24 11:25:04 -07:00
2026-07-29 15:37:24 -07:00
2026-08-12 12:42:39 +05:30
2026-07-31 22:53:20 -07:00
2026-08-23 19:02:30 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-24 11:25:04 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 03:16:21 -07:00
2026-08-23 18:27:07 -07:00
2026-07-22 08:11:40 -07:00
2026-08-02 16:16:36 -07:00
2026-07-29 13:10:23 -07:00
2026-07-23 08:19:14 -07:00
2026-07-29 13:10:23 -07:00
2026-08-09 22:29:39 +05:30
2026-08-23 18:27:07 -07:00
2026-07-29 13:10:23 -07:00
2026-07-22 08:13:41 -07:00
2026-08-23 18:25:19 -07:00
2026-06-21 11:34:47 -07:00
2026-07-29 13:10:23 -07:00
2026-08-02 22:15:20 +05:30
2026-06-25 12:56:05 -07:00
2026-07-29 15:37:24 -07:00
2026-08-07 13:24:56 +05:30
2026-07-29 13:10:23 -07:00
2026-08-02 16:16:36 -07:00
2026-08-17 18:15:46 +05:30
2026-07-29 13:10:23 -07:00
2026-08-02 16:16:36 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-23 15:03:29 +05:30
2026-07-31 23:16:58 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-31 23:16:58 -07:00
2026-07-29 13:10:23 -07:00
2026-06-07 22:09:45 -07:00
2026-07-29 13:10:23 -07:00
2026-08-23 18:27:07 -07:00
2026-08-23 18:27:07 -07:00
2026-07-29 13:10:23 -07:00
2026-08-14 01:08:13 -07:00
2026-08-23 17:01:20 -07:00
2026-07-29 13:10:23 -07:00
2026-07-23 19:44:35 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-08 05:44:18 -07:00
2026-07-29 21:30:53 -07:00
2026-08-04 11:00:04 +05:30
2026-08-24 04:14:26 +05:30
2026-08-16 06:31:46 -07:00
2026-08-03 19:08:09 +05:30
2026-08-04 11:35:06 -06:00
2026-08-04 13:12:24 +05:30
2026-07-17 13:08:46 -04:00
2026-07-29 13:10:23 -07:00
2026-07-31 22:32:48 -07:00
2026-08-23 20:01:18 -07:00
2026-08-04 13:20:15 +05:30
2026-08-12 23:47:28 -07:00
2026-08-14 21:54:56 -07:00
2026-07-29 13:10:23 -07:00
2026-08-08 19:17:02 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-22 04:20:48 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-16 22:06:41 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-08 06:04:14 -07:00
2026-08-03 20:43:38 +05:30
2026-08-23 20:01:18 -07:00
2026-08-14 16:37:36 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 02:21:39 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-02 21:48:06 -07:00
2026-08-16 22:06:08 -07:00
2026-08-15 01:04:19 -07:00
2026-08-03 21:53:13 +05:30
2026-07-29 13:10:23 -07:00
2026-08-23 20:02:07 -07:00
2026-08-23 18:43:12 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-13 15:24:47 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-19 14:58:59 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-23 18:27:04 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-16 02:01:41 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-23 17:47:50 -07:00
2026-08-14 02:04:24 +05:30
2026-07-29 13:10:23 -07:00
2026-08-23 18:25:19 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-08 05:09:43 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-23 13:34:32 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-19 22:41:05 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 21:30:53 -07:00
2026-08-13 23:15:25 +05:30
2026-08-13 11:49:14 -07:00
2026-08-13 23:15:25 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-06-19 15:23:41 +08:00
2026-08-15 01:04:19 -07:00
2026-08-20 00:03:50 +05:30
2026-08-17 12:58:51 -07:00
2026-08-17 12:58:51 -07:00
2026-08-07 19:44:35 +05:30
2026-08-14 22:04:16 -07:00
2026-07-29 13:10:23 -07:00
2026-08-01 14:27:12 +05:30
2026-07-01 06:02:33 -07:00
2026-08-03 22:43:15 +05:30
2026-07-23 16:17:27 -07:00
2026-08-13 23:10:16 +05:30
2026-08-14 21:36:41 -07:00
2026-07-29 13:10:23 -07:00
2026-07-23 18:40:09 -07:00
2026-07-29 13:10:23 -07:00
2026-07-23 18:40:09 -07:00
2026-08-13 15:24:47 +05:30
2026-08-13 15:24:47 +05:30
2026-08-19 13:56:11 -05:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-24 03:20:57 -07:00
2026-07-29 15:12:28 -07:00
2026-08-23 02:14:35 -07:00
2026-08-12 14:42:00 -04:00
2026-08-14 03:31:22 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-09 21:10:07 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-21 00:24:32 -07:00
2026-07-29 15:37:24 -07:00
2026-07-29 07:47:06 +10:00
2026-08-02 15:01:11 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 00:33:01 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-12 18:41:59 -07:00
2026-08-12 16:25:20 -07:00
2026-07-29 13:10:23 -07:00
2026-08-18 02:12:30 -07:00
2026-07-29 13:10:23 -07:00
2026-08-03 22:55:36 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 15:37:24 -07:00
2026-08-06 02:22:08 +05:30
2026-08-06 02:22:08 +05:30
2026-08-23 17:47:50 -07:00
2026-08-14 14:37:00 -07:00
2026-08-17 14:06:16 -07:00
2026-08-23 18:27:12 -07:00
2026-08-09 15:25:12 +05:30
2026-08-15 11:09:56 +05:30
2026-08-13 15:24:47 +05:30
2026-08-21 12:23:47 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-08 23:14:30 -07:00
2026-07-29 13:10:23 -07:00
2026-07-10 05:41:59 -05:00
2026-08-19 22:56:04 -07:00
2026-08-19 16:04:22 -07:00
2026-08-16 10:51:11 -07:00
2026-08-06 22:02:37 -05:00
2026-08-07 17:50:03 +05:30
2026-08-22 16:47:39 +02:00
2026-08-05 22:40:51 -07:00
2026-08-19 22:11:13 -04:00
2026-08-13 12:23:36 -07:00
2026-08-19 08:52:03 -07:00
2026-08-19 08:52:03 -07:00
2026-08-15 00:33:01 -07:00
2026-08-19 09:14:12 -07:00
2026-08-19 08:52:01 -07:00
2026-08-16 01:55:51 -07:00
2026-08-08 17:42:34 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-07 19:44:35 +05:30
2026-08-23 19:04:37 -07:00
2026-07-21 12:11:31 +05:30
2026-08-19 16:32:17 -07:00
2026-07-29 13:10:23 -07:00
2026-08-20 11:36:54 +05:30
2026-07-29 13:10:23 -07:00
2026-08-23 20:00:30 -07:00
2026-08-21 13:21:46 +10:00
2026-08-07 16:57:11 +05:30
2026-08-16 11:32:02 -07:00
2026-08-02 16:16:36 -07:00
2026-08-23 13:34:32 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-12 19:44:04 -07:00
2026-08-15 23:03:52 -07:00
2026-07-31 07:30:30 -07:00
2026-07-29 13:10:23 -07:00
2026-08-19 19:41:42 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 02:45:50 -07:00
2026-08-16 06:24:56 -07:00
2026-08-14 21:54:56 -07:00
2026-08-08 00:07:14 +05:30
2026-08-21 13:24:43 +05:30
2026-08-14 14:15:42 -07:00
2026-08-08 15:10:24 +05:30
2026-07-29 13:10:23 -07:00
2026-08-08 14:09:41 -07:00
2026-08-20 00:16:22 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-18 20:34:46 -04:00
2026-08-23 18:25:19 -07:00
2026-07-29 13:10:23 -07:00
2026-08-07 08:57:57 -07:00
2026-07-29 13:10:23 -07:00
2026-08-16 22:07:43 -07:00
2026-07-29 10:14:11 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-07 19:44:35 +05:30
2026-07-29 13:10:23 -07:00
2026-07-30 21:07:36 +05:30
2026-08-08 12:31:19 -07:00
2026-07-28 03:54:16 -05:00
2026-07-29 13:10:23 -07:00
2026-08-23 18:27:12 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 00:33:01 -07:00
2026-08-16 22:10:02 -07:00
2026-07-29 13:10:23 -07:00
2026-08-23 18:24:43 -07:00
2026-07-20 13:04:12 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-14 21:41:26 -07:00
2026-07-29 13:10:23 -07:00
2026-08-25 01:34:56 +05:30
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 01:04:19 -07:00
2026-07-29 13:10:23 -07:00
2026-08-15 01:04:19 -07:00
2026-07-29 13:10:23 -07:00
2026-08-16 01:56:18 -07:00
2026-07-29 13:10:23 -07:00
2026-08-08 11:24:45 -07:00
2026-07-29 13:10:23 -07:00
2026-08-20 12:35:20 +05:30
2026-07-29 13:10:23 -07:00
2026-07-16 04:23:12 -07:00
2026-08-24 03:23:07 -07:00
2026-07-24 15:55:08 -07:00
2026-08-16 00:14:58 -07:00
2026-08-03 20:43:38 +05:30
2026-08-12 01:15:25 -07:00
2026-06-30 00:59:29 -05:00
2026-07-29 13:10:23 -07:00
2026-07-29 13:10:23 -07:00
2026-07-29 18:55:10 -07:00
2026-08-22 16:07:12 +05:30