2 Commits
Author SHA1 Message Date
Johannes KresnerandClaude Opus 5.5 71f58d7b30 fix: interactive sessions run with yolo under the sandbox, auto without
build / version (push) Successful in 12s
build / build (aarch64-apple-darwin) (push) Successful in 5m44s
build / build (x86_64-unknown-linux-musl) (push) Successful in 4m2s
build / release (push) Successful in 23s
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>
2026-11-17 15:17:36 +01:00
gitea-actions c768ea79d4 ci: bin.json v0.1.7 2026-11-16 15:09:31 +00:00
4 changed files with 24 additions and 10 deletions

No files matched your search

+3 -3
View File
@@ -1,7 +1,7 @@
{ {
"version": "0.1.6", "version": "0.1.7",
"sha256": { "sha256": {
"aarch64-apple-darwin": "1a6b4944c20f086015368ae5d43f1ca6f11ea1dffd82c41f12e8ed7891e90555", "aarch64-apple-darwin": "b98180cf50d2a7d2f3864b2535f9776e496b91bb451f790de5c9a8cfb00fc8d6",
"x86_64-unknown-linux-musl": "8d85f036b9a0db9306ae421ac7d4ce1fc813daecc901080e80425391da823228" "x86_64-unknown-linux-musl": "5dc06c2d43afb92611a6b3a6fcd7270a22cef06c0985338b851ef278cb2292e7"
} }
} }
+1
View File
@@ -13,6 +13,7 @@ env = ["GITEA_*"] # orch env vars hx may see (default: PATH HOME
# TMPDIR CARGO_* RUST* NIX_*, plus HX_HOME only when `home` is unset) # TMPDIR CARGO_* RUST* NIX_*, plus HX_HOME only when `home` is unset)
sandbox = true # hx --sandbox (bwrap/seatbelt). Default: on when available (macOS, Linux with bwrap), sandbox = true # hx --sandbox (bwrap/seatbelt). Default: on when available (macOS, Linux with bwrap),
# together with --yolo (yolo = false opts out). Unsandboxed hx runs with --auto. # together with --yolo (yolo = false opts out). Unsandboxed hx runs with --auto.
# Interactive sessions (TUI, orch up) with yolo = false get --sandbox --auto.
``` ```
## Allowlist (`allow`) ## Allowlist (`allow`)
+1 -7
View File
@@ -64,13 +64,7 @@ impl Acp {
let mut parts = p.hx.split_whitespace(); let mut parts = p.hx.split_whitespace();
let mut cmd = Command::new(parts.next().context("empty hx command")?); let mut cmd = Command::new(parts.next().context("empty hx command")?);
// sandbox and permission flags are options of the root command, so they go before `serve` // sandbox and permission flags are options of the root command, so they go before `serve`
// the TUI answers permission requests itself, so yolo only when the profile asks for it explicitly cmd.args(parts).args(p.acp_flags());
let flags = p.hx_flags();
cmd.args(parts).args(
flags
.iter()
.filter(|f| **f != "--yolo" || p.yolo == Some(true)),
);
cmd.args(["serve", "--acp", "--cwd"]) cmd.args(["serve", "--acp", "--cwd"])
.arg(worktree) .arg(worktree)
.args(["--session", id]); .args(["--session", id]);
+19
View File
@@ -178,6 +178,16 @@ impl Profile {
f 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). /// 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> { pub fn load_path(path: &std::path::Path) -> Result<Self> {
let s = let s =
@@ -277,6 +287,15 @@ mod tests {
assert_eq!(f("sandbox=false"), ["--auto"]); 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] #[test]
fn bwrap_lookup_scans_path() { fn bwrap_lookup_scans_path() {
let dir = std::env::temp_dir().join(format!("orch-bwrap-{}", std::process::id())); let dir = std::env::temp_dir().join(format!("orch-bwrap-{}", std::process::id()));