Hermes Agent
94f3dbec9b
fix(agent): close one-shot AIAgents on every exit path
...
Four surfaces build a throwaway AIAgent and never call close() — the
owner boundary that releases memory-provider sessions, tool
subprocesses and httpx clients. In long-lived processes each run leaked
all of them until exit:
- batch_runner._process_single_prompt: one agent per prompt, N prompts
per batch process.
- feishu_comment._run_comment_agent: one agent per comment run in the
gateway process.
- tui_gateway prompt.background: one side agent per background turn.
- cli /bg: one agent per background task in the CLI process.
Wrap each run in try/finally with a suppressed close(), mirroring
gateway/run.py's owner pattern. preview.restart stays deliberately
unclosed (its task exists to leave a detached server running), and the
prompt.background side agent is safe to close: its session_id is the bg
task id, so close() reaps only its own task resources.
Fixes #50197
2026-09-25 12:49:56 -05:00
..
2026-09-24 06:55:33 -04:00
2026-09-24 11:50:30 -04:00
2026-09-24 23:49:18 -04:00
2026-09-24 19:28:05 -05:00
2026-09-24 14:47:06 -04:00
2026-09-24 14:08:22 -04:00
2026-09-24 06:03:29 -04:00
2026-09-23 19:51:34 -04:00
2026-09-25 00:00:09 -04:00
2026-09-24 02:03:59 -04:00
2026-09-25 21:27:06 +05:30
2026-09-24 18:06:48 +05:30
2026-09-25 21:27:06 +05:30
2026-09-25 21:27:06 +05:30
2026-09-24 08:51:52 -04:00
2026-09-24 02:03:59 -04:00
2026-09-24 01:40:31 -04:00
2026-09-25 12:07:32 -05:00
2026-09-24 01:55:51 -04:00
2026-09-24 01:55:51 -04:00
2026-09-24 22:32:57 +05:30
2026-09-25 12:49:56 -05:00
2026-09-23 15:26:34 -04:00
2026-09-24 22:32:57 +05:30
2026-09-25 21:27:06 +05:30
2026-09-24 13:13:35 -04:00
2026-09-23 17:09:54 -07:00
2026-09-23 17:09:54 -07:00
2026-09-24 13:10:14 -04:00
2026-09-23 22:05:49 +00:00
2026-09-24 00:17:13 -07:00
2026-09-23 22:05:49 +00:00
2026-09-24 00:17:13 -07:00
2026-09-25 21:27:06 +05:30
2026-09-24 03:48:31 -04:00
2026-09-23 19:51:34 -04:00
2026-09-24 06:08:20 -04:00
2026-09-23 15:05:44 -07:00
2026-09-24 09:20:50 -04:00
2026-09-23 15:26:34 -04:00
2026-09-24 08:51:52 -04:00
2026-09-24 08:51:52 -04:00
2026-09-24 01:55:51 -04:00
2026-09-23 15:26:34 -04:00
2026-09-25 12:01:44 -05:00
2026-09-23 15:26:34 -04:00
2026-09-25 12:01:44 -05:00
2026-09-25 12:01:44 -05:00
2026-09-24 23:52:31 -04:00
2026-09-23 18:29:35 -05:00
2026-09-24 22:25:06 +05:30
2026-09-24 07:39:33 -04:00
2026-09-24 08:51:52 -04:00
2026-09-24 11:50:30 -04:00
2026-09-23 15:26:34 -04:00
2026-09-24 16:17:35 -04:00
2026-09-24 04:27:31 -05:00
2026-09-24 01:55:51 -04:00
2026-09-25 12:09:37 -05:00
2026-09-23 15:26:34 -04:00
2026-09-24 11:50:30 -04:00
2026-09-24 14:08:21 -04:00
2026-09-25 21:27:06 +05:30
2026-09-25 12:07:32 -05:00
2026-09-25 12:07:32 -05:00
2026-09-23 19:33:40 -07:00
2026-09-24 06:24:56 -05:00
2026-09-25 12:07:32 -05:00
2026-09-24 16:17:47 -04:00
2026-09-24 23:59:55 -04:00
2026-09-24 02:03:03 -07:00
2026-09-24 05:10:12 -04:00
2026-09-23 21:55:59 -04:00
2026-09-24 14:08:21 -04:00
2026-09-24 11:50:29 -04:00
2026-09-24 14:08:21 -04:00
2026-09-24 11:50:29 -04:00
2026-09-24 11:50:29 -04:00
2026-09-25 21:19:04 +05:30
2026-09-24 11:50:29 -04:00
2026-09-25 21:19:04 +05:30
2026-09-24 11:50:29 -04:00
2026-09-25 21:19:04 +05:30
2026-09-24 14:08:21 -04:00
2026-09-24 05:18:38 -04:00
2026-09-24 11:58:45 -04:00
2026-09-24 16:17:16 -04:00
2026-09-25 00:00:09 -04:00
2026-09-25 12:09:37 -05:00
2026-09-24 06:14:42 -04:00
2026-09-23 15:26:34 -04:00
2026-09-23 19:51:34 -04:00
2026-09-25 00:00:09 -04:00
2026-09-24 11:50:30 -04:00
2026-09-24 12:30:00 -04:00
2026-09-23 15:43:51 -07:00
2026-09-25 10:46:54 -05:00
2026-09-24 18:08:24 +05:30
2026-09-24 17:59:37 +05:30
2026-09-24 08:51:52 -04:00
2026-09-24 19:17:34 -04:00
2026-09-24 11:50:30 -04:00
2026-09-24 02:03:58 -04:00
2026-09-24 14:23:48 -04:00
2026-09-23 22:05:57 -04:00
2026-09-23 18:29:35 -05:00
2026-09-24 11:12:27 -04:00
2026-09-24 02:03:59 -04:00
2026-09-24 16:17:16 -04:00
2026-09-24 16:17:47 -04:00
2026-09-25 12:09:37 -05:00
2026-09-24 14:08:22 -04:00
2026-09-23 17:39:15 -07:00
2026-09-23 18:48:33 -05:00
2026-09-25 12:09:37 -05:00
2026-09-24 05:03:23 -04:00
2026-09-24 23:52:31 -04:00
2026-09-24 11:50:30 -04:00
2026-09-24 14:08:22 -04:00
2026-09-25 00:00:09 -04:00
2026-09-24 14:08:22 -04:00
2026-09-25 12:09:37 -05:00
2026-09-23 15:26:39 -04:00
2026-09-25 01:21:28 -04:00
2026-09-25 12:01:44 -05:00
2026-09-25 00:00:09 -04:00
2026-09-24 14:23:48 -04:00
2026-09-23 15:26:34 -04:00
2026-09-25 12:01:44 -05:00
2026-09-24 11:50:30 -04:00
2026-09-25 12:09:37 -05:00
2026-09-25 12:09:37 -05:00
2026-09-23 21:55:59 -04:00
2026-09-24 15:38:22 +05:30
2026-09-23 19:51:34 -04:00