You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: agents enter infinite post-work cleanup loop after completing primary task #1067
A spawned agent completed its primary work (~15 minutes, domain doc written and committed) but then entered an infinite loop of post-work hygiene operations — retrying history updates, decision file writes, and git commits for over 45 additional minutes (195 tool calls total) before being manually stopped.
The agent's actual deliverable was done and committed early on. The loop was entirely in the "AFTER work" phase (history.md updates, decision inbox writes, skill extraction attempts, git operations).
Observed behavior
Agent spawned with standard template (including AFTER work and RESPONSE ORDER blocks)
Primary task completed in ~15 minutes (domain doc written, committed)
Agent continued running for ~45 more minutes doing post-work hygiene
195 tool calls total before manual stop via stop_agent
No new meaningful work was produced after the first ~30 tool calls
Expected behavior
Agent should complete post-work hygiene quickly (5-10 tool calls) and terminate.
Suggested mitigations
Tool call hard cap in spawn prompts — e.g. ⚠️ HARD LIMIT: 80 tool calls. After 60, finish current task and stop. This gives the agent a budget it can self-enforce.
Strict separation of agent work from Scribe hygiene — The spawn template already delegates logging/decisions/commits to Scribe, but agents still have AFTER work instructions that overlap with Scribe's responsibilities. Making this exclusive (agent does ZERO post-work file ops, Scribe does ALL of it) would eliminate the loop trigger.
Platform-level timeout — A max_tool_calls or timeout parameter on the task tool would be the cleanest fix, but requires platform support.
Activity
restore git note as best-effort single attempt in two-layer mode
fix(coordinator): resolve externalized state, teamRoot, stale work, a…