However, this is typically solved by using a contributor licence agreement (CLA) where all contributors click through a form before submitting a PR where they declare that they own the copyright for the PR and they give a license for the organization to relicense the work and derivatives. Sometimes the whole copyright is transferred to the organization in these agreements.
I didn't check but according to some comments here the CLA in this case is already embedded into the AGPL license.
In principle this scheme guarantees that the original organization always has special rights over all of the open source community, as they can dual license all the derivative works.