He said Kaio had run out of cannabis two days before the attack, which had contributed to his state of mind along with depression and the relationship ending.
Those factors combined with Kaio's discovery of the text message from another man added to his "sense of worthlessness and panic at the imminent loss of the relationship".
Mr Galpin's medical report stated Kaio "acted out of intense anger" and "was driven by a motive of inflicting pain on the source of his emotional distress at the time".
The assault happened in Putaruru last year after Kaio, then aged 35, and his partner, 21, had separated.
The court file recorded that Kaio had been twice convicted of earlier assaults against the woman when she returned to the house they had shared to pick up some belongings. The visit allowed the couple's two children - who had each stayed with one parent - to spend time together, according to the court judgment.
During the evening, Kaio found a message on her cellphone which drove him to a rage - a message Mr Galpin later said led to the idea "his estranged partner ... had formed an intimate relationship with another party".
His partner tried to leave but was dragged back inside the house by her hair, where she was punched in the head and body until unconscious. The assault continued when she came around, with a phone charger cord tightened around her throat.
Kaio's partner suffered two black eyes, a broken nose and recurring nightmares from a "prolonged, vicious" assault during which she "feared for her life".
The original District Court trial found "no harmful pattern of alcohol or drug abuse", although prison authorities were told Kaio needed rehabilitation desperately.
But lawyer Rob Vigor-Brown took the case to appeal, arguing Kaio's drug abuse and mental health problems had not been considered.
The judges found Kaio smoked about three tinnies of cannabis a day and occasionally used P and Ecstasy.
"He admitted to irritability as a result of running out of marijuana a few days before offending," the judges found.
They found Kaio should have been sentenced to six years. "It is common knowledge that mental disorders are invariably exacerbated by drug use."
The judges warned that the case was an exception - the court would not usually review sentences after hearing psychiatric evidence.
National Addiction Centre director Professor Doug Sellman said three tinnies a day was "a huge amount" of cannabis.
"People who are using three tinnies a day have got past the point of using cannabis to get high. They are using cannabis to feel normal."
He said withdrawal would have created "intense irritability". The text message and depression would have "turbocharged" those feelings.