The first "tangible" complaint that Carl Sargeant was inappropriately dealing with two women was made in the weeks before his death, heard an investigation.
The former community minister, 49, was found dead in November 2017, four days after being dismissed by Prime Minister Carwyn Jones.
AM Flillshire Laboratory denied accusations of inappropriate behavior toward women.
He left a letter telling his family that "we failed," his investigation was heard.
Matthew Greenough, chief councilor of the prime minister, said for the investigation in Ruthin, Denbighshire, that in 2016 there were two separate charges of inappropriate behavior, one by an anonymous letter received by Carwyn Jones saying that Mr Sargeant was not "women" .
The Prime Minister has made Mr Greenough aware of "an incident involving a woman."
However, in October 2017, the Special Advisor stated that there had been a first "tangible" complaint about Mr. Sargeant, made by David Hagendyk's former secretary general, the Labor Party.
He said that Mr. Hagendyk told him that accusations had been received that Mr. Sargeant had behaved inadequately to two women at a political event.
The survey found that women were known as Miss A and Miss B.
Mr Greenough spoke to the prime minister on the charges and then contacted Miss A. She disclosed the details of the allegations. He said that "he wanted to consider her options" on how to advance the issue.
He said the investigation, Miss A, asked "I will only discuss with the Prime Minister and no one else."
He said he had communicated the information about Mr. Jones's conversation. The Prime Minister, he said, believed that if the plaintiffs did not specifically want to make their formal complaint or put it in writing, then it was not a formal complaint.
The next day, Mr. Greenough contacted Miss B and talked about inappropriate behavioral charges. Both alleged incidents involving A and Miss B occurred in the summer of 2017.
Both names were subsequently given to the Prime Minister on October 26th.
The investigation has shown that during this time, the Prime Minister instructed him to contact another complainant, Miss C.
Mr Greenough said the Prime Minister still thought that something had to be written in order to treat it as a formal complaint.
Until 1 November, a written statement from Mrs A was received. No letter came from Miss B, but she was happy to be mentioned in Mrs A's statement. No written complaint was received from Miss C.
Prior to these events, Mr. Sargeant's name was in the context of a job movement when discussing a cabinet reshuffle, eventually the leader of the house.
Coroner John Gittings said, "I'm struggling a little with this because there are rumors … and yet his name is within the potential for what is a very important and responsible role."
Mr Greenough replied that the prime minister "has never been interested in rumors." He said the rumors in politics are profound and you simply can not "operate this way."
Mr Greenough, citing his manual notes in the meeting between Carwyn Jones and Mr Sargeant on 3 November, said Mr Sargeant was upset.
"He shook his head as Carwyn spoke and said he did not recognize what he was told," Greenough told the investigation.
He said that Mr Jones had informed Mr Sargeant that the matter could become public and that he should be "prepared" if that had happened. He also advised Mr. Sargeant that it was a "difficult moment".
Mr. Greenough said the Prime Minister offered advice to Mr. Sargeant, including to work with the party.
He added that the reshuffle was treated differently from the previous ones because "it was not appropriate" to inform the media about new meetings as would normally be the Welsh government.
The coroner said later that day that "the stakes were lifted" when Mr. Sargeant wrote on Twitter.
Mister. Greenough said the tweet was "along the lines" to lose its position being an agreed position, and the door to the government remained open in the future.
He decided to correct the inaccuracies "through a brief statement," he said.
Mr Greenough said he was surprised by Mr Sargeant's tweet because "at that time, there was much public information about reshuffle … the focus of the reporting media at that time was on reshuffling its whole ".
Phone records examined
Previously, the phone interviews survey is about to be examined after Mr. Sargeant's telephone call came out just a few hours before he died on Tuesday, November 7, 2017 did not come from the regular phone.
On Monday, Sophie Howe, the commissioner for future generations, who once worked as a special counselor for Mr Sargeant and was a friend, said the investigation had received an appeal from Mr. Sargeant at 7:30 am on the morning of his death and he thought maybe he was the last person to talk to him.
On the morning of Tuesday, the Prime Minister's lawyer asked Mrs Howe's phone records to be examined because there was no log of the appeal made by Mr Sargeant's usual number.
Cathy McGahey QC said: "Mrs Howe's proofs yesterday offer a good hint that she called her and still can not find the phone."
Ms. McGahey said it was "very likely" that it was a missing phone.
Coroner John Gittins has agreed with Sophie Howe's files.
"Emotional health is not right"
Leslie Thomas QC, who represented the Sargeant family, also asked for the audio broadcasting of Carwyn Jones interviews Monday, November 6, 2017, saying it was relevant because it could show "what might have been in the mind Mr Carl Sargeant on the morning of the seventh. "
The investigation has heard evidence from the government minister in the Ken Skates Gallery, who said he thought Carl Sargeant had suffered mental health problems for a long time.
Mr Skates' statement was read by the forensic counsel. Mr Skates said that Mr Sargeant "has not explicitly told me" that he has a mental state of health, but he has worked for himself.
Mister. Skates said: "As someone who had mental health problems in the past, I came to believe that Carl's emotional health was not right."
He said that Mr. Sargeant began to "ask me more and more" about his experiences.
He also said that Mr. Sargeant took over knitting to help "mindfulness".
Prime Minister "angry"
The investigation heard a statement from Steven Jones, a former special advisor and head of Carwyn Jones media.
He said he received a text message from Carl Sargeant on Friday, November 3, 2017, following re-mixing, who said, "Shit bad."
He said that when they spoke later, Mr. Sargeant told him that accusations of inappropriate behavior had been made, but he did not know what the accusations were or who he did.
Mister. Sargeant told her that Carwyn Jones told her "not to make public" about the accusations and that she would take care of her over the weekend. He took "them" to mean the Welsh government, Steven Jones told the investigation.
On November 8 – the day after Mr Sargeant's death – Mr Jones said he had gone to Carl Sargeant's district office, and Ken Skates was present. Mr. Jones said he asked Mr. Skates about Carwyn Jones' reaction to Mr. Sargeant, who made public.
He reported that Mr. Skates said that Carwyn Jones was "angry," using an expletive to accentuate.
The investigation also heard that Mr Skates sent an email to the lawyer, John Gittins, twice in November last year, challenging the accuracy of Steven Jones's statement.
He also thought he would not use the excerpts in the conversation with Steven Jones, which he said was not in his nature.
"Easy to Collaborate With"
Private secretary secretary secretary secretary of Sargeant, Imelda Francombe, described it as "very easy to work".
She said she had entrusted some of her mental health problems at the end of 2016 or at the beginning of 2017, saying she did not take her tablet late and felt "really blue."
She spoke with line manager Peter Greening about this conversation after making comments on Sargeant's diary, not very engaging because she did not want to have a negative impression on Mr. Sargeant.
After the reshuffle, he wrote it saying, "I'm sorry I left you, you were magic."
Asked by the forensic doctor if he ever witnessed any indication of Mr. Sargeant who had shown inappropriate behavior, she replied: "Absolutely, unequivocally, no."
Asked if she heard rumors, she replied: "Never."
Peter Greening confirmed that she had a conversation with Mrs. Francombe, but said that no one was asked to talk to her.
He was shocked to hear that Mr. Sargeant had health problems – he was "pretty sure" that the word depression was not used – because the AM was "very outgoing, sociable."
He said he changed the way he thought about Mr Sargeant's diary and did not share the conversation with the Prime Minister.
Mr Greening said he saw Mr Sargeant leaving the cabinet meeting after his reshuffle that saw him lose his post.
"He went to me … I could not say his behavior either he was upset … I really could not say," he told the court.
He also said that there was no support for the ministers to be removed from the knowledge, adding: "I think there are lessons to learn."
Asked by Leslie Thomas QC, Mr Greening said he has no qualifications in terms of employee welfare and has no professional experience in dealing with mental health.
Asked if his commentary on Sargeant's diary being "light" was a negative decision, he said, "I will never judge a minister's judgment." He said it is not his role to criticize ministers or to exert any negativity on the performance of a minister.
Asked what the sign of Mr. Sargeant was showing, he said, "It means that his workload is not as extensive as some of his cabinet colleagues." He added that a journal could be "easy" either because of the minister or his team.
Referring to Mr. Sargeant's disease, Thomas said: "You have not appreciated the nature or extent of the mental illness that would have affected Carl.
Mr Greening replied: "That's right."
Mr Thomas also asked whether Mr Greening would have come back to speak to Mrs. Francombe of Mr Sargeant's mental health once he knew that Mr Sargeant would lose his job in reshuffle which he could have done without to lose confidence.
Mister. Greening said: "No."
& # 39; Irresponsible & # 39;
On Monday, the court heard details of Mr Sargeant's death, including his hangover at Connah's Quay by his wife, Bernadette. The letter was found near his body.
He also heard evidence from former Minister Leighton Andrews, who called Carwyn Jones's behavior as a result of the "slaughter" of Mr Sargeant's hierarchy.
Sophie Howe described the court as how his health began to deteriorate in the summer of 2017, a few months before his death.
Mr. Sargeant had been treated for depression for many years before his death.
He had told him after they shot him: "I'm in a dark place."
Information and advice
If you or someone you know, struggles with the issues raised by this story, you find support through the BBC Action Line.