mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-18 06:34:26 +01:00
feat: add write approve mode (#1628)
This commit is contained in:
@@ -697,6 +697,11 @@ pub fn configure_goose_mode_dialog() -> Result<(), Box<dyn Error>> {
|
||||
.item(
|
||||
"approve",
|
||||
"Approve Mode",
|
||||
"All tools, extensions and file modificatio will require human approval"
|
||||
)
|
||||
.item(
|
||||
"write_approve",
|
||||
"Write Approve Mode",
|
||||
"Editing, creating, deleting files and using extensions will require human approval"
|
||||
)
|
||||
.item(
|
||||
@@ -713,7 +718,11 @@ pub fn configure_goose_mode_dialog() -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
"approve" => {
|
||||
config.set_param("GOOSE_MODE", Value::String("approve".to_string()))?;
|
||||
cliclack::outro("Set to Approve Mode - modifications require approval")?;
|
||||
cliclack::outro("Set to Approve Mode - all tools and modifications require approval")?;
|
||||
}
|
||||
"write_approve" => {
|
||||
config.set_param("GOOSE_MODE", Value::String("write_approve".to_string()))?;
|
||||
cliclack::outro("Set to Write Approve Mode - modifications require approval")?;
|
||||
}
|
||||
"chat" => {
|
||||
config.set_param("GOOSE_MODE", Value::String("chat".to_string()))?;
|
||||
|
||||
@@ -77,7 +77,7 @@ impl GooseCompleter {
|
||||
|
||||
/// Complete flags for the /mode command
|
||||
fn complete_mode_flags(&self, line: &str) -> Result<(usize, Vec<Pair>)> {
|
||||
let modes = ["auto", "approve", "chat"];
|
||||
let modes = ["auto", "approve", "write_approve", "chat"];
|
||||
|
||||
let parts: Vec<&str> = line.split_whitespace().collect();
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ impl Session {
|
||||
let mode = mode.to_lowercase();
|
||||
|
||||
// Check if mode is valid
|
||||
if !["auto", "approve", "chat"].contains(&mode.as_str()) {
|
||||
if !["auto", "approve", "chat", "write_approve"].contains(&mode.as_str()) {
|
||||
output::render_error(&format!(
|
||||
"Invalid mode '{}'. Mode must be one of: auto, approve, chat",
|
||||
mode
|
||||
|
||||
@@ -275,7 +275,7 @@ impl Agent for TruncateAgent {
|
||||
// Clone goose_mode once before the match to avoid move issues
|
||||
let mode = goose_mode.clone();
|
||||
match mode.as_str() {
|
||||
"approve" => {
|
||||
"approve" | "write_approve" => {
|
||||
let mut read_only_tools = Vec::new();
|
||||
let mut needs_confirmation = Vec::<&ToolRequest>::new();
|
||||
let mut approved_tools = Vec::new();
|
||||
@@ -298,7 +298,7 @@ impl Agent for TruncateAgent {
|
||||
}
|
||||
|
||||
// Only check read-only status for tools needing confirmation
|
||||
if !needs_confirmation.is_empty() {
|
||||
if !needs_confirmation.is_empty() && mode == "write_approve" {
|
||||
read_only_tools = detect_read_only_tools(&capabilities, needs_confirmation.clone()).await;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ Goose’s permissions determine how much autonomy it has when modifying files, u
|
||||
| Mode | Description | Best For |
|
||||
| ---------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||
| **Auto Mode** | Goose can modify files, use extensions, and delete files **without requiring approval**. | Users who want **full automation** and seamless integration into their workflow. |
|
||||
| **Approve Mode** | Goose **asks for confirmation** before modifying, creating, deleting files and before using extensions. | Users who want to **review and approve** changes and extension use before they happen. |
|
||||
| **Approve Mode** | Goose **asks for confirmation** before all tools and extensions. | Users who want to **review and approve** any changes and extension use before they happen. |
|
||||
| **Write Approve Mode** | Goose **asks for confirmation** before modifying, creating, deleting files and before using extensions. | Users who want to **review and approve** write or risky changes and extension use before they happen. |
|
||||
| **Chat Mode** | Goose **only engages in chat**, with no extension use or file modifications. | Users who prefer a **conversational AI experience** without automation. |
|
||||
|
||||
:::warning
|
||||
@@ -82,6 +83,7 @@ Here's how to configure:
|
||||
│ ● Auto Mode
|
||||
// highlight-end
|
||||
| ○ Approve Mode
|
||||
| ○ Write Approve Mode
|
||||
| ○ Chat Mode
|
||||
|
|
||||
└ Set to Auto Mode - full file modification enabled
|
||||
|
||||
Reference in New Issue
Block a user