Repository navigation
Conversation
RC13B on 157: detectActionLoop read the employee's five newest agent_actions rows. The heartbeat queued its own heartbeat_tick row first, and the detector returned "no loop" on any row that isn't a task or message write, so the circuit breaker never tripped. The MCP send_message tool's rows were not counted either. The detector now reads only the employee's writes (create_task, task_create, post_message, message_post, send_message), so queued work rows (heartbeat_tick, chat_mention, trigger_dispatch, task_assigned) can't hide a loop. It runs before the tick is queued: a looping employee is marked unhealthy, the turn is logged as skipped_unhealthy, and no tick is queued. Test: heartbeat-loop-detector-db (repeated messages after a tick, send_message, task titles, varied writes, fewer than five). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review finding (gpt-6.1-sol): after an owner or admin cleared the breaker (mark_healthy), the next heartbeat read the same five writes and tripped it again, so the employee could never recover. The detector now reads only writes after the employee's latest skipped_unhealthy turn. Test: trip, clear, heartbeat stays healthy and queues its tick; five new identical writes trip it again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The agent loop guard never tripped (RC13B on 157, medium). The guard is meant to mark an agent employee unhealthy when its last five task creations or chat posts repeat. It looked at the employee's five newest
agent_actionsrows. The heartbeat had just queued its ownheartbeat_tickrow, which isn't a write, so the guard said "no loop" every time. Rows from MCPsend_messageweren't counted either.Now the guard reads only the employee's writes:
create_task,task_create,post_message,message_postandsend_message. Queued work (heartbeat_tick,chat_mention,trigger_dispatch,task_assigned) can't hide a loop any more. The guard also runs before the tick is queued. A looping employee is marked unhealthy, its turn is logged asskipped_unhealthy, and it gets no new tick until an owner or admin clears the flag.Tests:
heartbeat-loop-detector-dbcovers:send_messagebehind achat_mention: trips;The three trip cases fail on master.
phase8-heartbeat-routingandprotected-agent-writersstill pass; the writer count for the handler stays at 7. CHANGELOG and the CLAUDE.md circuit-breaker sentence are updated. No local typecheck (laptop rule).Created with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code