Commit 2b73afa
authored
🤖 Harden auto-continue idempotency: requestId guard + backend dedupe (#344)
## Why another fix?
Message-ID guard reduced duplicates but users still observed rare
double-sends.
Root cause in those cases: two distinct summary messages were created
for
one compaction-run (different IDs) due to duplicated completion signals
(delete + message + final bump, reconnect/replay, or abort/accept
flows).
## What changed
- Add requestId to compaction-result metadata (source compaction-request
user msg)
- WorkspaceStore: dedupe performCompaction by compaction-request id
- useAutoCompactContinue: guard on requestId when present, fallback to
message id
- Fix retry cleanup to remove the correct guard key
## Why this is obviously correct
- A compaction-run is uniquely identified by the compaction-request user
message ID
- We now:
- Perform compaction only once per requestId (store-level dedupe)
- Send continue only once per requestId (hook-level idempotency)
- If requestId is missing (unexpected), fallback to summary message id
(still safe)
## Testing notes
- Run repeatedly, interrupt/retry, and force reconnection
- Expect exactly one continue send per compaction-run
_Generated with _1 parent f59e17c commit 2b73afa
File tree
3 files changed
+32
-16
lines changed- src
- hooks
- stores
- types
3 files changed
+32
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
| |||
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | | - | |
43 | 40 | | |
44 | 41 | | |
45 | 42 | | |
| |||
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 59 | | |
69 | 60 | | |
70 | 61 | | |
71 | 62 | | |
72 | 63 | | |
73 | 64 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
| |||
86 | 84 | | |
87 | 85 | | |
88 | 86 | | |
89 | | - | |
| 87 | + | |
90 | 88 | | |
91 | 89 | | |
92 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
420 | 423 | | |
421 | 424 | | |
422 | 425 | | |
| |||
430 | 433 | | |
431 | 434 | | |
432 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
433 | 447 | | |
434 | 448 | | |
435 | 449 | | |
436 | 450 | | |
437 | 451 | | |
438 | 452 | | |
439 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
440 | 457 | | |
441 | 458 | | |
442 | 459 | | |
| |||
544 | 561 | | |
545 | 562 | | |
546 | 563 | | |
547 | | - | |
| 564 | + | |
548 | 565 | | |
549 | 566 | | |
550 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
0 commit comments