If the next encounter is [THING], whether you kick open the door or go down the hall, I don't think you really have agency.
Sure, that's true. A GM can always quantum ogre the situation and force certain outcomes. In such a case, agency may be taken away, but the illusion of it may remain. I'm not really a fan of that, and I think it's kind of a breach of play expectations.
I think these sorts of examples, divorced from any account of the goals and orientation of play, the processes of play and resolution, and other aspects of context, are almost meaningless as far as player agency is concerned.
If my character is a
hallmage (eg in Burning Wheel I am playing a spirit-binder who can summon and control the spirits of hallways; or in Cortex+ Heroic I am play a character with the Sorcery trait who has a SFX that augments all effects created by using sorcery while in a hallway) then the real action might be
getting my character into the hallway as opposed to
having my character lured through the door into a chamber.
If I am playing a D&D game where my PC is a dwarf giant-and-ogre slayer, and we are playing a more-or-less vigourously scene-framed game (which is eg what 4e D&D is probably best suited for), then the GM presenting an ogre as an opponent may be an honouring of player agency.
Now of course is we are playing an OSR/"skilled play" game then the GM is meant to stick to his/her notes. But even there there is the following possibility: as per advice given back in the day (eg by Lewis Pulsipher) the GM might have rolled wandering monster dice in advance, and have a list of pre-rolled wanderers for each dungeon level. So whether the PC goes through the door or down the hallway, the turn clock is checked, the GM notes that itis marked as one that brings a wanderer, and looks at his/her list of Level X wanderers and sees there's an ogre there. And so in the fiction the PC meets an ogre.
In such a case, the player has exactly the amount of agency s/he is meant to have in the game: s/he's decided where his/her PC goes in the dungeon. And the GM has done exactly what s/he is meant to do: namely, applied the time-keeping rules, the wandering monster rules, etc. The key decision point for the player (when wandering monsters are concerned) was not to go through the door or down the hall, but to press on through that dungeon level rather than to fall back to safety;.
This is just like the question about movement and teleportation: without context a particular event or a particular PC ability is not evidence of any particular degree of player agency in RPGing.