Clifford Garwood
3d9be27895
fix(delegate): declare stateless channel in one-shot and cron so delegate_task returns results
...
run_agent._dispatch_delegate_task forces background=True for every top-level
delegation, and async_delivery_supported() returns True for any session that
never binds the capability. On runners that cannot receive a completion after
their turn ends, that combination silently discards every subagent result: the
model gets a dispatch handle, ends its turn, and reports 'waiting for results'.
Two such runners never bind the capability:
* hermes -z (one-shot) prints one final response and exits. It bypasses cli.py,
so nothing drains process_registry.completion_queue (only the interactive
process_loop and the gateway watchers do).
* cron run_job clears the HERMES_SESSION_* routing keys, so a completion event
carries session_key="" — _enrich_async_delegation_routing cannot resolve it
and _inject_watch_notification drops it ("no routing metadata"). By then
run_job has already shipped the job's final response via _deliver_result;
there is no turn left to re-enter. Worse, get_current_session_key() can fall
back to the ambient os.environ HERMES_SESSION_KEY, so a cron subagent's output
can be routed into an unrelated user chat rather than merely dropped.
Add declare_stateless_channel() and bind it in both runners, routing
delegate_task to its existing inline/synchronous path — the same fallback the
stateless HTTP adapter already relies on, and the fix suggested in #63142 . The
helper binds only the capability: set_session_vars() would also latch
_session_context_engaged, which a pure single-process one-shot must not trigger.
Also correct two agent-facing strings that hardcoded 'stateless HTTP API' as the
only channel without async delivery (delegate_tool, terminal_tool); they now name
the actual condition.
Repro (before): hermes -z 'Use delegate_task to spawn a subagent that replies
BANANA. Report its reply.' -> "Waiting for the subagent's response...", exit 0,
no BANANA. After: BANANA is returned in-turn.
Fixes #53027
Fixes #63142
2026-07-18 00:05:25 -07:00
..
2026-05-20 13:00:57 -07:00
2026-07-16 07:21:23 -07:00
2026-07-10 19:28:03 +05:30
2026-06-20 10:26:45 -07:00
2026-07-13 23:26:10 +05:30
2026-05-28 22:26:25 -07:00
2026-07-05 13:58:03 -07:00
2026-06-28 02:41:36 -07:00
2026-07-17 15:47:08 -07:00
2026-07-16 04:43:45 -07:00
2026-06-25 00:27:22 +05:30
2026-06-26 00:11:17 +05:30
2026-06-24 19:12:44 +05:30
2026-06-28 02:41:36 -07:00
2026-07-16 04:26:06 -07:00
2026-06-25 21:29:57 -07:00
2026-07-09 19:09:38 -07:00
2026-07-07 02:39:54 -07:00
2026-07-05 14:48:28 -07:00
2026-06-20 10:26:45 -07:00
2026-05-17 02:29:41 -07:00
2026-07-13 23:26:10 +05:30
2026-07-16 06:29:09 -07:00
2026-07-13 23:26:10 +05:30
2026-07-03 03:27:47 -07:00
2026-07-16 07:17:55 -07:00
2026-06-14 03:25:49 -07:00
2026-07-13 04:31:55 -07:00
2026-07-02 13:25:25 +05:30
2026-07-16 07:31:05 -07:00
2026-07-13 04:31:55 -07:00
2026-07-14 16:58:47 +05:30
2026-07-08 08:10:28 -07:00
2026-07-18 00:05:25 -07:00
2026-06-29 15:51:57 -07:00
2026-07-10 12:38:48 +05:30
2026-05-28 22:26:25 -07:00
2026-07-11 05:41:58 -07:00
2026-06-07 18:05:58 -07:00
2026-06-02 16:55:25 -07:00
2026-05-28 22:26:25 -07:00
2026-07-14 13:58:36 -07:00
2026-07-01 00:42:56 -07:00
2026-06-27 19:05:04 -07:00
2026-05-18 21:38:05 -07:00
2026-07-05 06:29:26 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 06:31:13 -07:00
2026-06-25 21:29:57 -07:00
2026-06-28 02:05:50 -07:00
2026-07-07 17:04:32 -07:00
2026-07-09 06:27:04 -07:00
2026-07-02 03:08:11 -07:00
2026-07-16 10:38:31 -07:00
2026-07-14 21:31:32 -07:00
2026-07-17 04:51:39 -07:00
2026-06-25 21:29:57 -07:00
2026-07-13 07:28:21 -07:00
2026-07-09 18:04:00 -07:00
2026-06-26 00:50:40 +05:30
2026-06-26 00:50:40 +05:30
2026-07-02 05:10:31 -07:00
2026-06-25 12:56:05 -07:00
2026-07-02 12:49:42 +05:30
2026-07-14 16:56:34 +05:30
2026-07-14 16:56:34 +05:30
2026-06-07 22:39:51 -07:00
2026-07-04 13:28:47 -07:00
2026-07-01 03:56:28 -07:00
2026-06-30 15:03:25 -07:00
2026-07-15 09:50:05 -07:00
2026-07-11 23:46:13 +05:30
2026-07-07 22:15:04 -07:00
2026-07-13 23:26:10 +05:30
2026-07-06 01:37:10 +05:30
2026-07-04 13:28:47 -07:00
2026-07-01 15:11:38 +05:30
2026-06-26 00:11:17 +05:30
2026-05-29 19:06:05 -07:00
2026-06-22 05:41:22 -07:00
2026-05-09 11:04:46 -07:00
2026-06-20 10:26:45 -07:00
2026-05-22 14:21:41 -07:00
2026-07-07 13:46:51 -07:00
2026-05-22 14:21:41 -07:00
2026-06-28 00:57:03 -07:00
2026-07-01 15:38:34 -04:00
2026-07-01 00:12:17 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-07-07 02:40:12 -07:00
2026-07-05 06:42:42 -07:00
2026-06-30 15:03:25 -07:00
2026-06-21 22:43:45 -07:00
2026-07-01 00:12:17 -07:00
2026-07-05 13:58:11 -07:00
2026-07-07 06:25:23 -07:00
2026-07-07 17:01:08 -07:00
2026-06-27 03:57:24 +05:30
2026-07-01 16:25:16 +05:30
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-06-27 19:30:32 -07:00
2026-05-22 14:21:41 -07:00
2026-07-07 02:40:12 -07:00
2026-05-27 03:35:33 -07:00
2026-06-30 02:48:42 -07:00
2026-07-07 06:25:23 -07:00
2026-07-07 05:50:08 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-07-01 03:56:28 -07:00
2026-05-22 14:21:41 -07:00
2026-07-07 17:00:58 -07:00
2026-07-07 12:42:29 -07:00
2026-06-22 13:58:33 -07:00
2026-05-17 02:29:41 -07:00
2026-05-28 22:26:25 -07:00
2026-07-07 12:42:29 -07:00
2026-06-05 03:10:40 -07:00
2026-07-05 06:29:26 -07:00
2026-07-01 01:20:14 -07:00
2026-06-21 22:43:45 -07:00
2026-06-11 11:58:19 -07:00
2026-06-25 21:29:57 -07:00
2026-07-02 03:12:53 -07:00
2026-07-01 03:56:28 -07:00
2026-05-30 07:28:06 -07:00
2026-07-02 03:00:59 -07:00
2026-06-25 21:29:57 -07:00
2026-07-13 23:26:10 +05:30
2026-05-30 07:38:03 -07:00
2026-07-09 02:22:12 +05:30
2026-05-28 22:26:25 -07:00
2026-07-07 05:11:59 -07:00
2026-06-20 10:26:45 -07:00
2026-07-01 03:56:28 -07:00
2026-06-28 00:57:03 -07:00
2026-06-30 17:20:41 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-27 04:13:09 -07:00
2026-07-09 20:31:49 -07:00
2026-07-01 02:29:24 -07:00
2026-07-16 04:40:23 -07:00
2026-05-28 22:26:25 -07:00
2026-07-16 08:02:47 -07:00
2026-05-27 02:41:24 -07:00
2026-06-23 23:29:28 -07:00
2026-05-28 22:26:25 -07:00
2026-07-01 15:59:37 +05:30
2026-07-01 05:13:03 -07:00
2026-06-14 03:25:08 -07:00
2026-05-07 06:31:08 -07:00
2026-05-07 17:33:09 -07:00
2026-06-22 06:27:29 -07:00
2026-07-16 07:31:05 -07:00
2026-06-29 15:51:57 -07:00
2026-07-16 05:39:58 -07:00
2026-05-28 22:26:25 -07:00
2026-07-17 09:08:30 -07:00
2026-07-15 09:48:24 -07:00
2026-06-21 11:11:23 -07:00
2026-06-20 10:57:41 -07:00
2026-06-25 21:29:57 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 12:43:44 -07:00
2026-06-01 20:30:24 -07:00
2026-07-02 00:05:48 +05:30
2026-06-19 07:35:33 -07:00
2026-06-25 21:29:57 -07:00
2026-06-04 21:55:20 -07:00
2026-05-28 22:26:25 -07:00
2026-05-24 15:03:27 -07:00
2026-06-20 10:26:45 -07:00
2026-06-28 20:47:33 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-07-01 05:38:03 -07:00
2026-06-20 21:22:11 -07:00
2026-07-03 03:27:47 -07:00
2026-07-16 05:39:58 -07:00
2026-06-08 15:12:12 -07:00
2026-06-05 09:10:26 -07:00
2026-05-26 14:28:51 -07:00
2026-06-21 11:56:46 -07:00
2026-06-20 23:20:16 -07:00
2026-06-20 10:26:45 -07:00
2026-05-16 12:55:23 -07:00
2026-05-28 22:26:25 -07:00
2026-06-16 15:49:59 -07:00
2026-05-28 22:26:25 -07:00
2026-06-27 19:26:04 -07:00
2026-06-27 03:43:28 -07:00
2026-06-27 03:43:38 -07:00
2026-06-27 04:36:22 -07:00
2026-06-21 13:33:23 -07:00
2026-06-27 21:23:25 -07:00
2026-07-16 07:17:55 -07:00
2026-05-28 22:26:25 -07:00
2026-07-16 07:22:24 -07:00
2026-07-16 07:17:55 -07:00
2026-07-16 15:59:45 +05:30
2026-07-16 07:57:06 -07:00
2026-06-30 15:30:06 -07:00
2026-06-19 07:34:15 -07:00
2026-07-08 00:34:34 +00:00
2026-07-15 12:11:16 -07:00
2026-07-07 18:25:39 +10:00
2026-07-16 07:17:55 -07:00
2026-07-03 03:33:06 -07:00
2026-07-04 16:34:16 -07:00
2026-07-05 21:48:59 -07:00
2026-05-29 13:17:46 -07:00
2026-07-01 03:56:28 -07:00
2026-07-01 05:31:15 -07:00
2026-07-07 02:18:17 -07:00
2026-06-25 21:29:57 -07:00
2026-06-25 21:29:57 -07:00
2026-06-02 05:52:54 -07:00
2026-06-30 14:29:51 -07:00
2026-07-17 20:55:24 +00:00
2026-07-16 07:21:23 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-25 21:29:57 -07:00
2026-06-25 21:29:57 -07:00
2026-05-28 22:26:25 -07:00
2026-07-01 02:12:25 -07:00
2026-07-10 12:38:48 +05:30
2026-07-15 09:50:05 -07:00
2026-07-15 09:50:05 -07:00
2026-07-05 00:41:34 -07:00
2026-07-09 19:09:38 -07:00
2026-06-30 17:32:35 -07:00
2026-07-05 21:48:59 -07:00
2026-07-03 03:33:06 -07:00
2026-07-05 13:57:37 -07:00
2026-07-11 08:42:21 -07:00
2026-07-12 00:26:49 -07:00
2026-07-14 11:46:40 -07:00
2026-06-25 21:29:57 -07:00
2026-07-08 00:20:23 +00:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 15:16:53 +05:30
2026-07-05 02:12:26 -07:00
2026-07-05 13:42:46 -07:00
2026-06-08 01:25:35 -07:00
2026-07-01 00:11:23 -07:00
2026-07-17 04:51:39 -07:00
2026-07-16 05:08:56 -07:00
2026-07-05 13:58:03 -07:00
2026-05-20 13:00:57 -07:00
2026-07-01 02:12:25 -07:00
2026-07-01 17:08:50 +05:30
2026-06-29 20:31:17 -07:00
2026-05-30 07:38:03 -07:00
2026-07-01 02:03:58 -07:00
2026-06-25 21:29:57 -07:00
2026-06-03 23:51:44 -06:00
2026-06-19 06:31:13 -07:00
2026-05-08 18:50:25 -07:00
2026-06-26 14:01:48 +10:00
2026-06-24 18:47:18 -07:00
2026-06-21 12:34:22 -07:00
2026-06-20 10:26:45 -07:00
2026-06-25 21:29:57 -07:00
2026-06-25 21:29:57 -07:00
2026-05-18 22:25:15 -07:00
2026-06-16 15:49:59 -07:00
2026-07-05 13:58:03 -07:00
2026-07-01 05:38:03 -07:00
2026-07-01 15:42:19 +05:30
2026-05-28 22:26:25 -07:00
2026-06-27 04:13:09 -07:00
2026-07-09 18:04:00 -07:00
2026-07-01 02:29:24 -07:00
2026-07-07 18:25:45 +10:00
2026-06-25 01:26:13 +05:30
2026-07-04 16:34:16 -07:00
2026-07-02 05:51:12 -07:00
2026-05-23 02:25:53 -07:00
2026-06-07 22:10:32 -07:00
2026-06-29 15:51:57 -07:00
2026-07-17 04:51:39 -07:00
2026-06-25 21:29:57 -07:00
2026-06-04 07:50:45 -07:00
2026-07-17 04:51:39 -07:00
2026-07-17 20:55:24 +00:00
2026-07-14 17:13:20 +05:30
2026-07-17 04:51:39 -07:00
2026-07-17 04:51:39 -07:00
2026-07-17 18:58:29 +05:30
2026-06-20 10:26:45 -07:00
2026-07-13 23:26:10 +05:30
2026-05-10 09:01:51 -07:00
2026-06-20 13:47:14 +05:30
2026-05-28 22:26:25 -07:00
2026-07-16 05:39:58 -07:00
2026-06-12 01:07:50 -07:00
2026-07-14 13:58:36 -07:00
2026-07-14 13:58:36 -07:00
2026-07-03 02:55:22 +05:30
2026-07-01 16:32:32 +05:30
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-07-01 03:16:13 -07:00
2026-06-29 01:02:53 -07:00
2026-07-03 12:34:53 +05:30
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-29 20:57:43 -07:00
2026-07-16 05:39:58 -07:00
2026-06-28 02:43:23 -07:00
2026-05-28 22:26:25 -07:00
2026-07-05 17:38:36 -07:00
2026-06-27 03:52:44 -07:00
2026-06-07 02:15:23 -07:00
2026-05-28 22:26:25 -07:00
2026-07-05 13:57:11 -07:00
2026-07-07 14:40:32 +05:30
2026-06-28 04:35:37 -07:00
2026-07-16 00:11:22 +05:30
2026-06-21 16:41:17 -07:00
2026-06-30 03:22:18 -07:00
2026-07-16 07:17:55 -07:00
2026-07-05 06:29:26 -07:00
2026-07-09 01:19:07 +05:30
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-07-14 21:31:32 -07:00
2026-06-13 13:44:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-30 23:37:04 -07:00
2026-06-27 04:13:09 -07:00
2026-07-01 03:25:02 -07:00
2026-06-02 00:33:50 -07:00
2026-06-30 04:23:03 -07:00
2026-07-05 06:12:49 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 20:05:37 -07:00
2026-06-27 03:57:24 +05:30
2026-05-08 11:18:14 -07:00
2026-06-19 16:20:59 -07:00
2026-07-13 04:31:55 -07:00
2026-06-30 04:23:03 -07:00
2026-06-28 14:25:15 -07:00
2026-06-28 00:57:03 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-28 01:07:53 -07:00
2026-06-24 02:15:47 +05:30
2026-07-14 17:32:41 +05:30
2026-06-27 19:12:57 -07:00
2026-07-16 04:25:54 -07:00
2026-07-11 11:13:50 +05:30
2026-07-05 00:32:35 -07:00
2026-06-20 10:26:45 -07:00
2026-07-16 04:53:08 -07:00
2026-07-14 17:09:50 +05:30
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-07-04 13:48:33 +05:30
2026-07-14 17:32:41 +05:30
2026-07-17 20:55:24 +00:00
2026-07-06 03:53:52 -07:00
2026-06-20 10:26:45 -07:00
2026-06-30 15:36:58 -07:00
2026-05-28 22:26:25 -07:00
2026-07-14 17:32:41 +05:30
2026-05-28 22:26:25 -07:00
2026-06-22 12:29:05 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-07-14 06:48:53 -07:00
2026-06-21 08:26:28 -07:00
2026-06-20 10:26:45 -07:00
2026-07-14 17:32:41 +05:30
2026-06-20 10:26:45 -07:00
2026-07-07 15:50:41 +05:30
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-30 17:39:30 -07:00
2026-07-06 03:18:33 -07:00
2026-07-05 21:57:55 -07:00
2026-07-07 02:39:31 -07:00
2026-06-27 04:01:58 -07:00
2026-07-16 04:40:35 -07:00
2026-06-27 04:39:48 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-29 15:51:57 -07:00
2026-07-02 05:09:38 -07:00
2026-07-06 03:42:14 -07:00
2026-05-28 22:26:25 -07:00
2026-06-25 21:29:57 -07:00
2026-07-13 04:31:55 -07:00
2026-06-29 21:12:57 -07:00
2026-06-28 02:05:26 -07:00
2026-06-01 02:04:14 -07:00
2026-07-04 13:38:59 -07:00
2026-06-12 13:42:42 -04:00
2026-07-07 22:15:04 -07:00
2026-06-04 06:56:28 -07:00
2026-07-14 03:23:19 -07:00
2026-07-05 06:29:26 -07:00
2026-06-05 18:05:05 -07:00
2026-06-13 03:33:27 -07:00
2026-07-01 03:56:28 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 19:05:27 -07:00
2026-07-16 07:22:24 -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-07-02 17:39:09 -07:00
2026-06-28 22:35:43 -07:00
2026-07-01 03:56:28 -07:00
2026-06-07 21:50:57 -07:00
2026-06-07 22:10:17 -07:00
2026-07-01 03:56:28 -07:00
2026-06-20 17:05:27 -07:00
2026-06-21 17:23:33 -07:00
2026-07-05 00:41:34 -07:00
2026-07-16 07:22:24 -07:00
2026-06-21 17:23:33 -07:00
2026-07-05 06:27:20 -07:00
2026-07-01 03:56:28 -07:00
2026-07-01 03:56:28 -07:00
2026-06-28 02:05:26 -07:00
2026-06-30 15:30:06 -07:00
2026-07-05 06:27:20 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 13:32:22 -07:00
2026-06-20 10:26:45 -07:00
2026-06-28 15:29:59 -07:00