[BUG] #680 idle detector flags a session idle while a foreground subagent works

已关闭
#858 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #896 来自 @pbean —— 已合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
observability

调研方向

Start in src/bmad_loop/adapters/generic.py at _transcript_activity_key (around line 1750) and trace how the idle detector uses that activity key. Check how the Claude adapter locates session transcript directories; the issue proposes stat-only tracking of subagent *.jsonl files so profiles with usage_parser = "none" continue to work. Done means a growing subagent transcript prevents a false session-idle notice; run or add coverage for that behavior.

由索引模型根据 Issue 内容生成。

描述

Description

The #680 idle detector keys on the main session transcript only (_transcript_activity_key, src/bmad_loop/adapters/generic.py:1750, unchanged on main @ d09a324a6). Claude Code writes a subagent's turns to its own file, ~/.claude/projects/<project>/<session-id>/subagents/agent-*.jsonl. While a foreground subagent works, the parent transcript does not change, so the detector journals session-idle for a session that is busy.

Steps to reproduce
  1. Claude adapter, dev_stall_grace_s = 600.
  2. Run a story whose dev session hands a slice to a foreground subagent that works for more than 600 s.
  3. Read the run journal.
Expected behavior

No session-idle while any subagent transcript of the session is growing.

Actual behavior

From a real run (bmad-loop 0.13.1):

{"kind": "session-idle",   "task_id": "...-dev-1", "idle_s": 604.737, "threshold_s": 600.0, ...}
{"kind": "session-active", "task_id": "...-dev-1", "idle_s": 846.486, ...}

The session was running a foreground subagent for those 846 s. The notice is observability only, but it reads as a stuck session in the journal and the TUI.

Suggested fix

Fold the newest (mtime_ns, size) of <transcript dir>/<session-id>/subagents/*.jsonl into the activity key, stat-only, so usage_parser = "none" profiles keep working.

Environment

bmad-loop 0.13.1 (68645cb), Claude Code adapter, macOS.

主要语言
Python
星标
174
派生
72
平均合并
1 天 19 分钟
30 天内合并 PR
85

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bmad-code-org/bmad-loop 的其他 Issue

查看 bmad-code-org/bmad-loop 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。