According to traditional views, perception deals with uncertainty using optimal strategies. For instance, when prior stimuli are more reliable than current ones, perception tends to give greater weight to the past, resulting in stronger serial dependence in perceptual decisions. Here, we challenge this view and reveal a systematic deviation from this strategy. We asked participants to reproduce the average orientation of an ensemble of stimuli, with the level of uncertainty manipulated by varying the ensemble variability. Surprisingly, we found that observers exhibited stronger serial dependence when prior stimuli were uncertain rather than reliable. To explain this pattern, we present an extension of the ideal observer model. In this model, uncertain events trigger internal states of the observer, such as expectations about moments of degraded sensory input, thereby modulating the tendency to integrate prior and current stimuli. The striking finding is that manipulation of these internal states through external feedback can lead to clear effects on serial dependence, even when the level of uncertainty in the stimulus remains constant. We propose that serial dependence reflects a 'state-dependent' mechanism that the brain amplifies to cope with moments of expected uncertainty.