The code review loops while its background readers work: 18 min of "I keep running commands" #575

Open
opened 2026-11-20 16:28:32 -05:00 by cmoriarty · 0 comments
Owner

What happens
In run 204's agent.code-review, while two background reader subagents were working, the agent spent 17.8 minutes in a loop. It had 102 thoughts that each opened "I keep running commands. Let me stop. I'll end my turn here…", ran echo "waiting" 100 times, and wrote "I'll wait for the reader subagents…" 96 times. That came to 121 turns and about 73k output and reasoning tokens. The run still succeeded.

Why
Its thoughts show a conflict. It wants to wait by ending its turn, but it reads the brief's "Always end your turn with a short text message" as handing control back, and it doesn't trust that a background report will wake it. So it keeps making a tool call to stay busy.

Fix
Tell the agent, in the brief where it starts background helpers, that ending its turn is how it waits: each report arrives as a new message. If a wait without progress persists anyway, notice it in the engine.

Done when
A replay of run 204's step (./tools/replay.sh) ends its turn while the readers work, and carries on when their reports arrive.

Where to look: src/osf/pipeline/nodes.py (the end-your-turn rule, around line 1107), the code-review brief.

From run 204, 2026-11-20. Related: the code review waiting inside a helper call in run 195, braid#565.

**What happens** In run 204's `agent.code-review`, while two background reader subagents were working, the agent spent 17.8 minutes in a loop. It had 102 thoughts that each opened "I keep running commands. Let me stop. I'll end my turn here…", ran `echo "waiting"` 100 times, and wrote "I'll wait for the reader subagents…" 96 times. That came to 121 turns and about 73k output and reasoning tokens. The run still succeeded. **Why** Its thoughts show a conflict. It wants to wait by ending its turn, but it reads the brief's "Always end your turn with a short text message" as handing control back, and it doesn't trust that a background report will wake it. So it keeps making a tool call to stay busy. **Fix** Tell the agent, in the brief where it starts background helpers, that ending its turn is how it waits: each report arrives as a new message. If a wait without progress persists anyway, notice it in the engine. **Done when** A replay of run 204's step (`./tools/replay.sh`) ends its turn while the readers work, and carries on when their reports arrive. Where to look: `src/osf/pipeline/nodes.py` (the end-your-turn rule, around line 1107), the code-review brief. *From run 204, 2026-11-20. Related: the code review waiting inside a helper call in run 195, braid#565.*
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid#575
No description provided.