Hi, thanks for the great project!
In the shader code in tonemap.glsl, tonemap is applied to all pixels, which is not correct if a constant background color is desired. See the effects below:
Without tone mapping:

With tone mapping:

I think whether it is background can be recorded as the w component in pathTraceTexture. Maybe there are other better ideas?