From dfe8883f12e389181e257084d27a2de10f7b3abf Mon Sep 17 00:00:00 2001 From: garrytan Date: Sun, 1 Nov 2026 18:02:55 +0000 Subject: [PATCH] fix(skill-start): --render with any value but unattended is refused (GST-825 fix-check) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- bin/gstack-skill-start | 9 +++++---- test/session-kind-render.test.ts | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/gstack-skill-start b/bin/gstack-skill-start index 86b7f0fd5..6a618e150 100755 --- a/bin/gstack-skill-start +++ b/bin/gstack-skill-start @@ -41,14 +41,15 @@ SKILL_NAME="" MODEL_OVERLAY="none" PARENT_PID="" BRAIN_HEALTH="no" -RENDER_KIND="none" +RENDER_KIND="" +RENDER_SET="no" while [ $# -gt 0 ]; do case "$1" in --skill) SKILL_NAME="$2"; shift 2 ;; --model) MODEL_OVERLAY="$2"; shift 2 ;; --parent-pid) PARENT_PID="$2"; shift 2 ;; --brain-health) BRAIN_HEALTH="yes"; shift ;; - --render) RENDER_KIND="${2:-}"; [ $# -ge 2 ] && shift 2 || shift ;; + --render) RENDER_SET="yes"; RENDER_KIND="${2:-}"; [ $# -ge 2 ] && shift 2 || shift ;; -h|--help) echo 'Usage: gstack-skill-start --skill NAME [--model OVERLAY] [--parent-pid PID] [--brain-health] [--render unattended]' echo 'Starts a skill session and prints its STATUS lines. --help starts nothing.' @@ -57,8 +58,8 @@ while [ $# -gt 0 ]; do esac done [ -n "$SKILL_NAME" ] || SKILL_NAME="unknown" -case "$RENDER_KIND" in - none|unattended) ;; +case "$RENDER_SET:$RENDER_KIND" in + no:|yes:unattended) ;; *) echo "gstack-skill-start: --render takes unattended (got '$(printf '%s' "$RENDER_KIND" | tr -cd 'a-zA-Z0-9._-')')" >&2; exit 2 ;; esac diff --git a/test/session-kind-render.test.ts b/test/session-kind-render.test.ts index 5baf32933..2ea0e23a5 100644 --- a/test/session-kind-render.test.ts +++ b/test/session-kind-render.test.ts @@ -182,6 +182,7 @@ describe('gstack-skill-start --render unattended', () => { const bad = start(['--render', 'interactive']); expect(bad.status).toBe(2); expect(bad.stderr).toContain("--render takes unattended (got 'interactive')"); + expect(start(['--render', 'none']).status).toBe(2); const bare = start(['--render']); expect(bare.status).toBe(2); expect(bare.stderr).toContain("--render takes unattended (got '')");