hermes-bsd/tools
Teknium ea8a8b4af8
feat(delegation): background fan-out — parallel subagents, one consolidated return (#49734)
* feat(delegation): single-task delegate_task always runs in the background

The model no longer decides whether a subagent runs in the background — a
single-task delegate_task from the top-level agent is now always dispatched
async, so the parent turn returns immediately and the subagent's result
re-enters the conversation when it finishes.

- run_agent._dispatch_delegate_task (the live model path) forces
  background=True for top-level single-task calls; the schema-level
  `background` param is ignored.
- A batch (tasks with >1 item) stays synchronous (fan-out can't go async).
- A delegation from an orchestrator subagent (depth > 0) stays synchronous —
  it needs its workers' results within its own turn.
- The function-level default is unchanged, so direct Python callers/tests keep
  the historical synchronous behavior.
- On async-pool capacity rejection, single-task now falls through to a
  synchronous run instead of erroring (the child stays attached for interrupt
  propagation; detach happens only on a successful dispatch).
- Schema `background` param marked deprecated/ignored; tool description
  updated to state the always-background single-task rule.

* feat(delegation): all delegate_task fan-out runs in the background

Extend the always-background behavior to the full fan-out. A batch is now
dispatched as N independent async subagents (one handle each), instead of
running synchronously. Single task and batch both return immediately; each
subagent's result re-enters the conversation as its own message when it
finishes.

- delegate_task: when background is set, loop over ALL built children and
  dispatch each via dispatch_async_delegation; return a combined handle block
  (count + per-task delegation_ids). Children the async pool rejects (at
  capacity) run synchronously inline and are reported alongside the dispatched
  handles, so nothing is silently dropped.
- run_agent._dispatch_delegate_task + registry handler: force background for
  any top-level model delegation (single OR batch); orchestrator subagents
  (depth > 0) still run synchronously since they need workers' results within
  their own turn.
- Removed the v1 'batch async not supported' rejection.
- Tool description updated: BOTH MODES RUN IN THE BACKGROUND.
- Tests updated to assert batch fan-out dispatches each task async (verified
  E2E: 3-task batch -> 3 independent completion-queue events).

* fix(delegation): background fan-out joins and returns one consolidated block

Correct the fan-out semantics: a backgrounded batch is dispatched as ONE
async unit (one handle, one async-pool slot), not N independent dispatches.
The unit runs all children in parallel, waits on every one, and emits a
SINGLE completion event carrying the consolidated per-task results. The chat
is never blocked; when all subagents finish, their full summaries re-enter
the conversation together as one message.

- async_delegation.dispatch_async_delegation_batch + _finalize_batch: a batch
  occupies one slot; its runner returns the combined {results:[...]} dict and
  one event with the full results list is pushed to the completion queue.
- delegate_tool: extract the sync execution+aggregation into
  _execute_and_aggregate(); background dispatches it via the batch unit and
  returns one handle; on pool-capacity rejection it runs the batch inline.
- process_registry._format_async_delegation: render a consolidated multi-task
  block (TASK i/N + per-task summary) when the event carries is_batch/results.
- Tests updated; E2E verified: 3-task batch -> immediate return -> one combined
  completion block with all three summaries.
2026-06-20 11:27:12 -07:00
..
computer_use fix(#37878): scrub operator environment before launching cua-driver MCP 2026-06-18 08:53:31 -07:00
environments fix: make profile subprocess HOME policy explicit 2026-06-14 03:20:21 -07:00
neutts_samples
__init__.py
ansi_strip.py
approval.py feat(tools): MCP elicitation handler with gateway-aware approval routing 2026-06-19 11:46:25 -07:00
async_delegation.py feat(delegation): background fan-out — parallel subagents, one consolidated return (#49734) 2026-06-20 11:27:12 -07:00
binary_extensions.py
blueprints.py refactor(cron): rebrand Cron Recipes -> Automation Blueprints 2026-06-11 10:49:47 -07:00
browser_camofox.py
browser_camofox_state.py
browser_cdp_tool.py fix(deps): declare websockets as core dep + relax dev setuptools pin (salvage #45486, #44693) (#46744) 2026-06-15 12:44:44 -04:00
browser_dialog_tool.py
browser_supervisor.py
browser_tool.py fix: harden salvaged session and browser improvements 2026-06-15 07:46:34 -07:00
budget_config.py
checkpoint_manager.py fix(cron): compact cron failure messages + repair bare repo dirs after git gc 2026-06-19 07:35:29 -07:00
clarify_gateway.py
clarify_tool.py fix(clarify): docstring — put options in choices[] only, never enumerate in question text 2026-06-19 07:34:02 -07:00
code_execution_tool.py fix: make profile subprocess HOME policy explicit 2026-06-14 03:20:21 -07:00
computer_use_tool.py
credential_files.py fix(slack): make video attachments available to agents (#45512) 2026-06-13 03:33:27 -07:00
cronjob_tools.py feat(cron): wire on_jobs_changed, cron.chronos config, docs + agent↔NAS contract 2026-06-18 15:11:32 +10:00
debug_helpers.py
delegate_tool.py feat(delegation): background fan-out — parallel subagents, one consolidated return (#49734) 2026-06-20 11:27:12 -07:00
discord_tool.py
env_passthrough.py
env_probe.py fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
fal_common.py
feishu_doc_tool.py
feishu_drive_tool.py
file_operations.py feat(search_files): headroom compression evaluation report + lossless densification (#47866) 2026-06-17 13:45:25 -07:00
file_state.py
file_tools.py feat(search_files): headroom compression evaluation report + lossless densification (#47866) 2026-06-17 13:45:25 -07:00
fuzzy_match.py docs: clean up three stale comments from the #32848 audit (#45638) 2026-06-19 16:09:30 -07:00
homeassistant_tool.py
image_generation_tool.py fix(tools): never let a model whitelist strip the prompt / source images 2026-06-19 16:59:54 -07:00
interrupt.py
kanban_tools.py feat(kanban): auto-subscribe calling session on kanban_create 2026-06-18 14:10:51 -07:00
lazy_deps.py fix(dashboard): clean up upload temp file on client disconnect + pin python-multipart (NS-501) 2026-06-18 11:32:18 +05:30
managed_tool_gateway.py
mcp_oauth.py fix(mcp): fail fast for noninteractive oauth without tokens 2026-06-15 04:22:07 -07:00
mcp_oauth_manager.py fix(mcp): fail fast for noninteractive oauth without tokens 2026-06-15 04:22:07 -07:00
mcp_tool.py fix(mcp): keep short-TTL HTTP sessions alive with configurable ping keepalive 2026-06-19 12:16:33 -07:00
memory_tool.py docs: clean up three stale comments from the #32848 audit (#45638) 2026-06-19 16:09:30 -07:00
microsoft_graph_auth.py
microsoft_graph_client.py
mixture_of_agents_tool.py
neutts_synth.py
openrouter_client.py
osv_check.py fix(osv_check): honor npx --package/-p install target when parsing package arg (#40567) 2026-06-06 18:30:39 -07:00
patch_parser.py
path_security.py
process_registry.py feat(delegation): background fan-out — parallel subagents, one consolidated return (#49734) 2026-06-20 11:27:12 -07:00
read_extract.py feat(read): extract notebook and office documents (#37082) 2026-06-13 14:42:51 -07:00
read_terminal_tool.py feat(desktop): resizable VS Code-themed terminal pane + palette polish (#42521) 2026-06-09 23:15:20 -05:00
registry.py
schema_sanitizer.py fix(tools): strip default from $ref nodes in tool schemas 2026-06-12 00:30:51 -05:00
send_message_tool.py refactor(gateway): migrate slack/dingtalk/whatsapp/matrix/feishu/telegram/wecom/email/sms adapters to bundled plugins 2026-06-20 10:26:45 -07:00
session_search_tool.py feat(desktop): composer status stack, live subagent windows, editable prompts (#44630) 2026-06-12 08:30:06 -05:00
skill_manager_tool.py feat(display): verbose skill change notifications with content previews 2026-06-16 05:45:40 -07:00
skill_provenance.py
skill_usage.py fix(curator): stop restore from matching unrelated skills by name prefix 2026-06-17 06:04:03 -07:00
skills_ast_audit.py
skills_guard.py
skills_hub.py fix(skills): let ClawHub index build walk past the 12s browse budget (#44500) 2026-06-11 18:03:11 -04:00
skills_sync.py fix(skills): refuse SKILLS_DIR root in rmtree guard, not just outside-tree 2026-06-18 08:53:35 -07:00
skills_tool.py fix(skills): ignore support docs in skill discovery 2026-06-16 13:08:34 -07:00
slash_confirm.py
terminal_tool.py fix(terminal): block gateway lifecycle commands from inside the gateway process 2026-06-19 11:53:44 +05:30
thread_context.py
threat_patterns.py
tirith_security.py fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
todo_tool.py hardening(todo): bound TodoStore item content length and count 2026-06-07 18:06:27 -07:00
tool_backend_helpers.py
tool_output_limits.py
tool_result_storage.py
tool_search.py
transcription_tools.py fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
tts_tool.py feat(tts): add xAI TTS speed and optimize_streaming_latency config knobs 2026-06-19 07:26:56 -07:00
url_safety.py fix(tools): percent-encode non-ascii URL components 2026-06-07 11:42:26 -06:00
video_generation_tool.py fix(xai): route video models by modality 2026-06-01 19:00:30 -07:00
vision_tools.py fix(deps): force prompt=False on the two mid-session lazy-install tool paths 2026-06-06 18:44:15 -07:00
voice_mode.py fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
web_tools.py revert(web): remove keyless Parallel search fallback (#46350) 2026-06-14 16:47:57 -07:00
website_policy.py
write_approval.py fix(memory,skills): repair write-approval inline prompt, gateway staging, and gateway /skills review (#43452) 2026-06-10 02:57:15 -07:00
x_search_tool.py
xai_http.py
yuanbao_tools.py