Commit 53f9f28
committed
Consolidate checkpoint creation to single location
Addresses @cte's feedback in PR #4840 comment:
- Remove existing logic that saves checkpoints AFTER changes in presentAssistantMessage.ts
- Consolidate checkpoint creation to askApproval function for file-editing tools
- Remove individual checkpoint calls from writeToFileTool, applyDiffTool, insertContentTool, and searchAndReplaceTool
- Handle special case for multiApplyDiffTool batch operations
- Maintains fix for #4827: checkpoints are created BEFORE file modifications
This reduces code duplication and centralizes checkpoint logic in a single place.1 parent 7bdc7fd commit 53f9f28
File tree
7 files changed
+571
-30
lines changed- src/core
- assistant-message
- tools
7 files changed
+571
-30
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
292 | 303 | | |
293 | 304 | | |
294 | 305 | | |
| |||
521 | 532 | | |
522 | 533 | | |
523 | 534 | | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
| 535 | + | |
| 536 | + | |
533 | 537 | | |
534 | 538 | | |
535 | 539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 168 | + | |
172 | 169 | | |
173 | 170 | | |
174 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 143 | + | |
147 | 144 | | |
148 | 145 | | |
149 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
304 | 309 | | |
305 | 310 | | |
306 | 311 | | |
| |||
321 | 326 | | |
322 | 327 | | |
323 | 328 | | |
| 329 | + | |
324 | 330 | | |
325 | 331 | | |
326 | 332 | | |
327 | 333 | | |
328 | 334 | | |
329 | 335 | | |
| 336 | + | |
330 | 337 | | |
331 | 338 | | |
332 | 339 | | |
| |||
339 | 346 | | |
340 | 347 | | |
341 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
342 | 354 | | |
343 | 355 | | |
344 | 356 | | |
345 | 357 | | |
| 358 | + | |
346 | 359 | | |
347 | 360 | | |
348 | 361 | | |
349 | 362 | | |
350 | 363 | | |
351 | 364 | | |
352 | 365 | | |
| 366 | + | |
353 | 367 | | |
354 | 368 | | |
355 | 369 | | |
| |||
362 | 376 | | |
363 | 377 | | |
364 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
365 | 384 | | |
366 | 385 | | |
367 | 386 | | |
| |||
381 | 400 | | |
382 | 401 | | |
383 | 402 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
| 403 | + | |
389 | 404 | | |
390 | 405 | | |
391 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 229 | + | |
233 | 230 | | |
234 | 231 | | |
235 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 215 | + | |
219 | 216 | | |
220 | 217 | | |
221 | 218 | | |
| |||
0 commit comments