File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -877,14 +877,18 @@ def try_fix_yaml(response_text: str,
877877 response_text_lines_copy [i ] = ' ' + line [1 :]
878878 modified = True
879879
880+ # normalize lines starting with '-'. Distinguish real YAML list items from diff deletions.
880881 for i , line in enumerate (response_text_lines_copy ):
881882 if not line .startswith ('-' ):
882883 continue
884+
883885 remainder = line [1 :]
884886 if line .startswith ('- ' ):
885887 second_char = remainder [1 ] if len (remainder ) > 1 else ''
886888 if second_char and second_char not in (' ' , '\t ' , '+' , '-' ):
887- continue
889+ continue # real list item → keep as-is
890+
891+ # treat it as a diff "removed" marker inside block content
888892 cleaned = remainder
889893 while cleaned and cleaned [0 ] in ('+' , '-' ):
890894 cleaned = cleaned [1 :]
You can’t perform that action at this time.
0 commit comments