fix: resolve Gemini CLI command name with legacy fallback#338
fix: resolve Gemini CLI command name with legacy fallback#338subsy merged 1 commit intosubsy:mainfrom
Conversation
|
@medhatgalal is attempting to deploy a commit to the plgeek Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughIntroduces a unified command resolution system for agent plugins with support for default commands and legacy command aliases. The Gemini agent is updated to use gemini-cli as the primary command while maintaining backwards compatibility with the legacy gemini alias. Command resolution is integrated into the detection and sandboxing workflows. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
3c20879 to
b9e9d61
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #338 +/- ##
==========================================
+ Coverage 46.60% 46.66% +0.05%
==========================================
Files 103 103
Lines 33301 33411 +110
==========================================
+ Hits 15520 15590 +70
- Misses 17781 17821 +40
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/plugins/agents/builtin/gemini.ts (1)
170-173: Build the expected-command list from metadata instead of hard-coding it.This message can drift if aliases evolve; using the base helper keeps one source of truth.
♻️ Proposed refactor
protected override getCommandNotFoundMessage(): string { - return `Gemini CLI not found in PATH. Install from: https://github.com/google-gemini/gemini-cli` + - ' Expected one of `gemini-cli`, `gemini` (legacy alias)'; + return ( + 'Gemini CLI not found in PATH. Install from: https://github.com/google-gemini/gemini-cli' + + ` Expected one of ${this.getExpectedCommandNames()}` + ); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/plugins/agents/builtin/gemini.ts` around lines 170 - 173, Replace the hard-coded command names in getCommandNotFoundMessage() with the canonical list derived from the agent metadata/helper: call the existing helper that returns expected commands (e.g., getExpectedCommands() or the metadata property that lists aliases) and join that list into the message string so it remains in sync with the single source of truth, while still including the install URL and descriptive text.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/plugins/agents/builtin/gemini.ts`:
- Around line 170-173: Replace the hard-coded command names in
getCommandNotFoundMessage() with the canonical list derived from the agent
metadata/helper: call the existing helper that returns expected commands (e.g.,
getExpectedCommands() or the metadata property that lists aliases) and join that
list into the message string so it remains in sync with the single source of
truth, while still including the install URL and descriptive text.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/plugins/agents/base.tssrc/plugins/agents/builtin/gemini.test.tssrc/plugins/agents/builtin/gemini.tssrc/plugins/agents/types.tssrc/setup/wizard.test.tstests/plugins/gemini-agent.test.tswebsite/content/docs/plugins/agents/gemini.mdx
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Why this fix
Selecting
geminiin setup currently validates against the canonical command string stored by plugin metadata. In this repo,geminiusers were hitting a mismatch because the binary installed by Google isgemini-cli.What changed
defaultCommandis nowgemini-clicommandAliases: ['gemini']for legacy compatibilitygemini-cligeminigemininow persistsagent = "gemini"correctlygeminitogemini-cli, with legacy alias note.Compatibility map
gemini(no config migration impact).gemini-cli.geminibinary remains supported as fallback with a warning-style behavior through candidate selection logic.Verification
bun run typecheckbun run buildbun test tests/plugins/gemini-agent.test.ts src/plugins/agents/builtin/gemini.test.ts src/setup/wizard.test.tsNotes
kiro-cliand existing Codex/Claude flows unchanged.Summary by CodeRabbit
Release Notes
New Features
Documentation
gemini-cli, withgeminisupported as a legacy alias for backwards compatibility.