Skip to content

fix(orchestrate): launch-session.sh fail-fast input validation + zsh word-splitting docs (#123) - #125

Merged
choiyounggi merged 2 commits into
mainfrom
integ/issue-123
Aug 21, 2026
Merged

fix(orchestrate): launch-session.sh fail-fast input validation + zsh word-splitting docs (#123)#125
choiyounggi merged 2 commits into
mainfrom
integ/issue-123

Conversation

@choiyounggi

Copy link
Copy Markdown
Owner

Summary

Fixes #123launch-session.sh silently launched broken workers when a zsh
coordinator's word-splitting bug handed it malformed arguments. Scope A+B from
the issue (the optional launch-many wrapper C was excluded).

  • fix(orchestrate): three fail-fast input guards in launch-session.sh, all
    exiting 2 with a clear stderr message BEFORE any tmux session is created:
    • final session name (after the LO_RUN_ID suffix) must be non-empty and match [A-Za-z0-9_-]+
    • the worktree argument must be a git work-tree ROOT (rejects the .worktrees/ shared parent and repo subdirs; physical-path comparison so macOS symlinked tmpdirs don't false-reject)
    • LO_STATUS_DIR/LO_TASK_ID must be set together — exactly one set (including set-but-empty, the incident shape) is rejected instead of silently skipping status pre-seed
  • docs(orchestrate): SKILL.md paragraph after "Session knobs" warning that zsh does not word-split unquoted parameters (launch each task with its own explicit call, never a splitting loop) and stating the new exit-2 contract.

Tests

  • tests/launch-session.bats: 36 tests (8 new guard cases incl. the three incident shapes; existing invocations moved onto a git init work-tree fixture; the LO_STATUS_DIR-alone boundary test updated to the new exit-2 contract).
  • Full suite green locally: 631/631 bats tests, scripts.bats SKILL.md content guards included.
  • Live incident probes: space-containing name, .worktrees parent dir, and LO_TASK_ID="" all exit 2 with no tmux session created.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MQHKDLpk2drNwP147ZASKv

choiyounggi and others added 2 commits August 21, 2026 13:40
…ting a tmux session

Adds three fail-fast guards for issue #123's caller-bug shapes, all firing
before any tmux call: a session name outside [A-Za-z0-9_-]+ (a zsh
word-splitting bug can hand this a space-containing name), a worktree
argument that is not a git work-tree root (a shared parent directory or a
non-root subdirectory), and an LO_STATUS_DIR/LO_TASK_ID pair with exactly
one set (set-but-empty counts as unset — the incident's exact shape).

tests/launch-session.bats: adds a real git-worktree fixture, rewrites
existing worktree-arg invocations to use it, and adds normal/error/boundary
coverage per guard.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011PK2GZqRmjjctDv4A9X7vp
… calls

Issue #123 part B. Documents the root cause behind the incident (zsh does
not word-split unquoted parameters, unlike bash) and the exit-2 fail-fast
contract t1 shipped, so coordinators write per-task explicit
launch-session.sh calls instead of bash-style splitting loops.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKHgksH77r9sWW9cFHvhDY
@choiyounggi
choiyounggi merged commit e983295 into main Aug 21, 2026
2 checks passed
@choiyounggi
choiyounggi deleted the integ/issue-123 branch August 21, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant