Skip to content

feat(core): Enable generalist agent#19665

Merged
joshualitt merged 1 commit intomainfrom
jl/wire-up-generalist
Feb 26, 2026
Merged

feat(core): Enable generalist agent#19665
joshualitt merged 1 commit intomainfrom
jl/wire-up-generalist

Conversation

@joshualitt
Copy link
Contributor

Fixes #16858

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @joshualitt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new evaluation suite for the generalist agent, ensuring it correctly delegates complex tasks while handling simpler ones directly. It also significantly enhances the AppRig testing utility to provide more robust and deterministic testing capabilities for agent interactions. Furthermore, the descriptions and prompt guidelines for the generalist agent have been refined to better articulate its intended use cases, promoting efficient task delegation.

Highlights

  • Generalist Agent Evaluation: A new evaluation file was added to thoroughly test the generalist agent's delegation capabilities, including scenarios where it should and should not delegate tasks. This ensures the agent intelligently handles complex batch operations while allowing simpler tasks to be processed directly.
  • AppRig Testing Utility Enhancements: The AppRig testing utility received significant updates to improve the reliability and determinism of agent tests. This includes better state tracking, a new isBusy() method, and advanced asynchronous waiting functions like waitForNextEvent() and drainBreakpointsUntilIdle().
  • Generalist Agent Description and Prompt Refinement: The description for the generalist agent and the core prompt snippets were updated to provide clearer guidance on its strategic use. The new text emphasizes delegating turn-intensive or data-heavy tasks to the generalist agent to maintain an efficient main session history.
Changelog
  • evals/generalist_delegation.eval.ts
    • Added new evaluation tests for generalist agent delegation, covering both positive and negative delegation scenarios.
  • packages/cli/src/test-utils/AppRig.tsx
    • Enhanced the AppRig testing utility with improved state tracking, busy status detection, and new asynchronous waiting methods.
    • Introduced mocking for StreamingContext to observe React-based state changes.
    • Added isBusy() method to determine if the agent is actively responding or executing tools.
    • Implemented waitForNextEvent() and drainBreakpointsUntilIdle() for more controlled test flow.
    • Updated setBreakpoint and removeToolPolicy to support global tool policy management using '*'.
  • packages/core/src/agents/codebase-investigator.ts
    • Added temporary debugging console logs for model configuration.
  • packages/core/src/agents/generalist-agent.ts
    • Updated the description of the Generalist Agent to provide more detailed guidance on its purpose and optimal use cases, emphasizing strategic orchestration.
  • packages/core/src/core/geminiChat.ts
    • Added commented-out debugging console logs for chat request contents.
  • packages/core/src/prompts/snippets.ts
    • Expanded prompt guidelines with new sections on 'Strategic Orchestration & Delegation' and 'High-Impact Delegation Candidates' for sub-agents.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Feb 20, 2026

Size Change: +1.35 kB (+0.01%)

Total Size: 25.7 MB

Filename Size Change
./bundle/gemini.js 25.2 MB +1.35 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB

compressed-size-action

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request successfully enables the generalist agent and updates the system prompts to encourage strategic orchestration and delegation. It also introduces significant improvements to the AppRig test utility for better state tracking and deterministic event waiting. However, there are several debug console.log statements and commented-out code blocks in the core packages that should be removed before merging. Additionally, a small cleanup is needed in the test rig to prevent a potential memory leak in the test environment.

@gemini-cli gemini-cli bot added priority/p2 Important but can be addressed in a future release. area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Feb 20, 2026
@joshualitt joshualitt force-pushed the jl/wire-up-generalist branch 2 times, most recently from 3ddd835 to 6ddf758 Compare February 24, 2026 19:46
@joshualitt joshualitt marked this pull request as ready for review February 24, 2026 19:47
@joshualitt joshualitt requested a review from a team as a code owner February 24, 2026 19:47
Sub-agents are specialized expert agents. Each sub-agent is available as a tool of the same name. You MUST delegate tasks to the sub-agent with the most relevant expertise.

### Strategic Orchestration & Delegation
Operate as a **strategic orchestrator**. Your own context window is your most precious resource. Every turn you take adds to the permanent session history. To keep the session fast and efficient, use sub-agents to "compress" complex or repetitive work.
Copy link
Member

@gundermanc gundermanc Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strategic orchestrator

One concern I'd have is that we're giving the agent two slightly unrelated roles. It's both a specialized SDE agent and an orchestrator. This sort of competing priority can lead to inconsistent behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely something to watch closely. We can easily revert this though if it gives us any grief.

When you delegate, the sub-agent's entire execution is consolidated into a single summary in your history, keeping your main loop lean.

**High-Impact Delegation Candidates:**
- **Repetitive Batch Tasks:** Tasks involving more than 3 files or repeated steps (e.g., "Add license headers to all files in src/", "Fix all lint errors in the project").
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth clarifying that we might want to break large bodies of work into several batches or is that refinement for later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the benefits of decomposition really come out when subagents can run in parallel. Perhaps it makes sense to tackle that aspect holistically and on it's own vs. trying to do it alongside just enabling the generalist agent? But yes, we should circle back after enabling this.

description:
"A general-purpose AI agent with access to all tools. Use it for complex tasks that don't fit into other specialized agents.",
experimental: true,
'A general-purpose AI agent with access to all tools. Highly recommended for tasks that are turn-intensive or involve processing large amounts of data. Use this to keep the main session history lean and efficient. Excellent for: batch refactoring/error fixing across multiple files, running commands with high-volume output, and speculative investigations.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocking: One thing we should consider is the impact on gradual accumlation of context. For example: I frequently use Gemini CLI to do data analysis by having it explore the logs and gradually build up and understanding, before finally answering the question. I wonder if we want to somehow preserve that use case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, maybe this falls out of memory work? let's think this through carefully.

@joshualitt joshualitt added this pull request to the merge queue Feb 26, 2026
@joshualitt joshualitt removed this pull request from the merge queue due to a manual request Feb 26, 2026
@joshualitt joshualitt force-pushed the jl/wire-up-generalist branch from b4244b1 to 7d69a7c Compare February 26, 2026 02:08
@SandyTao520 SandyTao520 force-pushed the main branch 2 times, most recently from 4a78a96 to 0bf3a01 Compare February 26, 2026 03:03
@joshualitt joshualitt force-pushed the jl/wire-up-generalist branch from 7d69a7c to 987b9d7 Compare February 26, 2026 16:20
@joshualitt joshualitt added this pull request to the merge queue Feb 26, 2026
@joshualitt joshualitt removed this pull request from the merge queue due to a manual request Feb 26, 2026
@joshualitt joshualitt added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit 611d934 Feb 26, 2026
27 checks passed
@joshualitt joshualitt deleted the jl/wire-up-generalist branch February 26, 2026 17:00
heaventourist pushed a commit to heaventourist/gemini-cli that referenced this pull request Feb 26, 2026
BryanBradfo pushed a commit to BryanBradfo/gemini-cli that referenced this pull request Mar 5, 2026
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. priority/p2 Important but can be addressed in a future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire up generalist subagent to main agent

2 participants