Opioid use disorder (OUD) affects more than 27 million people globally accounting for more than 300,000 deaths annually. Protracted abstinence among individuals with OUD is rare due to a high relapse rate among those not receiving medications for OUD. Extensive preclinical studies form the basis of the allostasis theory, which proposes long-lasting functional brain abnormalities that persist after opioid withdrawal and contribute to relapse. Few studies have tested the allostasis theory in humans using neuroimaging. Here, we used fMRI and an instrumental learning task to test allostasis theory predictions (ATP) of functional abnormalities in both positive valence (PVS) and negative valence (NVS) accumbens systems in OUD patients with protracted abstinence (n = 15), comparing them with OUD patients receiving methadone treatment (MT) (n = 33), and with healthy controls (n = 23). As hypothesized, protracted abstinence OUD patients showed incomplete recovery of nucleus accumbens function, as evidenced by the blunted response to aversive events (NVS) during negative reinforcement, as observed in MT patients. In contrast, their accumbens response to rewarding events (PVS) during positive reinforcement was similar to that of controls and different from that in MT patients whose response was blunted. Protracted abstinence OUD patients also showed improvements in depression symptoms compared to MT patients. Residual depressive symptoms and pre-MT intravenous drug measures were associated with worse accumbens function in protracted abstinence. These results support the ATP of long-lasting dysfunction of NVS after withdrawal and show preliminary evidence of recovery of PVS function with protracted withdrawal. Therapeutic strategies that target NVS may facilitate recovery.