Add Auto permission mode
Build App (Preview) / compute-version (pull_request) Successful in 5s
Secret Scan / scan (push) Successful in 5s
Build App (Preview) / test (pull_request) Successful in 4m38s
Secret Scan / scan (pull_request) Successful in 4s
Build App (Preview) / create-release (pull_request) Successful in 1s
Build App (Preview) / build-macos (pull_request) Successful in 2m47s
Build Container / build-container (pull_request) Successful in 10m19s
Build App (Preview) / build-windows (pull_request) Successful in 5m57s
Build App (Preview) / build-linux (pull_request) Canceled after 14s
Build App (Preview) / prune-previews (pull_request) Canceled after 0s
Build App (Preview) / compute-version (pull_request) Successful in 5s
Secret Scan / scan (push) Successful in 5s
Build App (Preview) / test (pull_request) Successful in 4m38s
Secret Scan / scan (pull_request) Successful in 4s
Build App (Preview) / create-release (pull_request) Successful in 1s
Build App (Preview) / build-macos (pull_request) Successful in 2m47s
Build Container / build-container (pull_request) Successful in 10m19s
Build App (Preview) / build-windows (pull_request) Successful in 5m57s
Build App (Preview) / build-linux (pull_request) Canceled after 14s
Build App (Preview) / prune-previews (pull_request) Canceled after 0s
Claude Code now ships `--permission-mode auto`, where a safety classifier approves routine actions and blocks risky ones without prompting. Expose it as a fifth mode between Accept Edits and Bypass: terminals, resumed sessions, the tab badge, and the scheduler's task runner all map it to the flag. Headless scheduled runs don't stall in Auto (blocked actions are denied, not prompted), so the task editor shows a softer note instead of the stall warning. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -469,6 +469,20 @@ mod tests {
|
||||
assert!(!cmd[2].contains(" -n "), "empty name must add no flag: {}", cmd[2]);
|
||||
}
|
||||
|
||||
/// Auto mode is passed as a `--permission-mode` value, not its own flag.
|
||||
#[test]
|
||||
fn build_terminal_cmd_passes_auto_permission_mode() {
|
||||
let mut p = project("anthropic", serde_json::Value::Null);
|
||||
p.permission_mode = Some(crate::models::project::PermissionMode::Auto);
|
||||
let cmd = build_claude_terminal_cmd(&p, None, None);
|
||||
|
||||
assert!(
|
||||
cmd[2].contains("exec claude '--permission-mode' 'auto'"),
|
||||
"got: {}",
|
||||
cmd[2]
|
||||
);
|
||||
}
|
||||
|
||||
/// The Bedrock-profile path keeps its AWS validation *and* gains the
|
||||
/// prelude, immediately before the exec.
|
||||
#[test]
|
||||
|
||||
@@ -166,6 +166,9 @@ pub enum PermissionMode {
|
||||
Default,
|
||||
/// Auto-accept file edits, prompt for everything else.
|
||||
AcceptEdits,
|
||||
/// Claude Code's classifier approves safe actions and blocks risky ones,
|
||||
/// without prompting.
|
||||
Auto,
|
||||
/// Skip all permission prompts.
|
||||
Bypass,
|
||||
}
|
||||
@@ -180,6 +183,7 @@ impl PermissionMode {
|
||||
PermissionMode::AcceptEdits => {
|
||||
vec!["--permission-mode".to_string(), "acceptEdits".to_string()]
|
||||
}
|
||||
PermissionMode::Auto => vec!["--permission-mode".to_string(), "auto".to_string()],
|
||||
PermissionMode::Bypass => vec!["--dangerously-skip-permissions".to_string()],
|
||||
}
|
||||
}
|
||||
@@ -191,6 +195,7 @@ impl PermissionMode {
|
||||
PermissionMode::Plan => "plan",
|
||||
PermissionMode::Default => "default",
|
||||
PermissionMode::AcceptEdits => "acceptEdits",
|
||||
PermissionMode::Auto => "auto",
|
||||
PermissionMode::Bypass => "bypass",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user