Commit b16abe4
committed
fix: consolidated protocol robustness improvements
## Summary
This PR consolidates **2 protocol robustness improvements**.
### Included PRs:
- #84: Add buffer size limit to StreamProcessor
- #85: Add ToolState transition validation
### Key Changes:
- Added MAX_BUFFER_SIZE constant (10,000 events) for StreamProcessor
- Modified process() to drop oldest events when buffer is full
- Pre-allocated buffer capacity in new() for better performance
- Added can_transition_to() method to ToolState enum
- Updated update_tool_state to log warnings on invalid transitions
- Documented valid state machine transitions
### Files Modified:
- src/cortex-engine/src/streaming.rs
- src/cortex-protocol/src/protocol/message_parts.rs
Closes #84, #851 parent c398212 commit b16abe4
File tree
4 files changed
+60
-1
lines changed- src
- cortex-engine/src
- cortex-protocol
- src/protocol
4 files changed
+60
-1
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
213 | 217 | | |
214 | 218 | | |
215 | 219 | | |
216 | | - | |
| 220 | + | |
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
| |||
284 | 288 | | |
285 | 289 | | |
286 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
287 | 295 | | |
288 | 296 | | |
289 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
185 | 224 | | |
186 | 225 | | |
187 | 226 | | |
| |||
552 | 591 | | |
553 | 592 | | |
554 | 593 | | |
| 594 | + | |
| 595 | + | |
555 | 596 | | |
556 | 597 | | |
557 | 598 | | |
| |||
561 | 602 | | |
562 | 603 | | |
563 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
564 | 613 | | |
565 | 614 | | |
566 | 615 | | |
| |||
0 commit comments