Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/agents/plugins/gemini/gemini.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,19 @@ export const GeminiPluginMetadata: AgentMetadata = {
// Uses BaseAgentAdapter methods for cross-platform file operations
lifecycle: {
enrichArgs: (args, config) => {
// Gemini CLI uses -m flag for model selection
// Subcommands that do not accept global -m/--model (e.g. extensions install)
const noModelSubcommands = ['extensions', 'health'];
const firstIsNoModelSubcommand = args[0] && noModelSubcommands.includes(args[0]);

const hasModelArg = args.some((arg, idx) =>
(arg === '-m' || arg === '--model') && idx < args.length - 1
);

if (!hasModelArg && config.model) {
if (
!firstIsNoModelSubcommand &&
!hasModelArg &&
config.model
) {
return ['-m', config.model, ...args];
}

Expand Down
Loading