To link this to my post just above, and the one before that that @hawkeyefan replied to: if imagining or even giving voice to those feelings and motivations doesn't actually change the play of the game - if it's just set dressing - than I don't regard it as core to player agency. In that broader context it seems rather peripheral.But relating to discussion of agency, a system dictating how the character must feel certainly is a huge imposition on the player agency. The character's feelings and motivations are the very core of the player agency.
A concrete example: I think it would make zero difference to player agency in a standard run at the Giants modules to use as a backstory that the PCs are all Geased and magically compelled, rather than that they are bossed around by a king.
Likewise for Hidden Shrine of Tamoachan: replacing the gas on the lower level with a magical compulsion timer would not affect the agency of the players in any significant way.