Skip to content

Conversation

@ericdallo
Copy link
Member

@ericdallo ericdallo commented Feb 6, 2026

This PR adds foreground subagents, a new mode of type subagent besides the existing primary one.

  • Add support for mardown agents definition via .eca/agents/my-agent.md
  • New subagentFinished hook, triggered only when a subagent finished, while postRequest is triggered only for primary ones.
  • Fix thread deadlocks that happens, critical for long steps subagents.
  • Add 2 built-in subagents explorer and general, they may need further systemPrompt in the future, from my tests explorer is used most and was too verbose, after prompt tunning it improved a loooot.

How it works

We provide a new tool spawn_agent which inside its description we mention the available agents we found in config + md.
When LLM calls that tool, under the hood we start a new chat-id prompt and each iteraction update we send normal ECA chat/contentReceived messages but with a parentChatId, this way clients can create nested tool calls: "agent -> spawn_agent -> tools from subagent"

image

ericdallo and others added 30 commits February 4, 2026 12:37
Switch all provider base-request functions from async HTTP (deref'd
CompletableFuture) to synchronous HTTP calls. The async path ran
thenApply callbacks on ForkJoinPool.commonPool workers, and the
recursive base-request pattern (stream → tool_use → on-tools-called →
base-request) would block one commonPool worker per tool-use turn.
After ~N turns (where N = availableProcessors - 1), all workers were
blocked and new CompletableFuture completions could never execute,
causing a complete deadlock visible as subagents stuck on "Sending
body..." and eventually all chats hanging on "Waiting Model...".

Since the code always immediately deref'd the async result, switching
to synchronous HTTP loses nothing and eliminates the ForkJoinPool
dependency entirely.

🤖 Generated with [eca](https://eca.dev)

Co-Authored-By: eca <noreply@eca.dev>
@ericdallo ericdallo changed the title Subagents Foreground subagents Feb 10, 2026
@ericdallo ericdallo marked this pull request as ready for review February 11, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant