def test_invalid_continuation_id_error(self, mock_redis):
        """Test that invalid continuation IDs raise proper error for restart"""
        from server import reconstruct_thread_context

        mock_client = Mock()
        mock_redis.return_value = mock_client
        mock_client.get.return_value = None  # Thread not found

        arguments = {"continuation_id": "invalid-uuid-12345", "prompt": "Continue conversation"}

        # Should raise ValueError asking to restart
        with pytest.raises(ValueError) as exc_info:
            import asyncio

            asyncio.run(reconstruct_thread_context(arguments))

        error_msg = str(exc_info.value)
        assert "Conversation thread 'invalid-uuid-12345' was not found or has expired" in error_msg
        assert (
            "Please restart the conversation by providing your full question/prompt without the continuation_id"
            in error_msg
        )
Test that invalid continuation IDs raise proper error for restart
tests/test_conversation_memory.py