Teknium
3f2a56d1a4
fix(cli): reliable interrupts, bounded exit, and exit feedback ( #57000 )
...
Three CLI reliability fixes:
1. Interrupt reliability: chat() only re-queued the user's interrupt
message when the turn result carried interrupted=True. When the agent
thread raced past its last interrupt check (or finished) before the
interrupt landed, the message was silently dropped — and the stale
_interrupt_requested flag left on the agent instantly aborted the
NEXT turn. Un-acknowledged interrupt messages are now re-queued as
the next turn and the stale flag is cleared (only when the agent
thread actually exited). The clarify-race path also parks the message
in _pending_input instead of dropping it.
2. Slow exit (5+ min): stdlib ThreadPoolExecutor workers are non-daemon
and joined unconditionally by concurrent.futures' atexit hook — even
after shutdown(wait=False). One wedged tool worker (abandoned after
interrupt/timeout) held the process open forever. Promoted
async_delegation's daemon executor to a shared tools/daemon_pool
module and adopted it in tool_executor (concurrent tool batches),
memory_manager (background sync), delegate_tool (child timeout wrapper
+ batch fan-out), and skills_hub (source fan-out). Added a 30s exit
watchdog (HERMES_EXIT_WATCHDOG_S) armed at _run_cleanup start as a
backstop for wedged cleanup steps.
3. Exit jank: after prompt_toolkit tears down the input/status bars the
terminal sat silent for the whole cleanup window, looking hung. Print
'Shutting down… (finalizing session)' immediately at exit start.
E2E: live PTY interrupt of a foreground 'sleep 120' terminal tool now
aborts in ~1s and the typed message runs as the next turn; wedged-worker
+ wedged-cleanup subprocess exits in 5.8s (watchdog) instead of hanging.
2026-07-02 04:20:43 -07:00
..
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 13:33:48 -07:00
2026-05-28 22:26:25 -07:00
2026-07-01 17:17:01 +05:30
2026-07-01 05:35:26 -07:00
2026-06-30 15:51:17 -07:00
2026-06-11 10:49:47 -07:00
2026-06-29 01:26:24 -07:00
2026-06-29 01:26:24 -07:00
2026-06-29 01:26:24 -07:00
2026-05-28 22:26:25 -07:00
2026-06-29 01:26:24 -07:00
2026-06-25 22:02:22 -07:00
2026-07-01 05:09:35 -07:00
2026-07-02 05:23:23 +05:30
2026-06-28 12:25:15 -05:00
2026-06-28 13:49:08 -07:00
2026-05-28 22:26:25 -07:00
2026-06-29 02:24:57 -07:00
2026-07-01 05:23:17 -07:00
2026-07-01 05:04:41 -07:00
2026-05-28 22:26:25 -07:00
2026-07-02 13:10:30 +05:30
2026-05-30 07:31:25 -07:00
2026-06-28 14:25:10 -07:00
2026-06-27 15:59:00 -07:00
2026-06-28 13:49:08 -07:00
2026-07-01 05:04:41 -07:00
2026-06-28 12:14:21 -05:00
2026-06-21 15:23:47 -07:00
2026-07-01 20:01:55 +03:00
2026-07-01 05:04:41 -07:00
2026-06-28 02:42:01 -07:00
2026-06-21 07:26:18 -07:00
2026-05-28 22:26:25 -07:00
2026-06-25 22:02:22 -07:00
2026-06-21 17:46:38 +05:30
2026-05-28 22:26:25 -07:00
2026-06-28 04:13:19 -07:00
2026-06-19 06:31:08 -07:00
2026-05-28 22:26:25 -07:00
2026-05-29 03:44:49 -07:00
2026-07-01 04:08:37 -07:00
2026-06-18 12:48:36 +10:00
2026-06-22 06:42:30 -07:00
2026-06-07 02:09:20 -07:00
2026-06-22 18:48:07 -05:00
2026-05-28 22:26:25 -07:00
2026-06-29 15:32:20 +10:00
2026-06-27 04:57:15 +05:30
2026-06-30 17:29:03 -07:00
2026-07-01 00:13:36 -07:00
2026-06-26 01:11:11 -07:00
2026-06-21 13:28:04 +05:30
2026-07-01 14:23:01 +05:30
2026-05-28 22:26:25 -07:00
2026-07-02 04:20:43 -07:00
2026-06-28 14:33:03 -07:00
2026-05-28 22:26:25 -07:00
2026-06-16 14:30:11 -04:00
2026-06-30 03:07:40 -07:00
2026-06-30 03:16:22 -07:00
2026-07-02 02:53:39 -07:00
2026-05-28 22:26:25 -07:00
2026-06-29 11:01:08 +10:00
2026-06-24 15:23:23 +10:00
2026-06-29 11:01:08 +10:00
2026-05-29 11:49:54 +10:00
2026-06-26 19:15:18 -07:00
2026-06-18 09:09:21 +10:00
2026-06-10 19:23:06 +10:00
2026-07-01 14:37:22 +05:30
2026-05-28 22:26:09 -07:00
2026-06-04 19:40:30 -07:00
2026-05-30 07:01:22 -07:00
2026-06-17 13:45:25 -07:00
2026-05-28 22:26:25 -07:00
2026-07-01 02:44:53 -07:00
2026-05-28 22:26:25 -07:00
2026-07-01 01:00:31 -07:00
2026-06-15 14:00:42 +05:30
2026-06-27 19:29:06 -07:00
2026-05-28 22:26:25 -07:00
2026-06-23 03:17:47 +05:30
2026-06-30 02:50:24 -07:00
2026-06-27 04:01:12 +05:30
2026-06-26 20:45:32 +05:30
2026-07-01 17:48:32 +05:30
2026-06-01 16:55:04 -07:00
2026-06-30 17:32:28 -07:00
2026-07-01 03:03:05 -07:00
2026-05-28 22:26:25 -07:00
2026-07-01 14:37:22 +05:30
2026-05-28 22:26:25 -07:00
2026-06-18 22:13:07 -07:00
2026-06-19 16:59:54 -07:00
2026-06-25 12:38:33 -07:00
2026-05-30 07:28:11 -07:00
2026-06-21 12:02:30 -07:00
2026-06-30 14:29:42 -07:00
2026-06-25 09:20:13 +10:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-25 13:52:06 -07:00
2026-05-28 22:26:25 -07:00
2026-07-02 02:13:30 -07:00
2026-07-01 15:42:19 +05:30
2026-07-01 05:35:34 -07:00
2026-06-30 04:23:27 -05:00
2026-06-11 19:50:08 -05:00
2026-06-07 03:57:21 -07:00
2026-05-29 22:26:24 +05:30
2026-05-28 22:26:25 -07:00
2026-05-30 07:58:08 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 16:02:56 +05:30
2026-06-27 04:39:54 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 11:46:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-11 04:37:01 -07:00
2026-06-15 04:22:07 -07:00
2026-06-30 16:56:15 -07:00
2026-06-27 04:59:23 +05:30
2026-06-28 04:47:39 -07:00
2026-06-14 02:09:45 -07:00
2026-06-24 00:52:18 +05:30
2026-06-25 23:30:41 +05:30
2026-05-28 22:26:25 -07:00
2026-07-01 04:54:46 -07:00
2026-05-28 22:26:25 -07:00
2026-06-18 10:19:33 -07:00
2026-06-30 20:01:16 +05:30
2026-05-28 22:26:25 -07:00
2026-06-29 11:35:41 +10:00
2026-06-21 11:11:23 -07:00
2026-06-06 18:30:39 -07:00
2026-05-25 15:18:45 -07:00
2026-05-25 06:13:36 -07:00
2026-06-30 04:23:27 -05:00
2026-06-13 14:42:51 -07:00
2026-06-17 13:45:25 -07:00
2026-06-19 11:57:43 -07:00
2026-07-01 15:37:58 +05:30
2026-05-28 22:26:25 -07:00
2026-06-12 00:30:51 -05:00
2026-06-13 14:35:21 -07:00
2026-06-20 23:23:47 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 10:26:45 -07:00
2026-06-12 01:07:38 -07:00
2026-06-15 05:51:47 -07:00
2026-07-01 00:12:11 -07:00
2026-06-27 04:41:22 -07:00
2026-06-07 23:04:54 -07:00
2026-07-01 01:39:10 -07:00
2026-06-20 10:26:45 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-30 15:49:36 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-25 22:03:02 -07:00
2026-06-06 18:29:52 -07:00
2026-05-28 22:26:25 -07:00
2026-06-01 01:58:48 -07:00
2026-06-11 18:03:11 -04:00
2026-07-01 00:40:56 -07:00
2026-06-18 12:26:20 +05:30
2026-06-27 21:07:53 -07:00
2026-06-16 13:08:34 -07:00
2026-06-21 16:39:48 -07:00
2026-06-20 23:23:47 -07:00
2026-06-04 18:06:21 -07:00
2026-06-26 12:09:52 +10:00
2026-06-26 12:09:52 +10:00
2026-06-08 22:46:57 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-22 15:41:23 +10:00
2026-05-28 22:26:25 -07:00
2026-06-28 01:15:39 -07:00
2026-05-28 22:26:25 -07:00
2026-06-29 11:35:41 +10:00
2026-06-27 19:29:00 -07:00
2026-06-25 23:08:48 +05:30
2026-07-01 01:05:28 -07:00
2026-06-26 15:26:08 +05:30
2026-06-25 23:42:42 +05:30
2026-06-07 18:06:27 -07:00
2026-05-29 13:35:39 +10:00
2026-05-31 00:50:19 -07:00
2026-06-30 16:39:41 -07:00
2026-06-03 06:36:46 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 17:46:56 -05:00
2026-05-25 01:41:19 -07:00
2026-05-31 17:46:56 -05:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-10 02:57:39 -07:00
2026-06-10 02:57:39 -07:00
2026-05-29 13:24:12 -07:00
2026-05-25 05:15:55 -07:00
2026-06-19 07:04:58 -07:00
2026-05-24 18:04:54 -07:00
2026-06-19 07:26:56 -07:00
2026-07-01 01:18:53 -07:00
2026-05-28 22:26:25 -07:00
2026-06-29 21:11:58 -07:00
2026-06-29 21:11:58 -07:00
2026-06-29 21:11:58 -07:00
2026-05-31 00:12:09 -07:00
2026-06-29 01:27:10 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 00:11:52 -07:00
2026-05-28 22:26:25 -07:00
2026-06-30 00:19:49 -07:00
2026-06-04 18:04:47 -07:00
2026-06-25 01:45:06 +05:30
2026-06-14 16:47:57 -07:00
2026-05-28 04:52:42 -07:00
2026-06-29 10:00:49 -07:00
2026-06-29 10:00:49 -07:00
2026-06-29 10:00:49 -07:00
2026-06-29 10:00:49 -07:00
2026-07-01 00:49:38 -07:00
2026-06-27 04:40:05 -07:00
2026-06-27 03:08:41 +05:30
2026-06-27 15:59:00 -07:00
2026-06-23 03:10:53 +05:30
2026-06-14 02:07:32 -07:00
2026-06-29 21:11:58 -07:00
2026-05-25 03:35:33 -07:00
2026-06-21 11:35:09 -07:00