Add smart loop detection as a stop condition for agent execution. When the same tool call signature (name + input + output) appears more than 5 times within a 10-step window, the agent stops instead of running until context window exhaustion.