teknium1
4ce832eeb9
fix(cron): bot-chat delivery cap bounds the bot's turn, not its exit linger
...
A cron job delivering to Bot Chat booked "timed out after 600s" for turns
that finished in seconds: cron/scheduler_delivery.py::_deliver_to_bot_chat
waited for the `hermes chat -Q` child to EXIT, but when the bot's turn had
messaged a teammate (message_agent -> notify_on_complete runner) the child
then runs the one-shot exit linger, bounded by
terminal.oneshot_completion_wait_seconds (default 600) — the same default as
cron.bot_chat_delivery_timeout_seconds. The cap counts from the claim, the
linger only starts when the turn ends, so the cap expired first on every
such delivery, booked a completed turn as a timeout, held the job's fire
fence for the full cap, and killed the child mid-linger — tearing down the
reply the linger exists to protect (#90879 ).
Ordering the two bounds cannot fix it (the turn has no duration bound; the
linger has its own contract), so the cap stops competing with the linger:
- hermes_cli/quiet_single_query.py: the -Q child accepts a per-process
report path (HERMES_QUIET_TURN_REPORT_FILE), popped before the turn like
HERMES_TURN_AUTHOR so nothing the turn spawns inherits it; cli.py writes
{pid, exit_code, error} there the moment the turn ends, BEFORE the linger.
- cron: _run_bot_chat_turn polls the child and that report under the cap.
Report present -> the delivery is booked from it (real exit code and
stream tails when the child exits within a short grace) and the still-
lingering child is left running, drained and reaped by a daemon thread.
No report by the cap -> the turn never ended: killed and booked as a
timeout, exactly as before. The linger itself is untouched.
Live repro (real _deliver_to_bot_chat, real `hermes chat -Q` against a
loopback provider whose turn spawns `sleep 90` with notify_on_complete,
cap 45s): base books the timeout at 45.7s for a turn that ended at +5s and
kills the child; fixed head books success at 11.2s, the child lingers, the
teammate follow-up turn runs at +97s and the child exits on its own.
Supersedes #113649 's cap = delivery + linger (the thread shows a headroom
only moves the race and lengthens the fence hold); analysis credit to the
reporter and the thread's independent verification.
Fixes #113608
Co-authored-by: KoNit-K <konit.block@protonmail.com >
2026-09-18 10:29:13 -07:00
..
2026-09-13 09:40:44 -07:00
2026-09-18 09:19:04 -07:00
2026-09-15 21:46:37 -07:00
2026-09-17 11:21:42 -07:00
2026-09-18 10:18:40 -07:00
2026-09-14 09:02:28 -07:00
2026-09-15 04:11:11 -07:00
2026-09-18 09:50:52 -07:00
2026-09-18 09:49:46 -07:00
2026-09-15 04:11:11 -07:00
2026-09-16 16:48:42 -07:00
2026-09-15 03:58:44 -07:00
2026-09-15 03:58:44 -07:00
2026-09-17 00:02:09 -07:00
2026-09-17 12:28:25 +05:30
2026-09-11 03:45:33 +05:30
2026-09-15 20:44:42 +05:30
2026-09-15 04:57:29 -07:00
2026-09-18 10:00:29 -07:00
2026-09-16 14:34:59 -07:00
2026-09-15 20:44:42 +05:30
2026-09-15 04:12:13 -07:00
2026-09-15 04:12:13 -07:00
2026-09-18 10:17:59 -07:00
2026-09-16 14:34:59 -07:00
2026-09-12 22:07:41 -07:00
2026-09-15 03:38:29 -07:00
2026-09-12 22:07:41 -07:00
2026-09-16 14:34:59 -07:00
2026-09-18 10:17:59 -07:00
2026-09-17 00:34:50 -05:00
2026-09-15 18:26:38 -07:00
2026-09-15 19:06:54 -07:00
2026-09-16 16:53:40 -07:00
2026-09-08 03:06:30 -07:00
2026-09-15 18:24:22 -07:00
2026-09-12 08:25:54 -07:00
2026-09-18 10:24:15 -07:00
2026-09-12 08:25:54 -07:00
2026-09-15 04:12:13 -07:00
2026-09-18 01:43:35 +05:30
2026-09-16 17:49:48 -07:00
2026-09-15 06:29:50 -07:00
2026-09-15 04:12:13 -07:00
2026-09-15 14:52:26 +05:30
2026-09-17 14:24:53 -04:00
2026-09-15 18:25:46 -07:00
2026-09-18 01:43:35 +05:30
2026-09-17 09:06:59 -07:00
2026-09-12 22:00:02 -07:00
2026-09-18 01:43:35 +05:30
2026-09-08 13:39:17 -07:00
2026-09-15 04:08:53 -07:00
2026-09-18 09:55:21 -07:00
2026-09-15 04:12:13 -07:00
2026-09-17 18:36:22 +05:30
2026-09-13 20:50:10 -07:00
2026-09-15 19:05:29 -07:00
2026-09-15 19:05:29 -07:00
2026-09-15 06:29:50 -07:00
2026-09-12 08:25:36 -07:00
2026-09-13 20:41:41 -07:00
2026-09-12 16:17:04 -07:00
2026-09-18 10:16:14 -07:00
2026-09-15 06:29:50 -07:00
2026-09-15 21:47:48 -07:00
2026-09-15 05:25:39 -07:00
2026-09-15 00:41:13 +05:30
2026-09-18 09:41:02 -07:00
2026-09-18 10:15:43 -07:00
2026-09-17 09:06:59 -07:00
2026-09-16 08:57:18 -07:00
2026-09-13 05:07:11 -07:00
2026-09-13 05:09:06 -07:00
2026-09-18 17:10:12 +02:00
2026-09-15 05:38:31 -07:00
2026-09-18 09:38:01 -07:00
2026-09-13 05:07:11 -07:00
2026-09-13 09:18:02 -07:00
2026-09-16 23:13:20 -04:00
2026-09-10 01:25:45 -07:00
2026-09-15 04:12:13 -07:00
2026-09-18 09:56:28 -07:00
2026-09-13 05:09:06 -07:00
2026-09-16 17:02:34 -07:00
2026-09-16 23:19:45 +05:30
2026-09-18 21:47:13 +05:30
2026-09-15 12:06:08 -07:00
2026-09-17 19:00:40 -04:00
2026-09-13 20:51:06 -07:00
2026-09-12 21:39:10 -07:00
2026-09-14 08:10:36 -07:00
2026-09-18 15:40:37 +05:30
2026-09-15 04:12:13 -07:00
2026-09-16 08:57:18 -07:00
2026-09-16 00:33:03 -07:00
2026-09-16 08:57:18 -07:00
2026-09-16 08:57:18 -07:00
2026-09-15 03:44:36 -07:00
2026-09-15 04:07:13 -07:00
2026-09-18 09:57:38 -07:00
2026-09-18 10:24:59 -07:00
2026-09-18 10:01:01 -07:00
2026-09-16 16:43:08 -07:00
2026-09-18 10:00:29 -07:00
2026-09-17 20:56:27 +05:30
2026-09-16 00:32:15 -07:00
2026-09-18 15:40:37 +05:30
2026-09-16 16:58:43 -07:00
2026-09-18 10:21:42 -07:00
2026-09-07 14:16:57 -07:00
2026-09-14 16:14:33 -07:00
2026-09-16 16:51:45 -07:00
2026-09-18 09:29:44 -07:00
2026-09-18 09:48:41 -07:00
2026-09-18 09:29:44 -07:00
2026-09-15 18:35:32 -07:00
2026-09-15 18:34:40 -07:00
2026-09-15 18:33:43 -07:00
2026-09-09 12:18:58 -07:00
2026-09-18 09:50:19 -07:00
2026-09-16 16:56:22 -07:00
2026-09-17 20:56:27 +05:30
2026-09-15 04:12:13 -07:00
2026-09-18 10:10:05 -07:00
2026-09-15 04:12:13 -07:00
2026-09-17 09:19:19 -07:00
2026-09-15 18:35:59 -07:00
2026-09-12 08:25:54 -07:00
2026-09-18 15:40:37 +05:30
2026-09-15 04:12:13 -07:00
2026-09-16 16:18:17 -05:00
2026-09-18 10:11:46 -07:00
2026-09-18 09:38:34 -07:00
2026-09-17 08:44:33 -07:00
2026-09-16 15:16:09 -05:00
2026-09-18 10:01:01 -07:00
2026-09-18 10:11:46 -07:00
2026-09-15 19:06:54 -07:00
2026-09-18 09:23:13 -07:00
2026-09-15 03:38:29 -07:00
2026-09-17 09:03:29 -07:00
2026-09-16 17:11:01 -07:00
2026-09-15 05:34:29 -07:00
2026-09-13 05:07:11 -07:00
2026-09-10 04:22:38 -07:00
2026-09-13 20:54:50 -07:00
2026-09-15 04:12:13 -07:00
2026-09-15 03:39:45 -07:00
2026-09-18 15:40:37 +05:30
2026-09-18 15:40:37 +05:30
2026-09-18 10:20:32 -07:00
2026-09-18 15:40:37 +05:30
2026-09-10 09:11:00 -07:00
2026-09-07 08:08:04 -07:00
2026-09-12 01:35:05 -07:00
2026-09-12 01:35:05 -07:00
2026-09-15 18:58:02 -07:00
2026-09-18 15:40:37 +05:30
2026-09-14 22:01:32 +00:00
2026-09-11 03:45:31 +05:30
2026-09-10 18:11:25 -07:00
2026-09-16 18:12:34 -07:00
2026-09-16 00:32:15 -07:00
2026-09-18 09:43:19 -07:00
2026-09-16 17:15:38 -07:00
2026-09-17 00:11:27 -07:00
2026-09-17 00:11:27 -07:00
2026-09-17 00:11:27 -07:00
2026-09-18 09:43:19 -07:00
2026-09-18 10:01:01 -07:00
2026-09-15 18:48:59 -07:00
2026-09-17 09:03:29 -07:00
2026-09-16 17:08:25 -07:00
2026-09-17 00:11:27 -07:00
2026-09-17 00:11:27 -07:00
2026-09-17 18:36:20 -07:00
2026-09-11 03:45:31 +05:30
2026-09-16 00:32:15 -07:00
2026-09-13 14:33:11 -07:00
2026-09-16 14:21:14 -07:00
2026-09-16 14:34:59 -07:00
2026-09-18 10:01:01 -07:00
2026-09-16 14:34:22 -07:00
2026-09-18 10:18:40 -07:00
2026-09-13 05:08:29 -07:00
2026-09-18 15:40:37 +05:30
2026-09-18 15:40:37 +05:30
2026-09-13 05:07:50 -07:00
2026-09-13 05:07:11 -07:00
2026-09-18 09:52:03 -07:00
2026-09-15 06:36:19 -07:00
2026-09-18 10:29:13 -07:00
2026-09-14 19:49:12 +05:30
2026-09-15 03:44:36 -07:00
2026-09-13 05:07:50 -07:00
2026-09-13 05:07:50 -07:00
2026-09-18 10:24:15 -07:00
2026-09-15 04:12:13 -07:00
2026-09-18 10:11:14 -07:00
2026-09-15 18:30:05 -07:00
2026-09-11 06:24:54 -07:00
2026-09-11 06:24:54 -07:00
2026-09-11 06:24:54 -07:00
2026-09-17 21:17:15 +05:30
2026-09-16 17:02:13 -07:00
2026-09-11 06:37:27 -07:00
2026-09-09 13:30:28 -07:00
2026-09-11 06:24:54 -07:00
2026-09-15 18:25:46 -07:00
2026-09-13 05:32:38 -07:00
2026-09-15 04:12:13 -07:00
2026-09-18 21:47:13 +05:30
2026-09-18 09:47:06 -07:00
2026-09-12 08:25:54 -07:00
2026-09-15 04:12:13 -07:00
2026-09-07 22:25:12 -07:00
2026-09-15 04:12:13 -07:00
2026-09-12 08:25:54 -07:00
2026-09-13 05:08:29 -07:00
2026-09-18 09:38:34 -07:00
2026-09-11 03:45:31 +05:30
2026-09-12 21:47:53 -07:00
2026-09-13 05:21:02 -07:00
2026-09-14 08:10:36 -07:00
2026-09-16 17:58:25 +00:00
2026-09-15 03:53:13 -07:00
2026-09-15 18:55:47 -07:00
2026-09-16 00:32:15 -07:00
2026-09-15 14:52:26 +05:30
2026-09-11 06:24:54 -07:00
2026-09-08 19:52:26 +05:30
2026-09-15 04:12:13 -07:00
2026-09-12 08:34:43 -07:00
2026-09-16 16:42:47 -07:00
2026-09-16 16:42:47 -07:00
2026-09-12 08:25:54 -07:00
2026-09-18 17:09:28 +02:00
2026-09-17 00:02:09 -07:00
2026-09-17 20:35:22 -07:00
2026-09-13 05:08:20 -07:00
2026-09-18 17:09:28 +02:00
2026-09-16 17:44:36 -07:00
2026-09-18 10:15:11 -07:00
2026-09-16 17:13:56 -07:00
2026-09-17 00:11:27 -07:00
2026-09-18 10:15:11 -07:00
2026-09-17 00:02:09 -07:00
2026-09-18 17:09:28 +02:00
2026-09-15 04:12:13 -07:00
2026-09-18 17:09:28 +02:00
2026-09-18 17:09:28 +02:00
2026-09-10 11:48:01 -07:00
2026-09-13 19:19:32 -07:00
2026-09-09 21:16:40 +05:30
2026-09-15 03:40:26 -07:00
2026-09-16 08:57:18 -07:00
2026-09-18 09:43:19 -07:00
2026-09-07 07:11:36 -07:00
2026-09-15 04:37:41 -07:00
2026-09-17 00:34:50 -05:00
2026-09-17 00:34:50 -05:00
2026-09-14 08:10:36 -07:00
2026-09-18 09:20:07 -07:00
2026-09-12 18:35:21 -07:00
2026-09-15 20:44:42 +05:30
2026-09-18 10:18:40 -07:00
2026-09-11 06:37:27 -07:00
2026-09-16 17:11:08 -07:00
2026-09-13 21:30:02 -07:00
2026-09-13 20:55:29 -07:00
2026-09-15 18:27:06 -07:00
2026-09-16 16:43:08 -07:00
2026-09-09 02:36:00 -07:00