When the infestation starts in another unit
Yes, usually. Because cockroaches spread through shared walls and pipes, a building-wide problem is generally the landlord's responsibility to treat — even if the infestation started in another unit.
In apartment buildings, roaches do not respect boundaries. They move between units through the gaps around plumbing, outlets, and baseboards, which makes treating just one apartment nearly pointless. Landlords are typically expected to address the building as a whole, so the problem does not simply move next door and come right back.
If your landlord treats only your unit while ignoring the source next door, the infestation is likely to continue no matter how clean you keep your space. That ongoing failure can remain a habitability issue. If you suspect roaches are coming from a neighboring unit and the building is not being treated as a whole, a free review can help you understand what the landlord should be doing.
This is general information about California tenant rights, not legal advice. Every situation is different.