The Ancient One (Tilda Swinton) from Doctor Strange should've known that Thanos (Josh Brolin) was collecting the Infinity Stones before he made his presence known. Marvel Studios had been teasing the arrival of the Mad Titan since Kenneth Branagh's Thor from 2011, but aside from several cameos to varying degrees, the Infinity Saga villain won't make his proper debut until Avengers: Infinity War. That said, the Ancient One had to be aware of what he was up to long before his attack on Earth.
Introduced in Scott Derrickson's Doctor Strange, the Ancient One was the Sorcerer Supreme leader of the Masters of the Mystic Arts. Exasperated from the lack of progress over the healing of his hands following his car accident, Stephen Strange (Benedict Cumberbatch) resorted to other ways in the hopes of regaining his ability to perform delicate surgeries. This led him to Kamar-Taj where he met the Ancient One. Despite her initial hesitation to take Strange as her student, the Ancient One eventually changed her mind and trained him.
While she didn't appear in the MCU until the 2016 film, the Ancient One was supposedly working behind the scenes in the Marvel universe for many years beforehand. Thanks to Avengers: Endgame's time heist which featured a revisit to the 2012 Battle of New York, it's revealed that the Ancient One was somehow helping against Loki (Tom Hiddleston) and the Chitauri's invasion, but in a low-profile manner, opting to only fend off flying villains who happened to be around the vicinity of the Sanctum Sanctorum. This alone is a questionable decision, considering that she and the other sorcerers are tasked to protect Earth from the very likes of Loki. But the idea that she may have very well known that the attack had something to do with Thanos' quest for the Infinity Stones makes her move all the more dubious, especially in regards to not providing any information of the bigger picture to any of Marvel's heroes.
As established in Infinity War, Doctor Strange and Wong (Benedict Wong) are aware of the Infinity Stones' existence. In the film, the pair eventually explained to Tony Stark (Robert Downey Jr.) and Bruce Banner (Mark Ruffalo) where the stones were from and how they function, ending with the revelation that Time Stone was in their possession. Given this, it's safe to assume that the Ancient One also knew all this, and perhaps even more considering the precognition powers that the Time Stone and the role of Sorcerer Supreme appear to provide. Couple that with that idea that she was tasked to monitor any threats to Earth, and it seems she must've known that Thanos was making moves to acquire all six Infinity Gems. Even if the Ancient One was unaware of what Thanos was up to before the events of The Avengers, what happens in this film alone should've piqued her interest about the matter, prompting her to at least look further into whether the other Infinity Stones were in safe hands.
Narrative inconsistencies like this are a result of Marvel Studios retroactively building their narrative, especially given how much the later MCU involves complex concepts like time travel and the alternate timelines created by it. While Kevin Feige and his team have been generally great in terms of world-building, the MCU is plagued with a string of micro-continuity issues because of something similar to what happened with the introduction of the Ancient One. Prior to Doctor Strange, the character was technically non-existent in the franchise, but they had to find a way to establish that she'd long been in the universe, only lurking in the shadows. This explanation could work had the circumstances been different, but given the Ancient One's supposed responsibility and ability to literally see into the future, there is little to suggest she shouldn't have been aware of the impending threat of Thanos, and little to support the fact she seemingly made no moves to protect the Earth from this danger.