From 408af4e012ab5a035c8dd20dac724519abc96243 Mon Sep 17 00:00:00 2001 From: Calvin Smith Date: Mon, 25 Aug 2025 13:59:41 -0500 Subject: [PATCH] fix: Extend cases where truncation triggers (#10607) Co-authored-by: Calvin Smith --- openhands/controller/agent_controller.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openhands/controller/agent_controller.py b/openhands/controller/agent_controller.py index ec88c707b5..d54238f3b9 100644 --- a/openhands/controller/agent_controller.py +++ b/openhands/controller/agent_controller.py @@ -895,8 +895,10 @@ class AgentController: 'contextwindowexceedederror' in error_str or 'prompt is too long' in error_str or 'input length and `max_tokens` exceed context limit' in error_str - or 'please reduce the length of either one' - in error_str # For OpenRouter context window errors + or 'please reduce the length of either one' in error_str + or 'the request exceeds the available context size' in error_str + or 'context length exceeded' in error_str + # For OpenRouter context window errors or ( 'sambanovaexception' in error_str and 'maximum context length' in error_str