fix: correct logger format args and -0 slice bug#13817
Merged
tofarr merged 1 commit intoOpenHands:mainfrom Apr 13, 2026
Merged
Conversation
1. set_title_callback_processor.py: The logger.warning call has two %s placeholders but only one argument (exc), causing a TypeError at runtime. Add url as the first positional argument. 2. recent_events_condenser.py: When tail_length is 0 (keep_first >= max_events), view[-0:] returns the entire list instead of an empty list. Guard with an explicit check so the slice is only taken when tail_length > 0.
aivong-openhands
pushed a commit
to aivong-openhands/OpenHands
that referenced
this pull request
Apr 15, 2026
devin-ai-integration Bot
pushed a commit
to OrpingtonClose/OpenHands
that referenced
this pull request
Apr 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two small but impactful bugs:
Bug 1 — Missing format argument in
logger.warning(set_title_callback_processor.py)The log call has two
%splaceholders but only passes one argument (exc), which causes aTypeErrorat runtime whenever theexceptbranch is hit:Bug 2 —
-0slice returns full list instead of empty (recent_events_condenser.py)When
keep_first >= max_events,tail_lengthbecomes0. In Pythonview[-0:]is equivalent toview[0:], which returns the entire list rather than an empty list. This silently defeats themax_eventscap:Test plan
RecentEventsCondenserwithkeep_first >= max_eventsreturns onlyhead(empty tail)