async def test_idle_retry_callback(self):
        """Test that retry count increases until user activity resets it."""
        retry_counts = []

        async def retry_callback(processor: UserIdleProcessor, retry_count: int) -> bool:
            retry_counts.append(retry_count)
            return True  # Keep monitoring for idle events

        processor = UserIdleProcessor(callback=retry_callback, timeout=0.4)

        frames_to_send = [
            # Start conversation
            UserStartedSpeakingFrame(),
            UserStoppedSpeakingFrame(),
            # Wait for first idle timeout (count=1)
            SleepFrame(sleep=0.5),
            # Wait for second idle timeout (count=2)
            SleepFrame(sleep=0.5),
            # User activity resets the count
            UserStartedSpeakingFrame(),
            UserStoppedSpeakingFrame(),
            # Wait for new idle timeout (count should be 1 again)
            SleepFrame(sleep=0.5),
        ]

        expected_down_frames = [
            UserStartedSpeakingFrame,
            UserStoppedSpeakingFrame,
            UserStartedSpeakingFrame,
            UserStoppedSpeakingFrame,
        ]

        await run_test(
            processor,
            frames_to_send=frames_to_send,
            expected_down_frames=expected_down_frames,
        )

        assert retry_counts == [1, 2, 1], f"Expected retry counts [1, 2, 1], got {retry_counts}"
Test that retry count increases until user activity resets it.
tests/test_user_idle_processor.py