Refactor message optimization: extract helpers, consolidate diff extraction, add lint hooks#2554
Merged
hiroshinishio merged 2 commits intomainfrom Apr 19, 2026
Merged
Refactor message optimization: extract helpers, consolidate diff extraction, add lint hooks#2554hiroshinishio merged 2 commits intomainfrom
hiroshinishio merged 2 commits intomainfrom
Conversation
…action, add lint hooks
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
remove_outdated_file_edit_attempts.py(338 lines) into focused single-responsibility modules:detect_outdated_tool_ids.py,track_tool_use.py,extract_diff_result_file_path.py,remove_tool_pairs.py,remove_outdated_user_messages.py,remove_outdated_messages.pyextract_diff_file_path+extract_success_diff_file_pathinto one function with aDIFF_MARKERStablefile_tracking.pyforFilePosition,FileReadEntry,FILE_EDIT_TOOLStypesToolResultBlockParam,ToolUseBlockParam) with pyright discriminated union narrowing instead ofcastor baredictcheck_cast_usage.sh,check_private_functions.sh,check_partial_assertions.shSocial Media Post (GitAuto)
Refactored message optimization into single-responsibility modules
Social Media Post (Wes)
Spent a day splitting one giant function into six small ones. The function worked fine. But every time I touched it, I had to re-read 300 lines to find the part I needed. Now each piece is obvious. Boring refactor, faster future changes.