Fix agent tool loop and parallel streaming logic#1
Conversation
- Implemented a complete tool execution loop in BaseAgent to handle multi-tool calls and feedback results to the LLM. - Updated OrchestratorAgent to use a stream merging utility for true parallel streaming of multiple agents. - Fixed ExplainerAgent and other agents to implement the required executeTool interface. - Corrected typos in agent system prompts. - Added comprehensive tests for multi-tool execution in agents. Co-authored-by: brayanj4y <157296274+brayanj4y@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Implemented a complete tool execution loop in BaseAgent to handle multi-tool calls and feedback results to the LLM. - Updated OrchestratorAgent to use a stream merging utility for true parallel streaming of multiple agents. - Fixed ExplainerAgent and other agents to implement the required executeTool interface. - Corrected typos in agent system prompts. - Added comprehensive tests for multi-tool execution in agents. Co-authored-by: brayanj4y <157296274+brayanj4y@users.noreply.github.com>
This PR addresses several core issues in the multi-agent terminal assistant:
Agent Tool Loop: Previously, agents would stream tool calls from the LLM but never execute them or return results. I've updated
BaseAgentwith a robustwhileloop that handles one or more tool calls per turn, executes them via the agent'sexecuteToolimplementation, and continues the conversation until the agent is done.Parallel Streaming: The
OrchestratorAgentwas usingPromise.all, which blocked all output until all agents finished. I've implemented amergeStreamsutility that allows the orchestrator to yield chunks from multiple agents as soon as they arrive, enabling "blazing-fast" responsive UI.Interface Consistency: Modified all agents to implement the now-abstract
executeToolmethod, ensuring type safety and functional tool execution.Bug Fixes: Fixed a typo in the
CodeReaderAgentsystem prompt and added a mock-based test suite intests/agents.test.tsto verify the new multi-tool execution logic.PR created automatically by Jules for task 3750210806925345028 started by @brayanj4y