feat(cli): add dynamic agent switcher and /agent subcommand

- Implemented /agent command with manage (opens dialog) and set subcommands.
- Created AgentDialog component for choosing between standard and enterprise agents.
- Integrated remember agent setting with persist toggle.
- Wired --agent cli argument for booting directly into specific agent.
- Handled clean session remounting on agent swap via React key-swapping of AppContainer, fully complying with Rules of Hooks.
- Added agent-name persistently to the status bar footer items.
- Resolved dynamic routing inside non-interactive headless loops to fully support Gemini Enterprise prompts.

TAG=agy
CONV=81e82460-f8cd-4c7b-a037-2cbedda4d3c0
This commit is contained in:
Michael Bleigh
2026-05-18 19:01:39 +00:00
parent fc8928c089
commit c22187d731
29 changed files with 785 additions and 18 deletions
@@ -296,7 +296,9 @@ export async function runNonInteractive({
});
}
const useEnterprise = process.env['GEMINI_CLI_ENTERPRISE_AGENT'] === 'true';
const useEnterprise =
config.getAgent() === 'gemini-enterprise' ||
process.env['GEMINI_CLI_ENTERPRISE_AGENT'] === 'true';
// Create AgentSession — owns the agentic loop
const session = useEnterprise
? new EnterpriseAgentSession({ config, promptId: prompt_id })