Skip to content

Commit 45b196a

Browse files
fix(agents): Fixed issue with gemini extension installation (#223)
1 parent 49d7516 commit 45b196a

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/agents/plugins/gemini/gemini.plugin.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,19 @@ export const GeminiPluginMetadata: AgentMetadata = {
131131
// Uses BaseAgentAdapter methods for cross-platform file operations
132132
lifecycle: {
133133
enrichArgs: (args, config) => {
134-
// Gemini CLI uses -m flag for model selection
134+
// Subcommands that do not accept global -m/--model (e.g. extensions install)
135+
const noModelSubcommands = ['extensions', 'health'];
136+
const firstIsNoModelSubcommand = args[0] && noModelSubcommands.includes(args[0]);
137+
135138
const hasModelArg = args.some((arg, idx) =>
136139
(arg === '-m' || arg === '--model') && idx < args.length - 1
137140
);
138141

139-
if (!hasModelArg && config.model) {
142+
if (
143+
!firstIsNoModelSubcommand &&
144+
!hasModelArg &&
145+
config.model
146+
) {
140147
return ['-m', config.model, ...args];
141148
}
142149

0 commit comments

Comments
 (0)