Skip to content

Fix agent tool loop and parallel streaming logic#1

Open
brayanj4y wants to merge 2 commits intomainfrom
fix-agent-orchestrator-issues-3750210806925345028
Open

Fix agent tool loop and parallel streaming logic#1
brayanj4y wants to merge 2 commits intomainfrom
fix-agent-orchestrator-issues-3750210806925345028

Conversation

@brayanj4y
Copy link
Owner

This PR addresses several core issues in the multi-agent terminal assistant:

  1. Agent Tool Loop: Previously, agents would stream tool calls from the LLM but never execute them or return results. I've updated BaseAgent with a robust while loop that handles one or more tool calls per turn, executes them via the agent's executeTool implementation, and continues the conversation until the agent is done.

  2. Parallel Streaming: The OrchestratorAgent was using Promise.all, which blocked all output until all agents finished. I've implemented a mergeStreams utility that allows the orchestrator to yield chunks from multiple agents as soon as they arrive, enabling "blazing-fast" responsive UI.

  3. Interface Consistency: Modified all agents to implement the now-abstract executeTool method, ensuring type safety and functional tool execution.

  4. Bug Fixes: Fixed a typo in the CodeReaderAgent system prompt and added a mock-based test suite in tests/agents.test.ts to verify the new multi-tool execution logic.


PR created automatically by Jules for task 3750210806925345028 started by @brayanj4y

- 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>
@google-labs-jules
Copy link

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant