We propose a versatile dynamic optical-field manipulator using a coherently prepared atomic medium. We show that by locking the pump power change with the two-photon detuning, a π-phase shifting can be realized with unit probe fidelity in a broad two-photon detuning range. The two-photon-insensitive π-phase-shift mode with significantly reduced fluctuation makes this scheme an attractive system for low-noise phase-gate operations.