Commit f549eb6
feat(code): implement proper cancellation via CancellationToken
Replace AbortHandle with CancellationToken in SessionManager so that
cancel_operation() cooperatively cancels the streaming LLM loop via
tokio::select! instead of hard-aborting the task.
- ongoing_operations now stores CancellationToken instead of AbortHandle
- cancel_operation() calls token.cancel() for cooperative cancellation
- execute_streaming() returns the CancellationToken alongside the handle
- The streaming loop in call_llm uses tokio::select! to exit immediately
when the token is cancelled1 parent e2d0921 commit f549eb6
2 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1569 | 1569 | | |
1570 | 1570 | | |
1571 | 1571 | | |
1572 | | - | |
| 1572 | + | |
1573 | 1573 | | |
1574 | 1574 | | |
1575 | 1575 | | |
| |||
1604 | 1604 | | |
1605 | 1605 | | |
1606 | 1606 | | |
1607 | | - | |
| 1607 | + | |
1608 | 1608 | | |
1609 | 1609 | | |
1610 | 1610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
724 | | - | |
| 724 | + | |
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
| |||
0 commit comments