Hello, i am not really sure that i understand what you are doing :)
My Workflow is: I generate the masterprompt, drag it into a fresh chat window in https://aistudio.google.com/ and use it with Gemini 2.5 Pro.
It has a large context window and i never came close.
How many tokens does your masterprompt_agent.txt when you drag it into ai studio?
You said you work on a level editor. Do you maybe have a scene with a tilemap? that can use a lot of tokens.
You can also open the Godot Ai Studio Settings, there you can see what it says how many tokens it will probably take and what file they come from. Maybe that can help you decide what to include and what to exclude.
Let me know if that helps. I am sure we can make it work for you.