This paper extends the scattering theory of the Josephson effect to include a coupling of the Josephson junction to a gapless electron reservoir. By opening up the system with a quasiparticle escape rate $1/\tau$, the supercurrent carried at zero temperature by an Andreev level at energy $\varepsilon_A$ is reduced by a factor $(2/\pi)\arctan(2\varepsilon_A \tau/\hbar)$. The study compares this result with recent work on "non-Hermitian Josephson junctions", showing that the system is a simple example of such a junction. The paper discusses three applications: a quantum dot Josephson junction, a point contact Josephson junction, and a long SNS junction. In each case, the supercurrent is calculated and compared with theoretical predictions. The coupling to the electron reservoir introduces a dephasing mechanism that reduces the supercurrent. The paper also connects the results to the non-Hermitian Josephson effect, showing that the system's poles move into the complex plane, leading to complex eigenvalues of an effective non-Hermitian Hamiltonian. The results are compared with different generalizations of the current-phase relationship to complex eigenvalues. The paper concludes that the coupling to a gapless electron reservoir reduces the supercurrent through a Josephson junction, with the reduction factor depending on the Andreev level energy and the quasiparticle escape rate.This paper extends the scattering theory of the Josephson effect to include a coupling of the Josephson junction to a gapless electron reservoir. By opening up the system with a quasiparticle escape rate $1/\tau$, the supercurrent carried at zero temperature by an Andreev level at energy $\varepsilon_A$ is reduced by a factor $(2/\pi)\arctan(2\varepsilon_A \tau/\hbar)$. The study compares this result with recent work on "non-Hermitian Josephson junctions", showing that the system is a simple example of such a junction. The paper discusses three applications: a quantum dot Josephson junction, a point contact Josephson junction, and a long SNS junction. In each case, the supercurrent is calculated and compared with theoretical predictions. The coupling to the electron reservoir introduces a dephasing mechanism that reduces the supercurrent. The paper also connects the results to the non-Hermitian Josephson effect, showing that the system's poles move into the complex plane, leading to complex eigenvalues of an effective non-Hermitian Hamiltonian. The results are compared with different generalizations of the current-phase relationship to complex eigenvalues. The paper concludes that the coupling to a gapless electron reservoir reduces the supercurrent through a Josephson junction, with the reduction factor depending on the Andreev level energy and the quasiparticle escape rate.