mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-18 14:44:21 +01:00
feat(cli): Add --quiet /-q flag to goose run (#2939)
This commit is contained in:
committed by
GitHub
parent
98ac09cda0
commit
4e97ffacd6
@@ -42,6 +42,8 @@ pub struct SessionBuilderConfig {
|
||||
pub max_tool_repetitions: Option<u32>,
|
||||
/// Whether this session will be used interactively (affects debugging prompts)
|
||||
pub interactive: bool,
|
||||
/// Quiet mode - suppress non-response output
|
||||
pub quiet: bool,
|
||||
}
|
||||
|
||||
/// Offers to help debug an extension failure by creating a minimal debugging session
|
||||
@@ -457,13 +459,16 @@ pub async fn build_session(session_config: SessionBuilderConfig) -> Session {
|
||||
session.agent.override_system_prompt(override_prompt).await;
|
||||
}
|
||||
|
||||
output::display_session_info(
|
||||
session_config.resume,
|
||||
&provider_name,
|
||||
&model_name,
|
||||
&session_file,
|
||||
Some(&provider_for_display),
|
||||
);
|
||||
// Display session information unless in quiet mode
|
||||
if !session_config.quiet {
|
||||
output::display_session_info(
|
||||
session_config.resume,
|
||||
&provider_name,
|
||||
&model_name,
|
||||
&session_file,
|
||||
Some(&provider_for_display),
|
||||
);
|
||||
}
|
||||
session
|
||||
}
|
||||
|
||||
@@ -486,6 +491,7 @@ mod tests {
|
||||
debug: true,
|
||||
max_tool_repetitions: Some(5),
|
||||
interactive: true,
|
||||
quiet: false,
|
||||
};
|
||||
|
||||
assert_eq!(config.extensions.len(), 1);
|
||||
@@ -494,6 +500,7 @@ mod tests {
|
||||
assert!(config.debug);
|
||||
assert_eq!(config.max_tool_repetitions, Some(5));
|
||||
assert!(config.interactive);
|
||||
assert!(!config.quiet);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -511,6 +518,7 @@ mod tests {
|
||||
assert!(!config.debug);
|
||||
assert!(config.max_tool_repetitions.is_none());
|
||||
assert!(!config.interactive);
|
||||
assert!(!config.quiet);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user