The loss of neurons in parafascicular thalamus (Pf) and of their inputs to dorsomedial striatum (DMS) are associated with Lewy body disease (LBD) and Parkinsons disease dementia (PDD) and have been linked to the effects of neuroinflammation. In rats, these inputs regulate the function of striatal cholinergic interneurons (CINs) that are necessary for the flexible encoding of the action-outcome (AO) associations for goal-directed action. We found that these inputs modify the encoding, not retrieval, of new AO associations and cause burst-pause firing of CINs in the DMS during AO remapping. These adaptive effects were abolished by neuroinflammation in the Pf, resulting in the loss of goal-directed control when the rats were required to update AO associations after a change in contingency. We found that the neuronal and behavioral deficits induced by inflammation in the Pf were rescued by administration of selegiline, a MAO-B inhibitor that we found also enhances ATPase activity in CINs, suggesting a potential treatment for cognitive deficits associated with inflammation affecting the function of midline thalamic nuclei and related structures.