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

Aperta Adatta ai principianti
#1,061 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@RECOHA ci sta già lavorando.

Dal 23/11/2026.

  • #1062 di @RECOHA — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
cli, tooling

Direzione di ricerca

Inizia in adapters/generic.py, dove task_window_name restituisce task_id[-40:] e alimenta new-window -n (controlla anche il percorso attach in modo che entrambi i lati concordino sul nome). Riproduci con lo snippet psmux nell'issue: un nome che inizia con - non produce alcuna finestra e un id vuoto. Fatto sembra un nome privato dei trattini iniziali (con un fallback quando il risultato è vuoto) più un test unitario che verifica il nome restituito per l'id del task di esempio di 52 caratteri.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Python
Stelle
196
Fork
78
Merge medio
9h 24m
PR unite (30g)
44

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bmad-code-org/bmad-loop

Tutte le issue di bmad-code-org/bmad-loop

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.