commitRetryCount was being deleted in cleanupAgentState(), which runs before tryAutoCleanup() checks the count. This reset the counter to 0 on every cycle, making MAX_COMMIT_RETRIES=1 dead code. Agents would retry commits forever. Move commitRetryCount cleanup to stop()/delete() only, letting tryAutoCleanup() manage it during the retry lifecycle.