Developing supramolecular porous crystalline frameworks with tailor-made architectures from advanced secondary building units (SBUs) remains a pivotal challenge in reticular chemistry. Particularly for hydrogen-bonded organic frameworks (HOFs), construction of geometrical cavities through secondary units has been rarely achieved. Herein, a body-centered cubic HOF (TCA_NH4) with octahedral cages was constructed by a C3-symmetric building block and NH4+ node-assembled cluster (NH4)4(COOH)8(H2O)2 that served as supramolecular secondary building units (SSBUs), akin to the polynuclear SBUs in reticular chemistry. Specifically, the octahedral cages could encapsulate four homogenous haloforms including CHCl3, CHBr3, and CHI3 with truncated octahedron configuration. Crystallographic evidence revealed the cages served as spatially-confined nanoreactors, enabling fast, broadband photochromic effect associated with the reversible photo/thermal transformation between encapsulated CHI3 and I2. Overall, this work provides a strategy by shaping SSBUs to expand the framework topology of HOFs and a prototype of hydrogen-bonded nanoreactors to accommodate reversible photochromic reactions.