Commit dd6de1d
Fix script edit tools retrying non-idempotent commands during reload
When Unity enters domain reload after a script edit, the retry loop in
send_command_with_retry would re-send the identical edit command up to
40 times, duplicating insert_method/anchor_insert edits. Pass
retry_on_reload=False on all script-mutating send calls since the edit
lands on disk before the reload triggers.
Also fix _flip_async coroutine in apply_text_edits that was passed as a
threading.Thread target — the coroutine was never awaited. Replace with
asyncio.create_task so the sentinel reload flip actually executes.
Fixes CoplayDev#790
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent d2c2808 commit dd6de1d
File tree
2 files changed
+17
-4
lines changed- Server/src/services/tools
2 files changed
+17
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
326 | 329 | | |
327 | 330 | | |
328 | 331 | | |
| 332 | + | |
329 | 333 | | |
330 | 334 | | |
331 | 335 | | |
| |||
335 | 339 | | |
336 | 340 | | |
337 | 341 | | |
338 | | - | |
339 | | - | |
| 342 | + | |
340 | 343 | | |
341 | 344 | | |
342 | 345 | | |
| |||
354 | 357 | | |
355 | 358 | | |
356 | 359 | | |
357 | | - | |
| 360 | + | |
358 | 361 | | |
359 | 362 | | |
360 | 363 | | |
| |||
367 | 370 | | |
368 | 371 | | |
369 | 372 | | |
370 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
371 | 376 | | |
372 | 377 | | |
373 | 378 | | |
| |||
423 | 428 | | |
424 | 429 | | |
425 | 430 | | |
| 431 | + | |
426 | 432 | | |
427 | 433 | | |
428 | 434 | | |
| |||
452 | 458 | | |
453 | 459 | | |
454 | 460 | | |
| 461 | + | |
455 | 462 | | |
456 | 463 | | |
457 | 464 | | |
| |||
551 | 558 | | |
552 | 559 | | |
553 | 560 | | |
| 561 | + | |
554 | 562 | | |
555 | 563 | | |
556 | 564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
970 | 970 | | |
971 | 971 | | |
972 | 972 | | |
| 973 | + | |
973 | 974 | | |
974 | 975 | | |
975 | 976 | | |
| |||
1110 | 1111 | | |
1111 | 1112 | | |
1112 | 1113 | | |
| 1114 | + | |
1113 | 1115 | | |
1114 | 1116 | | |
1115 | 1117 | | |
| |||
1135 | 1137 | | |
1136 | 1138 | | |
1137 | 1139 | | |
| 1140 | + | |
1138 | 1141 | | |
1139 | 1142 | | |
1140 | 1143 | | |
| |||
1267 | 1270 | | |
1268 | 1271 | | |
1269 | 1272 | | |
| 1273 | + | |
1270 | 1274 | | |
1271 | 1275 | | |
1272 | 1276 | | |
| |||
1356 | 1360 | | |
1357 | 1361 | | |
1358 | 1362 | | |
| 1363 | + | |
1359 | 1364 | | |
1360 | 1365 | | |
1361 | 1366 | | |
| |||
0 commit comments