psmux: task window name starting with '-' creates no window; session reads as crashed
维护者通常 1 天内回复
评估
调研方向
从 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_namestill returnstask_id[-40:]) - psmux 3.4.0, Windows 11, adapter
claude
- 主要语言
- Python
- 星标
- 196
- 派生
- 78
- 平均合并
- 9 小时 24 分钟
- 30 天内合并 PR
- 44
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bmad-code-org/bmad-loop 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
bmad-code-org/bmad-loop#1063 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
bmad-code-org/bmad-loop#1057 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
bmad-code-org/bmad-loop#973 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
bmad-code-org/bmad-loop#965 ·
维护者通常 1 天内回复
-
TeA plugin: consume scoped gate artifacts from TeA 4.6.1可能已有人在做 @muratkeremozcan 于 5 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
bmad-code-org/bmad-loop#1065 ·
维护者通常 1 天内回复
查看 bmad-code-org/bmad-loop 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
TigreGotico/orthography2ipa#2950 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
Unstructured-IO/unstructured#4876 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
openfoodfacts/openfoodfacts-python#579 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 90/100
fairagro/m4.2_sql_to_arc#388 ·
维护者通常 1 天内回复