Under the borderline autoignition conditions experienced during cold-starting of diesel engines, the amount and composition of residual gases may play a deterministic role. Among the intermediate species produced by misfiring and partially firing cycles, formaldehyde (HCHO) is produced in significant enough amounts and is sufficiently stable to persist through the exhaust and intake strokes to kinetically affect autoignition of the following engine cycle. In this work, the effect of HCHO addition at various phases of autoignition of n-heptane-air mixtures is kinetically modeled. Results show that HCHO has a retarding effect on the earliest low-temperature heat release (LTHR) phase, largely by competition for hydroxyl (OH) radicals which inhibits fuel decomposition. Conversely, post-LTHR, the presence of HCHO accelerates the occurrence of high-temperature ignition. Experimentally, these effects are observed by high-speed imaging of combustion in an optically-accessible diesel engine run in skip-fire mode and fueled with JP-8, whose intake is doped with HCHO. The occurrence of LTHR is both retarded and reduced in magnitude, peak heat release rates are strongly attenuated and combustion efficiency decreases as intake HCHO fractions increase. The addition of HCHO results in a dramatic degree of yellow-orange luminous emission characteristic of soot production. Increases in swirl level and advances in injection timing were unable to compensate for the changes in heat release rates, combustion efficiency and sooty burning observed to result from HCHO addition.