Repository navigation
Closed
Labels
Milestone
Description
Problem
Agents working this repo routinely spend large numbers of turns tight-polling for a condition that is already going to notify them. Two shapes recur across sessions:
- Waiting out
npm run local:gate(ornpm run validate). The gate takes several minutes, and the wait is spent on repeated no-opBashcalls, or on atail/grepof the gate log once per turn, until it finishes. - Waiting for a Copilot review to land on a PR.
gh api .../reviewsre-fetched in a loop of turns, one call per turn, until the round appears.
Observed live in a session on 2026-09-05 while working #2250: a full local:gate run was waited out with roughly 80 consecutive echo ok Bash calls, one per turn — while a completion notifier for that exact process was already armed and would have re-invoked the agent the moment it exited.
Why it matters
- It is strictly redundant. The harness re-invokes the agent when a backgrounded task exits. The poll delivers no information the notification would not have delivered anyway.
- It costs turns and tokens for nothing, and it pushes the actual work further from the top of the context window — in exactly the long sessions where that hurts most.
- It makes the transcript unreadable. The real verdict ends up buried under dozens of identical no-op turns, so a human reading back cannot find where the gate actually landed.
- It has already been learned and re-learned. There is a memory note titled "Don't poll when a monitor is armed" capturing precisely this. A convention living only in a memory (or only in a skill body) is the failure mode the repo's rules-vs-recipes split exists to prevent:
AGENTS.mdis loaded in full every turn and does not degrade, whereas a memory is per-user and a skill body can be dropped by auto-compaction mid-session.
Proposed fix
Not a mandate — the maintainer decides the final wording and shape.
- Add a short rule to
AGENTS.md, since that is the file loaded in full every turn. Roughly: when waiting on a long-running local process or a remote state change, arm a notifier and stop. Do not spend turns polling.- "Tell me when this finishes" → one notification: a backgrounded command (optionally wrapping an
untilloop that exits on the condition), or the completion notification of the backgrounded job itself. - "Tell me on each occurrence" → a
Monitor. - Never a per-turn no-op call, and never a per-turn re-read of a log.
- "Tell me when this finishes" → one notification: a backgrounded command (optionally wrapping an
- Reinforce it at the two places the wait actually happens, both of which already exist and are exactly where an agent is standing when it starts polling:
- the
pre-push-gateskill — waiting outlocal:gate; - the
pr-flowskill, step 8 — waiting for the Copilot review.
- the
- State the one genuine exception. External state the harness cannot observe (a CI run, a remote review queue) does need a poll — but the poll belongs inside a single backgrounded loop that exits on the condition, not spread across turns.
Acceptance
-
AGENTS.mdcarries the rule. -
pre-push-gateandpr-flowpoint at it, at the exact step where the wait happens. - The rule states the exception (external state the harness cannot observe) and says where the poll belongs when one is genuinely needed.
Activity
cliffhall commentedon Sep 5, 2026
Triage: Priority Medium (total 6)
bug; no engagement, assignee, parent epic, or reporter-setFields → Priority. The milestone bonus is deliberately not claimed — this issue was filed through the/issue-createflow, so it carries a milestone by construction, and counting it here would make the bonus a constant that discriminates nothing.Board: #28, Status
Todo, PriorityMedium(filed through the create flow, so filing it was the approval).docs: rule that a wait is a notification, never a tight poll loop (#2253
cliffhall commentedon Sep 6, 2026
Shipped in #2272, merged to
v2/main.AGENTS.mdcarries theWaiting on long-running workrule, andpre-push-gateandpr-flow§7 point at it at the step where the wait actually happens.