fix(agent-team): thread lifecycle milestones + present the plan in Slack #54

Merged
amoussa1229 merged 1 commit from fix/agent-team-plan-presentation-threading into main 2026-06-23 20:44:54 +00:00
amoussa1229 commented 2026-06-23 20:43:01 +00:00 (Migrated from github.com)

Summary

A live /new-task (task 9bce78ad) produced and approved a plan, but the "✅ plan ready" notice (a) posted top-level in #agent-team instead of in the task thread, and (b) contained no plan to review. Two distinct bugs, both fixed here.

Changes

  1. Threading — run-team.py _build_notifiers exposed notify(message) with no thread_ts. The coordinator's _emit calls notify(message, thread_ts=root) → TypeError → _emit's fallback re-posts top-level. So every lifecycle milestone (plan-ready / parked / failed) landed unthreaded, even though the coordinator computes the task root ts. (The clarifier question threaded fine — it goes through notify_question/post_question, a different path.) The sink now accepts and forwards thread_ts into the chat.postMessage payload — build_slack_poster already forwards the key.
  2. Presentation — the plan-ready milestone was a bare one-liner. New Coordinator._summarize_plan posts a condensed plan (summary + numbered phase names; full step detail stays on the status dashboard) so the plan is reviewable in-thread.

Validation

  • Full agent-team suite: 1193 passed; ruff check + ruff format --check clean.
  • Diagnosed against the live ledger + the actual #agent-team Slack thread (milestone confirmed posted top-level with no plan body).

Tests

  • notify sink forwards thread_ts when set, and omits the key (not a broken arg) for top-level posts.
  • _summarize_plan: renders summary + numbered phase names, does NOT dump step detail (condensed), and falls back without crashing on a malformed plan.
  • plan-ready milestone threads under the task root (thread_ts == ROOT) AND carries the plan summary.

Notes

Per request: do not merge. Not yet deployed — once merged, redeploy via /sh-deploy-r720 (package-only change: coordinator.py + run-team.py, no new deps). Follows PR #53 (the crash fix) which is already live.

## Summary A live `/new-task` (task `9bce78ad`) produced and **approved** a plan, but the "✅ plan ready" notice (a) posted **top-level** in #agent-team instead of in the task thread, and (b) contained **no plan to review**. Two distinct bugs, both fixed here. ## Changes 1. **Threading** — `run-team.py` `_build_notifiers` exposed `notify(message)` with no `thread_ts`. The coordinator's `_emit` calls `notify(message, thread_ts=root)` → `TypeError` → `_emit`'s fallback re-posts **top-level**. So every lifecycle milestone (plan-ready / parked / failed) landed unthreaded, even though the coordinator computes the task root ts. (The clarifier *question* threaded fine — it goes through `notify_question`/`post_question`, a different path.) The sink now accepts and forwards `thread_ts` into the `chat.postMessage` payload — `build_slack_poster` already forwards the key. 2. **Presentation** — the plan-ready milestone was a bare one-liner. New `Coordinator._summarize_plan` posts a **condensed** plan (summary + numbered phase names; full step detail stays on the status dashboard) so the plan is reviewable in-thread. ## Validation - Full agent-team suite: **1193 passed**; `ruff check` + `ruff format --check` clean. - Diagnosed against the live ledger + the actual #agent-team Slack thread (milestone confirmed posted top-level with no plan body). ## Tests - `notify` sink forwards `thread_ts` when set, and omits the key (not a broken arg) for top-level posts. - `_summarize_plan`: renders summary + numbered phase names, does NOT dump step detail (condensed), and falls back without crashing on a malformed plan. - plan-ready milestone threads under the task root (`thread_ts == ROOT`) AND carries the plan summary. ## Notes Per request: **do not merge.** Not yet deployed — once merged, redeploy via `/sh-deploy-r720` (package-only change: `coordinator.py` + `run-team.py`, no new deps). Follows PR #53 (the crash fix) which is already live.
This repo is archived. You cannot comment on pull requests.
No description provided.