File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
src/core/assistant-message Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,24 @@ export async function presentAssistantMessage(cline: Task) {
161161 case "write_to_file" :
162162 return `[${ block . name } for '${ block . params . path } ']`
163163 case "apply_diff" :
164- return `[${ block . name } for '${ block . params . path } ']`
164+ // Handle both legacy format and new multi-file format
165+ if ( block . params . path ) {
166+ return `[${ block . name } for '${ block . params . path } ']`
167+ } else if ( block . params . args ) {
168+ // Try to extract first file path from args for display
169+ const match = block . params . args . match ( / < f i l e > .* ?< p a t h > ( [ ^ < ] + ) < \/ p a t h > / s)
170+ if ( match ) {
171+ const firstPath = match [ 1 ]
172+ // Check if there are multiple files
173+ const fileCount = ( block . params . args . match ( / < f i l e > / g) || [ ] ) . length
174+ if ( fileCount > 1 ) {
175+ return `[${ block . name } for '${ firstPath } ' and ${ fileCount - 1 } more file${ fileCount > 2 ? "s" : "" } ]`
176+ } else {
177+ return `[${ block . name } for '${ firstPath } ']`
178+ }
179+ }
180+ }
181+ return `[${ block . name } ]`
165182 case "search_files" :
166183 return `[${ block . name } for '${ block . params . regex } '${
167184 block . params . file_pattern ? ` in '${ block . params . file_pattern } '` : ""
You can’t perform that action at this time.
0 commit comments