async def test_basic_idle_detection(self):
        """Test that idle callback is triggered after timeout when user stops speaking."""
        callback_called = asyncio.Event()

        async def idle_callback(processor: UserIdleProcessor) -> None:
            callback_called.set()

        # Create processor with a short timeout for testing
        processor = UserIdleProcessor(callback=idle_callback, timeout=0.1)  # 100ms timeout

        frames_to_send = [
            # Start conversation
            UserStartedSpeakingFrame(),
            UserStoppedSpeakingFrame(),
            # Wait 200ms - double the idle timeout to ensure it triggers
            SleepFrame(sleep=0.2),
        ]

        expected_down_frames = [
            UserStartedSpeakingFrame,
            UserStoppedSpeakingFrame,
        ]

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

        assert callback_called.is_set(), "Idle callback was not called"
Test that idle callback is triggered after timeout when user stops speaking.
tests/test_user_idle_processor.py