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

Đang mở Phù hợp với người mới
#1,061 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@RECOHA đang làm issue này rồi.

Từ ngày 23/11/2026.

  • #1062 của @RECOHA — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
cli, tooling

Hướng nghiên cứu

Bắt đầu trong adapters/generic.py, nơi task_window_name trả về task_id[-40:] và đưa vào new-window -n (cũng kiểm tra đường dẫn attach để cả hai bên thống nhất về tên). Tái hiện bằng đoạn mã psmux trong issue: một tên bắt đầu bằng - không tạo ra cửa sổ và id rỗng. Hoàn tất trông giống như một tên đã được loại bỏ dấu gạch ngang ở đầu (với fallback khi kết quả rỗng) cộng với một kiểm thử đơn vị khẳng định tên được trả về cho task id ví dụ dài 52 ký tự.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Python
Star
196
Fork
78
Merge trung bình
9 giờ 24 phút
Pull request đã merge (30 ngày)
44

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bmad-code-org/bmad-loop

Tất cả issue của bmad-code-org/bmad-loop

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.