From 0b36df066cdc339480f5ce2f7b37dc38b90049c8 Mon Sep 17 00:00:00 2001 From: "gominimal-aw-bot[bot]" <281738952+gominimal-aw-bot[bot]@users.noreply.github.com> Date: Thu, 30 Jul 2026 21:37:09 +0000 Subject: [PATCH 1/5] docs: name full exec-channel allowlist for session attach -c Three docs stated that the non-interactive `min session attach -c` channel accepts only `min run` invocations. The daemon's exec handler also accepts `min package build [args...]` and `min check [args...]` (crates/minimald/src/exec.rs), so the docs understated the allowlist. List all three accepted forms in cli-min.md, agents.md, and sessions.md. Fixes #1067 --- docs/concepts/sessions.md | 5 +++-- docs/guide/agents.md | 2 +- docs/reference/cli-min.md | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/concepts/sessions.md b/docs/concepts/sessions.md index 07b927119..0120f2206 100644 --- a/docs/concepts/sessions.md +++ b/docs/concepts/sessions.md @@ -115,8 +115,9 @@ the session's workspace; bring them back to the host by pushing them out with `git push min://`. To run a declared task non-interactively instead of opening a shell, pass -`--command` (short `-c`). The command channel accepts only `min run ` -invocations; arbitrary commands need an interactive shell: +`--command` (short `-c`). The command channel accepts only `min run `, +`min package build [args...]`, and `min check [args...]` invocations; arbitrary +commands need an interactive shell: ```console $ min session attach my-session -c 'min run test' diff --git a/docs/guide/agents.md b/docs/guide/agents.md index b86c33714..77cd32ea7 100644 --- a/docs/guide/agents.md +++ b/docs/guide/agents.md @@ -24,7 +24,7 @@ $ claude Claude Code launches inside the session with your project's source code and a read-only system containing the `claude-code` binary and core utilities from `base`. The session has no additional access to anything on your host system unless you explicitly declare it. -Note that sessions are driven interactively: attaching needs a terminal, and the non-interactive `min session attach -c` channel accepts only `min run ` invocations. Launch the agent from inside an attached shell as shown above, rather than scripting it from the host. +Note that sessions are driven interactively: attaching needs a terminal, and the non-interactive `min session attach -c` channel accepts only `min run `, `min package build [args...]`, and `min check [args...]` invocations. Launch the agent from inside an attached shell as shown above, rather than scripting it from the host. ## Adding more tools diff --git a/docs/reference/cli-min.md b/docs/reference/cli-min.md index bfa4910a5..0ccb6eccf 100644 --- a/docs/reference/cli-min.md +++ b/docs/reference/cli-min.md @@ -82,7 +82,8 @@ working directory (or the only existing session) and opens an interactive picker if the choice is ambiguous (`--no-input` errors instead). `-c/--command` execs a command in the session context non-interactively instead of opening an interactive shell; the daemon accepts only -`min run ` invocations on this channel, not arbitrary commands. +`min run `, `min package build [args...]`, and `min check [args...]` +invocations on this channel, not arbitrary commands. ### `session destroy` From 522d95a1913b061a1747f97266d4d374e1d83fcc Mon Sep 17 00:00:00 2001 From: bryan Date: Thu, 30 Jul 2026 15:04:16 -0700 Subject: [PATCH 2/5] chore: no-op to restart ci From e00ace22e523feee6fbb52e82924825cd998173c Mon Sep 17 00:00:00 2001 From: Norrie Taylor Date: Thu, 30 Jul 2026 15:06:00 -0700 Subject: [PATCH 3/5] fix: keep session attach -c hidden, restore the dropped hide=true hide = true on AttachArgs::command (#1071) was silently reverted by commit 64a0764d, an unrelated help-text reformat -- the same collateral-clobber pattern #1071 itself had to repair once already. Restore it, along with the "hidden escape hatch" non-TTY error wording that shipped with it. This PR went the opposite direction from a hidden flag: it documented the full min run/min package build/min check allowlist in docs/concepts/sessions.md, docs/guide/agents.md, and docs/reference/cli-min.md. Since -c/--command is a hidden legacy escape hatch and not a general remote shell, remove those mentions instead of expanding them. Co-Authored-By: Claude Sonnet 5 --- crates/minimal/src/lib.rs | 7 ++++--- docs/concepts/sessions.md | 9 --------- docs/guide/agents.md | 2 +- docs/reference/cli-min.md | 6 +----- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/crates/minimal/src/lib.rs b/crates/minimal/src/lib.rs index 1e3463304..97711ee87 100644 --- a/crates/minimal/src/lib.rs +++ b/crates/minimal/src/lib.rs @@ -446,7 +446,7 @@ pub struct AttachArgs { #[arg(add = completion::session_completer())] pub session: Option, /// Command to exec in the session context (non-interactive) - #[arg(long, short)] + #[arg(long, short, hide = true)] pub command: Option, } @@ -1797,8 +1797,9 @@ fn ensure_interactive_attach_tty(stdin_is_tty: bool) -> Result<(), anyhow::Error } else { bail!( "`min session attach` needs an interactive terminal, but stdin is not a TTY. \ - Run it from a terminal, or use `min session attach --command ` to run a \ - single command non-interactively." + Run it from a terminal, or use the non-interactive escape hatch \ + `min session attach --command ` (a hidden flag, kept for scripted \ + callers) to run a single command." ) } } diff --git a/docs/concepts/sessions.md b/docs/concepts/sessions.md index 0120f2206..44f255067 100644 --- a/docs/concepts/sessions.md +++ b/docs/concepts/sessions.md @@ -114,15 +114,6 @@ background, and `min session attach` rejoins it later. Changes you make inside s the session's workspace; bring them back to the host by pushing them out with `git push min://`. -To run a declared task non-interactively instead of opening a shell, pass -`--command` (short `-c`). The command channel accepts only `min run `, -`min package build [args...]`, and `min check [args...]` invocations; arbitrary -commands need an interactive shell: - -```console -$ min session attach my-session -c 'min run test' -``` - ## How a session is composed A session's contents are not hand-configured. They are **composed** from diff --git a/docs/guide/agents.md b/docs/guide/agents.md index 77cd32ea7..1392e288b 100644 --- a/docs/guide/agents.md +++ b/docs/guide/agents.md @@ -24,7 +24,7 @@ $ claude Claude Code launches inside the session with your project's source code and a read-only system containing the `claude-code` binary and core utilities from `base`. The session has no additional access to anything on your host system unless you explicitly declare it. -Note that sessions are driven interactively: attaching needs a terminal, and the non-interactive `min session attach -c` channel accepts only `min run `, `min package build [args...]`, and `min check [args...]` invocations. Launch the agent from inside an attached shell as shown above, rather than scripting it from the host. +Note that sessions are driven interactively: attaching needs a terminal. Launch the agent from inside an attached shell as shown above, rather than scripting it from the host. ## Adding more tools diff --git a/docs/reference/cli-min.md b/docs/reference/cli-min.md index 0ccb6eccf..ff62e8dd5 100644 --- a/docs/reference/cli-min.md +++ b/docs/reference/cli-min.md @@ -73,17 +73,13 @@ the current directory). ### `session attach` ``` -min session attach [-c ] [SESSION] +min session attach [SESSION] ``` Attaches to an existing session, identified by UUID or session name. When `SESSION` is omitted, `min session attach` resolves a session from the current working directory (or the only existing session) and opens an interactive picker if the choice is ambiguous (`--no-input` errors instead). -`-c/--command` execs a command in the session context non-interactively -instead of opening an interactive shell; the daemon accepts only -`min run `, `min package build [args...]`, and `min check [args...]` -invocations on this channel, not arbitrary commands. ### `session destroy` From d27279cbbd62edd9080e0be246207fd9c764ff49 Mon Sep 17 00:00:00 2001 From: Norrie Taylor Date: Thu, 30 Jul 2026 15:07:15 -0700 Subject: [PATCH 4/5] docs: stop enumerating the -c/--command allowlist in AGENTS.md too The footgun note still spelled out the exact min run/min package build/min check allowlist, which is itself advertising a hidden flag. Keep the warning (don't treat -c as a general shell) and the source pointer, drop the enumerated command list. Co-Authored-By: Claude Sonnet 5 --- AGENTS.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index b0184c1ba..d6f29338a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -204,14 +204,12 @@ Verified against the current tree; sources in parentheses. typically the distribution shim (`~/.minimal/shim/bin/minimal`), distinct from anything this repo builds (justfile comments, `crates/minvmd/README.md`). -- **`min session attach -c` is not a general remote shell.** The daemon's exec - handler accepts only `min run `, `min package build [args...]`, and - `min check [args...]` (plus the internal `git-receive-pack min://` path); - anything else fails the channel. Task - execs inherit the session's no-net/host-net mode, but an own-IP session's - task exec currently falls back to host networking; use an interactive - attach when the session's network identity matters - (`crates/minimald/src/exec.rs`). +- **`min session attach -c` is not a general remote shell.** It is a hidden, + legacy escape hatch for scripted callers, gated behind a small internal + allowlist (`crates/minimald/src/exec.rs`) that rejects anything outside it. + Task execs inherit the session's no-net/host-net mode, but an own-IP + session's task exec currently falls back to host networking; use an + interactive attach when the session's network identity matters. ## CI lane map From 35185c1a82fccfc84d8722683647bb57675e42c4 Mon Sep 17 00:00:00 2001 From: Norrie Taylor Date: Thu, 30 Jul 2026 15:11:01 -0700 Subject: [PATCH 5/5] fix: stop pointing the non-TTY attach error at --command The non-TTY error was still advertising the hidden --command escape hatch to every interactive caller who hit it -- inconsistent with hiding the flag everywhere else. Drop the mention; it only ever fires on the interactive path (command.is_none()), so it was pushing newcomers toward a flag we deliberately don't document. Update the one test that asserted on the old wording. Also drop the AGENTS.md footgun bullet entirely per feedback -- no partial version, just remove it. Co-Authored-By: Claude Sonnet 5 --- AGENTS.md | 6 ------ crates/minimal/src/lib.rs | 6 ++---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d6f29338a..9dab6d6e0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -204,12 +204,6 @@ Verified against the current tree; sources in parentheses. typically the distribution shim (`~/.minimal/shim/bin/minimal`), distinct from anything this repo builds (justfile comments, `crates/minvmd/README.md`). -- **`min session attach -c` is not a general remote shell.** It is a hidden, - legacy escape hatch for scripted callers, gated behind a small internal - allowlist (`crates/minimald/src/exec.rs`) that rejects anything outside it. - Task execs inherit the session's no-net/host-net mode, but an own-IP - session's task exec currently falls back to host networking; use an - interactive attach when the session's network identity matters. ## CI lane map diff --git a/crates/minimal/src/lib.rs b/crates/minimal/src/lib.rs index 97711ee87..0e486ffca 100644 --- a/crates/minimal/src/lib.rs +++ b/crates/minimal/src/lib.rs @@ -1797,9 +1797,7 @@ fn ensure_interactive_attach_tty(stdin_is_tty: bool) -> Result<(), anyhow::Error } else { bail!( "`min session attach` needs an interactive terminal, but stdin is not a TTY. \ - Run it from a terminal, or use the non-interactive escape hatch \ - `min session attach --command ` (a hidden flag, kept for scripted \ - callers) to run a single command." + Run it from a terminal." ) } } @@ -2696,7 +2694,7 @@ mod tests { .unwrap_err() .to_string(); assert!( - err.contains("not a TTY") && err.contains("--command"), + err.contains("not a TTY"), "expected an actionable non-TTY error, got: {err}" ); ensure_interactive_attach_tty(true).expect("a real terminal must pass the guard");