fix: interactive sessions run with yolo under the sandbox, auto without
orch dropped --yolo for ACP sessions (TUI, orch up), so hx started with a bare --sandbox and asked for every edit. Interactive sessions now use the same flags as batch runs: --sandbox --yolo when a sandbox is available, --auto when not. A sandbox with yolo = false gets --sandbox --auto. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c768ea79d4
commit
71f58d7b30
3 files changed
+21
-7
No files matched your search
@@ -178,6 +178,16 @@ impl Profile {
|
||||
f
|
||||
}
|
||||
|
||||
/// Flags for an interactive (ACP) session: like `hx_flags` (sandbox brings yolo, no sandbox falls back to
|
||||
/// `--auto`), but a sandbox with `yolo = false` gets `--auto` too, so not every edit asks.
|
||||
pub fn acp_flags(&self) -> Vec<&'static str> {
|
||||
let mut f = self.hx_flags();
|
||||
if f == ["--sandbox"] {
|
||||
f.push("--auto");
|
||||
}
|
||||
f
|
||||
}
|
||||
|
||||
/// A profile file named by its path (an issue session's profile in its worktree).
|
||||
pub fn load_path(path: &std::path::Path) -> Result<Self> {
|
||||
let s =
|
||||
@@ -277,6 +287,15 @@ mod tests {
|
||||
assert_eq!(f("sandbox=false"), ["--auto"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn acp_flags_yolo_with_sandbox_else_auto() {
|
||||
let f = |s| Profile::parse(s).unwrap().acp_flags();
|
||||
assert_eq!(f("sandbox=true"), ["--sandbox", "--yolo"]);
|
||||
assert_eq!(f("sandbox=true\nyolo=true"), ["--sandbox", "--yolo"]);
|
||||
assert_eq!(f("sandbox=true\nyolo=false"), ["--sandbox", "--auto"]);
|
||||
assert_eq!(f("sandbox=false"), ["--auto"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bwrap_lookup_scans_path() {
|
||||
let dir = std::env::temp_dir().join(format!("orch-bwrap-{}", std::process::id()));
|
||||
|
||||
Reference in new issue
Block a user