-
-
Notifications
You must be signed in to change notification settings - Fork 37
Foreground subagents #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ericdallo
wants to merge
34
commits into
master
Choose a base branch
from
subagents
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Foreground subagents #291
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds foreground subagents, a new
modeof typesubagentbesides the existingprimaryone..eca/agents/my-agent.mdsubagentFinishedhook, triggered only when a subagent finished, whilepostRequestis triggered only for primary ones.explorerandgeneral, 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_agentwhich 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"