Currently we have a placeholder for detecting a stuck scenario caused by repetitive failures to trim context windows: https://github.com/All-Hands-AI/OpenHands/blob/431d2c1f43354341819c6f1fda01a67c3a90ed62/openhands/controller/stuck.py#L336-L382
After #282 is addressed we can port the detection logic for this scenario.