Every agent has a limit on how much it can hold in one session, its context window, and you can think of it as the agent's desk for that session. Everything you typed, every page it read, and everything it wrote and did goes onto the desk, and the desk has an edge. The companies advertise how big the desk is, and the number keeps getting bigger. A bigger number helps, but in my experience it does not change the pattern: good at first, stupid near the end. Load a lot onto it, and it still gets confused.
Whatever the window is, I assume only the first seventy, maybe eighty percent of it really works. The intelligence in the last twenty or thirty percent of the context window is always stupid, in my experience. If the desk holds ten books, I plan for seven and treat the rest as gone.
Loading everything up front makes it worse. Load the whole requirement document, which says what the software must do, plus the test plan, every old test result and every bug report. By the time the agent has read all of that, thirty or forty percent of the window is already used, and it has not done one minute of work. Picture the desk as ten equal parts. Three or four are covered by what it read at the start, the last two or three are the stupid part, and your actual job happens on the three or four left in the middle.
Your agent was sharp for the first hour of a long session. In the third hour it tries a fix it already tried, and it forgets the naming rule you gave it at the start. Is it broken, tired, or full?
It is full. And by full I mean past the line, not at a hundred percent. It does not get tired, and it is not broken, because a fresh session would do the same work well. When the context limit is full, your agent is an idiot, and it is going to mess up your project. Do not push on. Ask it to write a short handover note into a file, saying what is done and what is next, then start a new session that reads that note and only what the next part of the job needs. Most agent tools show how full the window is, as a bar or a percentage. Watch where your own work starts to slip, and that is your line.