Skip to content

bug: /idd-verify 結束沒確認 teams 被關掉 — TeamDelete fails on idle-but-active reviewers + no cleanup SOP #70

@kiki830621

Description

@kiki830621

Problem

User observation, 2026-05-11 session:
「idd-verify結束知後好像沒有確認teams是不是有被關掉」
— surfaced after this session's /idd-verify --pr 58 (verify-pr58 team)

/idd-verify SKILL.md Step 0 Bootstrap TaskList 包含 launch_parallel_reviewers (TeamCreate + 5 Agent + Codex) 和 wait_for_claude_agents (wait until idle + read findings file),但 沒有 explicit cleanup step confirming the team is torn down after verify completes。

實際 session 觀察 (verify-pr58):

  • 5 reviewer agents 全部 idle + 寫完 findings file ✓
  • Codex CLI 完成 + master comment posted to PR ✓
  • TeamDelete 嘗試 → FAIL with: Cannot cleanup team with 5 active member(s): requirements, logic, security, regression, devils-advocate. Use requestShutdown to gracefully terminate teammates first.
  • SendMessage shutdown_request → 5 teammates ack (idle notifications) but don't send shutdown_response{approve:true} → team remained active
  • Subsequent TeamDelete 重試持續失敗,team 卡在 active state 持續到 session 結束

Type

bug (process gap in /idd-verify SOP)

Expected

/idd-verify Step 0 Bootstrap TaskList 應該有 explicit cleanup task (e.g. cleanup_team) after post_master_and_pointers + restore_working_tree:

TaskCreate(name="cleanup_team", description="Step 5.5 (NEW): SendMessage shutdown_request to all 5 reviewers, wait for shutdown_response approve, then TeamDelete. Fallback: if teammates don't respond within timeout, document active-team residue in final report (non-fatal) so user can manually TeamDelete next session.")

Either:

  1. Mechanical fix — SKILL.md adds Step 5.5 cleanup_team after restore_working_tree
  2. Documented fallback — if team cleanup is fundamentally async / unreliable in current Claude Code teammates protocol, document the limitation + provide manual TeamDelete retry hint

Actual

無 cleanup step in SKILL.md。Teammates 在 idle 但 active 狀態下殘留,user 必須:

  • 手動嘗試 TeamDelete (fail)
  • 手動 SendMessage shutdown_request to each (5 calls)
  • 手動 SendMessage 提示 teammate respond with shutdown_response (also no response)
  • 接受 team 殘留 + 等 session 結束 cleanup

Impact

  • Workflow friction: 跑完一次 /idd-verify 後 next TeamCreate (e.g. for /idd-verify on another PR) fails with "Already leading team 'verify-prXX'" — user must work around via subagent_type=general-purpose without TeamCreate (lost team coordination value)
  • Resource leak: 5 active teammates per verify run not cleanup → multi-verify session has 10/15/20 active teammates idling
  • SOP gap: any future skill author looking at /idd-verify SOP doesn't see cleanup pattern → likely repeated in other team-using skills

Related

  • Session evidence: verify-pr58 team cleanup attempt 2026-05-10 ~17:30 PST → 18:00 PST (multiple TeamDelete retries)
  • Similar pattern in /idd-verify --pr 67 / --pr 69 (current session) — same gap, but in those rounds Anthropic API limit blocked teammates anyway so issue was masked

Suggested investigation

  1. 確認 Claude Code teammates protocol: does shutdown_request actually require teammate to send shutdown_response{approve:true} or just respond at all?
  2. If yes → 為什麼 idle teammates didn't respond? (Are they actually receiving the request but not processing? Bug in agent loop?)
  3. Mechanical workaround: add timeout-based force-cleanup option to TeamDelete? Or rely on session-end cleanup?
  4. SKILL.md fix: add cleanup task to Step 0 Bootstrap regardless of underlying protocol limitations (best-effort + document fallback)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions