Messi is out of contract at the end of the season and has been heavily linked with Manchester City and Paris Saint-Germain.
The 33-year-old wanted to leave last season after the club finished without a trophy and he fell out with then-president Josep Maria Bartomeu.
Messi agreed to stay for the last year of his contract when Barca refused his request and has impressed under Koeman, scoring nine goals in his last 10 games.
But Koeman is not convinced a happier Messi this season will result in him remaining with the club for the long term.
"I'm not confident about that," Koeman said to The Athletic.
"I'm hopeful, yes, about this because he's still a great player and he's still winning matches for us, for the team.
"I'm enjoying being his coach, if you look at his qualities every day in the training sessions, it's incredible.
"Of course, he came as a young kid to Barcelona. And I still don't see Leo Messi in another shirt other than the Barca shirt."
Messi reached 650 Barca goals in Sunday's 2-1 home win over Athletic Bilbao.
After the match, Koeman said Barcelona "can't aspire to much" without Messi as he reflected on a leak by El Mundo which claimed the deal his captain signed in 2017 is worth more than €555million.
Koeman was thrilled to get the Barcelona job ahead of 2020-21 but reflected on how tough it had been to immediately handle the Messi saga, which was already under way and has raged on since.
"It was a difficult time because he's still the best player, but he was angry about some situations in the club," added Koeman.
"And he was not happy that he was in a team who lost 8-2 against Bayern Munich in the quarter-final of the Champions League.
"Of course, he was angry, he had to leave, he wanted to leave the team.
"First of all, what I said to the club was, 'OK, it's not my problem. It's a problem between the club and Leo Messi. And you have to resolve that'.
"Finally, the club said, 'We don’t make a transfer for him. He needs to stay'. It was a difficult time for Leo but he finally accepted it."
Koeman has not had any issues with Messi's attitude.
The former Netherlands head coach added: "I spoke to him in his house before we started the season and I made plans with him and he was really enthusiastic.
"I knew that he had some problems with the club and I was out of that.
"I said to Leo, 'I'm really happy if you stay. If you don't stay, it's your decision and it's what you have to handle with the club. If you stay, you will be part of the team and this will be your position to get all the best out of yourself'.
"Little by little, he accepted that situation. And look how he is playing in the last few weeks, he is really involved in the club, in the team.
"But nobody knows what will happen in the future."