[Feature] Agent Teams: enrich idle_notification with waiting context (background tasks, scheduled wakeups)

Open 💬 0 comments Opened Jun 10, 2026 by Butanium

Problem

A teammate's idle_notification carries only idleReason: "available". But "idle" conflates three states the team lead must treat completely differently:

  1. Waiting on a background job (e.g. a 15-minute pytest run) → leave them alone
  2. Finished but report undelivered → fetch their message
  3. Stalled / forgot to report → investigate

During a real overnight team session (lead + 2 teammates, web UI work), teammates emitted bare idle pings every turn-end while their test suites ran in the background. Distinguishing case 1 from case 3 cost either a transcript-reading subagent spawn (~50k tokens per check) or a check-in ping — which teammate guidance rightly discourages, and which #47930 shows can spiral into ack loops. The lead burned far more tokens disambiguating idleness than the notifications themselves cost.

Proposal

Enrich the idle_notification payload with the waiting context the harness already tracks:

{
  "type": "idle_notification",
  "from": "textpane",
  "idleReason": "waiting-on-background-task",
  "background_tasks": [
    {"description": "uv run pytest tests/ui/test_multiselect.py -q", "elapsed_s": 184, "output_file": "/tmp/.../b1f1jf4uy.output"}
  ],
  "scheduled_wakeups": [{"fires_at": "2026-06-10T06:12:00Z", "reason": "fallback while tests run"}]
}
  • idleReason becomes one of available | waiting-on-background-task | waiting-on-wakeup (the harness knows: the session's background-task registry and ScheduleWakeup queue are local state).
  • With zero in-flight work, today's bare available is unchanged — fully backward compatible.

The lead can then read case 1 directly from the notification (zero extra calls), and bare available + an unfinished task becomes a reliable "go look" signal.

Alternative considered (and built as a workaround)

A pull-style status tool (teammate_status(name) returning live state + in-flight background jobs + undelivered mail). We implemented this as a custom MCP server reading teammate transcripts — it works, but it's transcript-parsing from the outside; the harness owns this state and could expose it natively, and a push enrichment removes even the one extra call.

Related issues

  • #47930 — idle-notification/ack loops burning 13–22% of input tokens (cost side of the same gap)
  • #61959, #51557 — idle notification spam (closed); enrichment would make each ping informative rather than just less frequent
  • #48897 — team agent progress visibility (closed, stale); this is the minimal version scoped to the idle signal

---
🤖 Filed by Claude (Opus 4.5) during a live agent-teams session, on behalf of and reviewed-in-intent by Clément Dumas. (Co)-Authored-By: Claude <noreply@anthropic.com>

View original on GitHub ↗