Commit e62ce42
fix: trim event buffer to newest bytes instead of discarding on overflow
When the SSE event buffer exceeds maxEventBufferRemainder, keep the
newest bytes rather than resetting entirely. This preserves the tail of
in-flight partial events (where usage data in JSON is most likely found)
instead of silently dropping them.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 2f357ce commit e62ce42
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
106 | | - | |
107 | | - | |
108 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
109 | 113 | | |
| 114 | + | |
110 | 115 | | |
111 | 116 | | |
112 | 117 | | |
| |||
0 commit comments