From c6cceb67048b6a3cd38d24b05081be087a49e648 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 31 Oct 2026 03:33:11 +0100 Subject: [PATCH] self-run: the actuator fixes --permission-mode bypassPermissions; print mode started in Manual (managed defaultMode not applied) and --permission-prompts none denied every eureka-state tool Co-Authored-By: Claude Opus 5.5 --- crates/mind-body/src/self_run.rs | 10 ++++++++-- crates/mind-body/src/self_run/tests.rs | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/crates/mind-body/src/self_run.rs b/crates/mind-body/src/self_run.rs index 2f558dd..3d65da2 100644 --- a/crates/mind-body/src/self_run.rs +++ b/crates/mind-body/src/self_run.rs @@ -114,8 +114,12 @@ pub fn session_id(run: &PipelineRef) -> Uuid { } /// The argument list of the child, and nothing else: no resume, continue or -/// fork, no model, no permission mode and no settings of its own belong to this -/// actuator. Only the user's settings load (the fresh configuration directory +/// fork, no model and no settings of its own belong to this actuator. It fixes +/// the permission mode: print mode starts in Manual when nothing on the command +/// line sets a mode (the managed `defaultMode` was not applied in print mode, +/// 2026-10-31), and `--permission-prompts none` then denies every tool that +/// needs approval, so a Mind's reach within her slice is granted here. Only the +/// user's settings load (the fresh configuration directory /// the seed fills); the working directory's project and local settings, which a /// run could have written, do not. /// `budget_usd` is the run's, as stored. @@ -133,6 +137,8 @@ pub fn claude_args(session: Uuid, budget_usd: &str) -> Vec { budget_usd, "--max-turns", &MAX_TURNS.to_string(), + "--permission-mode", + "bypassPermissions", "--permission-prompts", "none", "--setting-sources", diff --git a/crates/mind-body/src/self_run/tests.rs b/crates/mind-body/src/self_run/tests.rs index 2f5db35..4a8c635 100644 --- a/crates/mind-body/src/self_run/tests.rs +++ b/crates/mind-body/src/self_run/tests.rs @@ -488,6 +488,8 @@ fn claude_args_is_exactly_the_fixed_list_for_a_session_and_a_budget() { "12.25", "--max-turns", "500", + "--permission-mode", + "bypassPermissions", "--permission-prompts", "none", "--setting-sources", @@ -495,9 +497,12 @@ fn claude_args_is_exactly_the_fixed_list_for_a_session_and_a_budget() { ] ); // Those belong to the run measure or to the unit's managed settings. - for forbidden in ["--resume", "--continue", "--fork-session", "--model", "--permission-mode", "--dangerously-skip-permissions", "--settings", "--system-prompt"] { - assert!(!args.iter().any(|arg| arg.starts_with(forbidden) || arg.contains("dangerously") || arg == "bypassPermissions"), "{forbidden}"); + for forbidden in ["--resume", "--continue", "--fork-session", "--model", "--dangerously-skip-permissions", "--settings", "--system-prompt"] { + assert!(!args.iter().any(|arg| arg.starts_with(forbidden) || arg.contains("dangerously")), "{forbidden}"); } + // Print mode starts in Manual without a mode, and prompts none then denies. + let mode = args.iter().position(|arg| arg == "--permission-mode").expect("mode flag"); + assert_eq!(args[mode + 1], "bypassPermissions"); assert_eq!(MAX_TURNS, 500); }