Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/kilo-app-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ concurrency:

permissions:
contents: read
pull-requests: read

jobs:
typecheck:
Expand Down
7 changes: 6 additions & 1 deletion .kilo_workflow/dispatch-role.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ fi
if [ "$ROLE" = "e2e-verifier" ] || [ -z "$CALLER_SESSION" ]; then
tmux new-session -d -s "$NAME" "$CMD"
else
tmux new-window -d -t "$CALLER_SESSION" -n "$NAME" "$CMD"
# Trailing colon pins the target to <session>:<auto-index>. Without it tmux
# prefix-matches the session name against WINDOW names first, and a session
# named <section> collides with the planner/orchestrator window named
# <section>-planner — new-window then fails with "create window failed:
# index N in use" (see learnings/tmux-new-window-index-in-use-name-prefix-collision.md).
tmux new-window -d -t "$CALLER_SESSION:" -n "$NAME" "$CMD"
fi
echo "$LOG"
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# tmux new-window fails "create window failed: index N in use" — session/window name prefix collision

Symptom: `dispatch-role.sh` (or any `tmux new-window -t <session> -n <name> ...`) fails with
`create window failed: index 1 in use` even though the session obviously has free window indexes.
Reproduced on tmux 3.7b: a plain `tmux new-window -d -t <session> -n probe "sleep 5"` fails the
same way while `-t <session>:2` (explicit index) and `-t <session>:` (trailing colon) both work.

Cause: tmux target parsing prefix-matches the target against **window names** before falling back
to the session. The workflow names sessions `<section>` and windows `<section>-<role>` /
`<section>-planner`, so `-t <section>` prefix-matches the planner window (index 1) and tmux tries
to create the new window *at that window's index*, which is taken. Runs whose session name differs
from every window-name prefix (e.g. session `kilo-dev-<section>`) never see it, which is why some
concurrent workflows kept working on the same server.

Fix: target `<session>:` (trailing colon = session with an empty window part → next free index),
which is unambiguous. `dispatch-role.sh` does this; keep the colon. If you hit the symptom
manually, use `-t <session>:` or an explicit free index. Diagnosis recipe: probe with
`tmux new-window -d -t <session> -n probe "sleep 5"`, then compare
`tmux list-windows -t <session> -F '#{window_index} #{window_name}'` for a window whose name
starts with the session name.
Loading