Skip to content

Commit 97ad503

Browse files
authored
fix: small fixes (#665)
1 parent 1adb823 commit 97ad503

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

crates/goose-cli/src/commands/configure.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use goose::providers::google::GOOGLE_DEFAULT_MODEL;
1010
use goose::providers::groq::GROQ_DEFAULT_MODEL;
1111
use goose::providers::ollama::OLLAMA_MODEL;
1212
use goose::providers::openai::OPEN_AI_DEFAULT_MODEL;
13+
use goose::providers::openrouter::OPENROUTER_DEFAULT_MODEL;
1314
use std::collections::HashMap;
1415
use std::error::Error;
1516

@@ -98,6 +99,7 @@ pub async fn configure_provider_dialog(
9899
"anthropic".to_string(),
99100
"google".to_string(),
100101
"groq".to_string(),
102+
"openrouter".to_string(),
101103
];
102104
let provider = cliclack::select("Which model provider should we use?")
103105
.initial_value(&config.default_provider)
@@ -107,7 +109,8 @@ pub async fn configure_provider_dialog(
107109
(&providers[2], "Ollama", "Local open source models"),
108110
(&providers[3], "Anthropic", "Claude models"),
109111
(&providers[4], "Google Gemini", "Gemini models"),
110-
(&providers[5], "Groq", "AI models"),
112+
(&providers[5], "Groq", "Fast inference"),
113+
(&providers[6], "OpenRouter", "Router for many models"),
111114
])
112115
.interact()?;
113116
provider.to_string()
@@ -204,6 +207,7 @@ pub fn get_recommended_model(provider_name: &str) -> &str {
204207
"anthropic" => ANTHROPIC_DEFAULT_MODEL,
205208
"google" => GOOGLE_DEFAULT_MODEL,
206209
"groq" => GROQ_DEFAULT_MODEL,
210+
"openrouter" => OPENROUTER_DEFAULT_MODEL,
207211
_ => panic!("Invalid provider name"),
208212
}
209213
}
@@ -216,6 +220,7 @@ pub fn get_required_keys(provider_name: &str) -> Vec<&'static str> {
216220
"anthropic" => vec!["ANTHROPIC_API_KEY"],
217221
"google" => vec!["GOOGLE_API_KEY"],
218222
"groq" => vec!["GROQ_API_KEY"],
223+
"openrouter" => vec!["OPENROUTER_API_KEY"],
219224
_ => panic!("Invalid provider name"),
220225
}
221226
}

crates/goose-cli/src/main.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ enum Command {
117117
#[arg(
118118
short,
119119
long,
120-
required = true,
121120
value_name = "FILE",
122-
help = "Path to instruction file containing commands"
121+
help = "Path to instruction file containing commands",
122+
conflicts_with = "input_text"
123123
)]
124124
instructions: Option<String>,
125125

@@ -129,7 +129,8 @@ enum Command {
129129
long = "text",
130130
value_name = "TEXT",
131131
help = "Input text to provide to Goose directly",
132-
long_help = "Input text containing commands for Goose. Use this in lieu of the instructions argument."
132+
long_help = "Input text containing commands for Goose. Use this in lieu of the instructions argument.",
133+
conflicts_with = "instructions"
133134
)]
134135
input_text: Option<String>,
135136

@@ -246,6 +247,12 @@ async fn main() -> Result<()> {
246247
agent,
247248
resume,
248249
}) => {
250+
// Validate that we have some input source
251+
if instructions.is_none() && input_text.is_none() {
252+
eprintln!("Error: Must provide either --instructions or --text");
253+
std::process::exit(1);
254+
}
255+
249256
if let Some(agent_version) = agent.clone() {
250257
if !AgentFactory::available_versions().contains(&agent_version.as_str()) {
251258
eprintln!("Error: Invalid agent version '{}'", agent_version);

crates/goose/src/agents/capabilities.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl Capabilities {
100100
SystemConfig::Sse { ref uri, ref envs } => {
101101
let transport = SseTransport::new(uri, envs.get_env());
102102
let handle = transport.start().await?;
103-
let service = McpService::with_timeout(handle, Duration::from_secs(100));
103+
let service = McpService::with_timeout(handle, Duration::from_secs(300));
104104
Box::new(McpClient::new(service))
105105
}
106106
SystemConfig::Stdio {
@@ -110,7 +110,7 @@ impl Capabilities {
110110
} => {
111111
let transport = StdioTransport::new(cmd, args.to_vec(), envs.get_env());
112112
let handle = transport.start().await?;
113-
let service = McpService::with_timeout(handle, Duration::from_secs(100));
113+
let service = McpService::with_timeout(handle, Duration::from_secs(300));
114114
Box::new(McpClient::new(service))
115115
}
116116
SystemConfig::Builtin { ref name } => {
@@ -126,7 +126,7 @@ impl Capabilities {
126126
HashMap::new(),
127127
);
128128
let handle = transport.start().await?;
129-
let service = McpService::with_timeout(handle, Duration::from_secs(100));
129+
let service = McpService::with_timeout(handle, Duration::from_secs(300));
130130
Box::new(McpClient::new(service))
131131
}
132132
};

0 commit comments

Comments
 (0)