Fix gemini cli command parsing (#6960)

This commit is contained in:
David Katz
2026-02-05 10:47:25 -05:00
committed by GitHub
parent 06e8b85907
commit 66a2a3cb9a
5 changed files with 12 additions and 17 deletions
+4 -5
View File
@@ -8,7 +8,6 @@ use serde_json::Value;
use serde_yaml::Mapping;
use std::collections::HashMap;
use std::env;
use std::ffi::OsString;
use std::fs::OpenOptions;
use std::io::Write;
use std::path::{Path, PathBuf};
@@ -954,10 +953,10 @@ impl Config {
}
}
config_value!(CLAUDE_CODE_COMMAND, OsString, "claude");
config_value!(GEMINI_CLI_COMMAND, OsString, "gemini");
config_value!(CURSOR_AGENT_COMMAND, OsString, "cursor-agent");
config_value!(CODEX_COMMAND, OsString, "codex");
config_value!(CLAUDE_CODE_COMMAND, String, "claude");
config_value!(GEMINI_CLI_COMMAND, String, "gemini");
config_value!(CURSOR_AGENT_COMMAND, String, "cursor-agent");
config_value!(CODEX_COMMAND, String, "codex");
config_value!(CODEX_REASONING_EFFORT, String, "high");
config_value!(CODEX_ENABLE_SKILLS, String, "true");
config_value!(CODEX_SKIP_GIT_CHECK, String, "false");
+2 -3
View File
@@ -2,7 +2,6 @@ use anyhow::Result;
use async_trait::async_trait;
use rmcp::model::Role;
use serde_json::{json, Value};
use std::ffi::OsString;
use std::path::PathBuf;
use std::process::Stdio;
use tokio::io::{AsyncBufReadExt, BufReader};
@@ -36,8 +35,8 @@ pub struct ClaudeCodeProvider {
impl ClaudeCodeProvider {
pub async fn from_env(model: ModelConfig) -> Result<Self> {
let config = crate::config::Config::global();
let command: OsString = config.get_claude_code_command().unwrap_or_default().into();
let resolved_command = SearchPaths::builder().with_npm().resolve(command)?;
let command: String = config.get_claude_code_command().unwrap_or_default().into();
let resolved_command = SearchPaths::builder().with_npm().resolve(&command)?;
Ok(Self {
command: resolved_command,
+2 -3
View File
@@ -1,7 +1,6 @@
use anyhow::Result;
use async_trait::async_trait;
use serde_json::json;
use std::ffi::OsString;
use std::path::PathBuf;
use std::process::Stdio;
use tokio::io::{AsyncBufReadExt, BufReader};
@@ -48,8 +47,8 @@ pub struct CodexProvider {
impl CodexProvider {
pub async fn from_env(model: ModelConfig) -> Result<Self> {
let config = Config::global();
let command: OsString = config.get_codex_command().unwrap_or_default().into();
let resolved_command = SearchPaths::builder().with_npm().resolve(command)?;
let command: String = config.get_codex_command().unwrap_or_default().into();
let resolved_command = SearchPaths::builder().with_npm().resolve(&command)?;
// Get reasoning effort from config, default to "high"
let reasoning_effort = config
+2 -3
View File
@@ -2,7 +2,6 @@ use anyhow::Result;
use async_trait::async_trait;
use rmcp::model::Role;
use serde_json::{json, Value};
use std::ffi::OsString;
use std::path::PathBuf;
use std::process::Stdio;
use tokio::io::{AsyncBufReadExt, BufReader};
@@ -36,8 +35,8 @@ pub struct CursorAgentProvider {
impl CursorAgentProvider {
pub async fn from_env(model: ModelConfig) -> Result<Self> {
let config = crate::config::Config::global();
let command: OsString = config.get_cursor_agent_command().unwrap_or_default().into();
let resolved_command = SearchPaths::builder().with_npm().resolve(command)?;
let command: String = config.get_cursor_agent_command().unwrap_or_default().into();
let resolved_command = SearchPaths::builder().with_npm().resolve(&command)?;
Ok(Self {
command: resolved_command,
+2 -3
View File
@@ -1,7 +1,6 @@
use anyhow::Result;
use async_trait::async_trait;
use serde_json::json;
use std::ffi::OsString;
use std::path::PathBuf;
use std::process::Stdio;
use tokio::io::{AsyncBufReadExt, BufReader};
@@ -42,8 +41,8 @@ pub struct GeminiCliProvider {
impl GeminiCliProvider {
pub async fn from_env(model: ModelConfig) -> Result<Self> {
let config = Config::global();
let command: OsString = config.get_gemini_cli_command().unwrap_or_default().into();
let resolved_command = SearchPaths::builder().with_npm().resolve(command)?;
let command: String = config.get_gemini_cli_command().unwrap_or_default().into();
let resolved_command = SearchPaths::builder().with_npm().resolve(&command)?;
Ok(Self {
command: resolved_command,