-
Notifications
You must be signed in to change notification settings - Fork 488
feat: add Gemini CLI provider support #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| export interface AgentConfig { | ||||||
| name: string; | ||||||
| provider: string; // 'anthropic', 'openai', or 'opencode' | ||||||
| provider: string; // 'anthropic', 'openai', 'opencode', or 'gemini' | ||||||
| model: string; // e.g. 'sonnet', 'opus', 'gpt-5.3-codex' | ||||||
| working_directory: string; | ||||||
| system_prompt?: string; | ||||||
|
|
@@ -43,7 +43,7 @@ export interface Settings { | |||||
| whatsapp?: {}; | ||||||
| }; | ||||||
| models?: { | ||||||
| provider?: string; // 'anthropic', 'openai', or 'opencode' | ||||||
| provider?: string; // 'anthropic', 'openai', 'opencode', or 'gemini' | ||||||
| anthropic?: { | ||||||
| model?: string; | ||||||
| }; | ||||||
|
|
@@ -53,6 +53,9 @@ export interface Settings { | |||||
| opencode?: { | ||||||
| model?: string; | ||||||
| }; | ||||||
| gemini?: { | ||||||
| model?: string; | ||||||
| }; | ||||||
| }; | ||||||
| agents?: Record<string, AgentConfig>; | ||||||
| teams?: Record<string, TeamConfig>; | ||||||
|
|
@@ -119,6 +122,18 @@ export const CODEX_MODEL_IDS: Record<string, string> = { | |||||
| 'gpt-5.3-codex': 'gpt-5.3-codex', | ||||||
| }; | ||||||
|
|
||||||
| // Gemini CLI model IDs. Falls back to the raw model string. | ||||||
| export const GEMINI_MODEL_IDS: Record<string, string> = { | ||||||
| 'auto': 'auto', | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The intent of the The fix is to map
Suggested change
Alternatively, add an explicit guard in if (modelId && modelId !== 'auto') {
args.push('--model', modelId);
} |
||||||
| 'pro': 'gemini-2.5-pro', | ||||||
| 'flash': 'gemini-2.5-flash', | ||||||
| 'flash-lite': 'gemini-2.5-flash-lite', | ||||||
| 'gemini-2.5-pro': 'gemini-2.5-pro', | ||||||
| 'gemini-2.5-flash': 'gemini-2.5-flash', | ||||||
| 'gemini-2.5-flash-lite': 'gemini-2.5-flash-lite', | ||||||
| 'gemini-3-pro-preview': 'gemini-3-pro-preview', | ||||||
| }; | ||||||
|
|
||||||
| // OpenCode model IDs in provider/model format (passed via --model / -m flag). | ||||||
| // Falls back to the raw model string from settings if no mapping is found. | ||||||
| export const OPENCODE_MODEL_IDS: Record<string, string> = { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resume-error regex may be too narrow
The pattern
/(error resuming session|no .*session|session not found)/iis hardcoded against three specific Gemini CLI error phrases. If the actual CLI emits a differently-worded message (e.g.,"Session does not exist","Cannot resume session", or any localised variant), the retry-without-resume fallback will never trigger — the original error will propagate instead and the agent will appear broken on first use.Consider expanding the regex to cover more variants or, better, also catching the exit code if the Gemini CLI uses a distinctive non-zero code for "no session" errors: