Skip to content

Enhancement: latch teammate_idle.py force-path to emit once per threshold-crossing (reduce idle-ping noise on kept-alive teammates) #1026

Description

@michael-wojcik

Summary

The TeammateIdle handler (hooks/teammate_idle.py) re-emits its shutdown-suggestion systemMessage to the lead on every idle tick once a teammate's idle count crosses the force threshold (≥5) — until the lead acts. For a fleet of completed-but-not-yet-shut-down teammates (the normal state during a long review, where the protocol keeps reviewers alive until merge), this produces one ping line per teammate per idle cycle — a steady flood in the lead's stream.

This is not a bug — the escalation is deliberate and documented (livelock-safe threshold escalation). It's a noise-reduction enhancement.

Evidence

  • hooks/teammate_idle.py:53 + :344 — defines + emits the [System idle notification — no response needed] systemMessage (the only source of that literal).
  • hooks/teammate_idle.py:271-275 — the force path: at idle-count ≥ force threshold, re-emits every subsequent tick until the lead acts.
  • hooks/teammate_idle.py:55-56 — suggest/force thresholds (3/5).
  • The raw TeammateIdle event cadence is platform-controlled (not reducible from the plugin); there is no plugin wake/re-delivery/poller, so the plugin cannot create idle→wake→idle churn — the only plugin contribution is this per-tick visibility amplification.

Proposed enhancement (ranked)

  1. Latch the force path (:271-275) to emit ONCE on first threshold-crossing instead of every tick. Kills the high-end per-tick amplification while preserving the one-shot suggest/force signal. Small, contained change.
  2. (Optional) Have the handler honor intentional_wait (it currently explicitly does not) so legitimately-parked teammates aren't counted toward idle-cleanup escalation.

Operational mitigation (today, no code)

Promptly shutdown_request completed teammates so they terminate before the tick-5 per-tick re-emit. The steady ping stream only persists while completed teammates are left alive — which the dual-channel review protocol does deliberately (reviewers persist until merge), so the latch (#1) is the better structural fix.

Context

Surfaced by an idle-ping audit during PR #1025 (the #1023 fix). Priority: LOW (noise/ergonomics, not correctness; self-resolves on teammate shutdown).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions