Commit 19bceed
committed
fix: record cross-turn dedup synchronously before async send
Move recordDeliveredText() from the async post-delivery callback in
emitBlockReplySafely to the synchronous path in emitBlockChunk, before
the Telegram send. This closes the race window where context compaction
could trigger a new assistant turn while the delivery is still in-flight,
bypassing the dedup cache entirely.
Trade-off: if the send fails transiently the text remains in the cache,
but the 1-hour TTL ensures it won't suppress the same content forever.
This matches the synchronous recording already done in pushAssistantText.
Also fixes the hash comment: Math.imul + >>> 0 produce a 32-bit hash,
not 53-bit.
Addresses review feedback from greptile-apps.1 parent c1e5ad4 commit 19bceed
File tree
2 files changed
+9
-12
lines changed- src/agents
- pi-embedded-helpers
2 files changed
+9
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | 116 | | |
124 | 117 | | |
125 | 118 | | |
| |||
524 | 517 | | |
525 | 518 | | |
526 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
527 | 527 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | 528 | | |
532 | 529 | | |
533 | 530 | | |
| |||
0 commit comments