diff --git a/agent/context_compressor.py b/agent/context_compressor.py index 6c177b9099..44d54d530c 100644 --- a/agent/context_compressor.py +++ b/agent/context_compressor.py @@ -906,15 +906,19 @@ The user has requested that this compaction PRIORITISE preserving all informatio or "does not exist" in _err_str or "no available channel" in _err_str ) + _is_timeout = ( + _status in (408, 429, 502, 504) + or "timeout" in _err_str + ) if ( - _is_model_not_found + (_is_model_not_found or _is_timeout) and self.summary_model and self.summary_model != self.model and not getattr(self, "_summary_model_fallen_back", False) ): self._summary_model_fallen_back = True logging.warning( - "Summary model '%s' not available (%s). " + "Summary model '%s' unavailable (%s). " "Falling back to main model '%s' for compression.", self.summary_model, e, self.model, )