mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-21 09:13:05 -07:00
79cc1eb4f4
- Implement External Agent kind with personality overlays (Claude Code, Codex) - Enhance AgentLoader and Registry for external agent discovery and registration - Fix critical startup race condition in Config registry initialization - Add TeamSelectionDialog and ActiveTeamIndicator to CLI UI - Include comprehensive integration and unit tests for agent teams - Refactor SubagentToolWrapper for type-safe external agent invocation
1.8 KiB
1.8 KiB
TASK-06: External Agent Definitions and "Polyfill" Support
Objective
Introduce a new external agent kind to support integrating and "polyfilling"
competitor agents like Claude Code and Codex into Gemini CLI teams.
Implementation Details
1. Type Definitions (packages/core/src/agents/types.ts)
- Add
ExternalAgentDefinitionto theAgentDefinitionunion. - Include fields for
provider(e.g.,'claude-code','codex') andproviderOptions.export interface ExternalAgentDefinition extends BaseAgentDefinition { kind: 'external'; provider: string; // Allow for provider-specific configuration providerConfig?: Record<string, unknown>; }
2. External Agent Invocation (packages/core/src/agents/external-invocation.ts)
- Implement
ExternalAgentInvocationclass. - The Polyfill Logic:
- Use the system's configured default model to "polyfill" the external agent.
- Apply a "personality overlay" to the system prompt based on the
provider. - Example (Claude Code): Prepend instructions to adopt the specific style, tool usage patterns, and "persona" of a high-performance, concise coding assistant.
- Example (Codex): Prepend instructions to act as a specialized code generation model.
- Ensure the overlay is model-agnostic and relies on the
providerConfigfor behavior tuning.
3. Tool Wrapping (packages/core/src/agents/subagent-tool-wrapper.ts)
- Update
createInvocationto recognizekind === 'external'and return anExternalAgentInvocation.
Verification
- Unit tests for
ExternalAgentInvocationensuring provider-specific prompts are applied. - Manual verification by creating an agent with
kind: externalandprovider: claude-code.