psmux: task window name starting with '-' creates no window; session reads as crashed

オープン 初心者向け
#1,061 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@RECOHA がすでに取り組んでいます。

2026年11月23日 から。

  • #1062 @RECOHA による — オープン

評価

難易度
1/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli, tooling

調査の方向性

adapters/generic.py から始めてください。ここで task_window_name は task_id[-40:] を返し、new-window -n に渡します(attach の経路も確認し、両側で名前が一致するようにしてください)。issue 内の psmux スニペットで再現してください。- で始まる名前ではウィンドウが作られず、id が空になります。完了の形は、先頭のダッシュを取り除いた名前(結果が空の場合のフォールバック付き)に加えて、例の 52 文字の task id に対して返される名前を検証するユニットテストがある状態です。

索引モデルが issue の本文から書いたものです。

説明

What happens

On Windows with the psmux backend, a dev/review session "crashes" a few seconds after launch with an empty log, and the run pauses with:

no work produced: dev session crashed (no completed turn or qualifying activity was observed — the CLI may be waiting on a human ...)

session-lifecycle.jsonl for the task shows an empty window id:

{"event": "pane-pin-failed", "window": "", "error": "TmuxError: psmux list-panes -t failed: psmux: no server running on session ''"}

Cause

The window is named with the last 40 characters of the task id (runs.task_window_name → task_id[-40:], used by GenericAdapter for new-window -n). When that slice starts with -, psmux parses the name as an option: new-window exits 0, prints nothing for -P -F, and creates no window. The empty id then reads as a crashed session.

Whether it hits depends only on the story key's length and where its dashes fall, so it is deterministic per story. In one sprint, 7 of ~30 story keys hit it on dev-N or review-N.

Repro (psmux 3.4.0)

$s = "t-$(Get-Random)"; psmux new-session -d -s $s "cmd /c ping -n 30 127.0.0.1 >nul"
psmux new-window -t "=${s}:" -n "abc-def-dev-1"  -P -F "#{window_id} #{pane_id}" "cmd /c ping -n 10 127.0.0.1 >nul"   # prints "@2 %2"
psmux new-window -t "=${s}:" -n "-abc-def-dev-1" -P -F "#{window_id} #{pane_id}" "cmd /c ping -n 10 127.0.0.1 >nul"   # prints nothing, exit 0
psmux kill-session -t $s

Example task id that triggers it: 3-2-aaaaaa-a-bbbbbbbbb-c-dd-eeeeeee-ff-ggggggg-dev-1 (52 chars; the 40-char slice begins with -).

Suggested fix

Strip leading dashes in task_window_name, so the adapter and attach stay consistent:

def task_window_name(task_id: str) -> str:
    return task_id[-40:].lstrip("-") or task_id

I applied the equivalent change locally on 0.13.2 (in adapters/generic.py) and the affected story launched normally.

Environment

  • bmad-loop 0.13.2 (also checked main: task_window_name still returns task_id[-40:])
  • psmux 3.4.0, Windows 11, adapter claude
主要言語
Python
スター
196
フォーク
78
平均マージ
9時間 24分
マージ済み PR(30日)
44

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bmad-code-org/bmad-loop のほかの issue

bmad-code-org/bmad-loop の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。