Skip to content

fix(utils): remove unreachable dead code in find_legal_message_start#3719

Merged
Re-bin merged 1 commit into
mainfrom
fix-dead-code-3716
May 9, 2026
Merged

fix(utils): remove unreachable dead code in find_legal_message_start#3719
Re-bin merged 1 commit into
mainfrom
fix-dead-code-3716

Conversation

@chengyongru
Copy link
Copy Markdown
Collaborator

Summary

Removes unreachable dead code in nanobot/utils/helpers.py::find_legal_message_start.

The for loop at line 168 never executes because start is assigned i + 1 immediately before slicing messages[start : i + 1], which is always an empty list.

Fixes #3716

Test plan

  • Relevant agent tests pass (test_session_manager_history.py, test_runner.py)

The for loop at line 168 never executes because start is assigned
i + 1 immediately before slicing messages[start : i + 1], which
is always an empty list. Remove the dead code.

Fixes #3716
Copy link
Copy Markdown
Collaborator

@Re-bin Re-bin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ;)

@Re-bin Re-bin merged commit 73a8d8a into main May 9, 2026
2 checks passed
@Re-bin Re-bin deleted the fix-dead-code-3716 branch May 9, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Unreachable dead code caused by invalid list slice(无效列表切片导致的无法访问的死代码)

2 participants