Files
DeepTutor/tests/runtime
Hyeonsang Cho 3fab0de80d fix(runtime): cancel the capability when a turn's consumer stops (#1413)
`ChatOrchestrator.handle()` runs the capability in its own task and only
reads the bus, so a consumer that stopped reading never reached that
task. Pressing Stop persisted the turn as cancelled while the capability
kept calling the model and running tools until it finished on its own.
A capability parked on `ask_user` was never cancelled at all: once the
turn dropped its references it was destroyed mid-await, `_run`'s cleanup
failed before `unregister_bus`, and the turn's StreamBus stayed in the
registry for the life of the process.

Cancel and await the capability task in a `finally` around the
consumption loop, the same shape `llm.factory.stream()` already uses, so
both a cancelled consumer and a stream closed early take the capability
down with them. A normal turn is unaffected: its task has finished by
the time the loop ends.
2026-09-14 01:28:23 +08:00
..
2026-07-31 00:25:48 +08:00
2026-04-23 19:29:16 +08:00
2026-07-31 00:25:48 +08:00
2026-09-06 13:46:29 +08:00
2026-08-02 13:07:32 +08:00
2026-09-03 01:38:54 +08:00
2026-08-02 13:07:32 +08:00