Treat edit_file filler args as absent for mode selection - #535
Merged
TheGreatAxios merged 2 commits intoAug 23, 2026
Merged
Conversation
Models pad the unused mode's fields with fillers (old_string: "", start_line: 0), which made parseEditFileMode see both edit modes and reject the call; models then retried the identical call up to 8x (76% of gpt-5.6-terra edit_file calls in production traces). Mode selection now ignores fillers: line fields that are null, non-integer, or < 1 count as absent, and so does an empty old_string. A real mixed-mode call is still rejected (CL-4399), but the error now echoes the received values and names the fields to drop so a retry can differ, and the missing-mode error states what was received.
…e-identical-retry-loops Amp-Thread-ID: https://ampcode.com/threads/T-01a02c68-0d8d-777b-b717-81fb9a282023 Co-authored-by: Amp <amp@ampcode.com>
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.
Problem
Models pad the unused edit_file mode's fields with fillers —
start_line: 0,end_line: 0,old_string: "".parseEditFileModetreated any present line field as a line-range signal, rejected the call as "both edit modes", and models retried the identical call up to 8x. Production traces: 76% of gpt-5.6-terra edit_file calls rejected this way.Fix
old_string: ""likewise counts as absent.Fixes CL-6900