Commit c6a7a6c
committed
fix(client): resolve coroutine before gen-detection in _handle_chat
An `async def` chat_handler that returns an async (or sync) generator
resolved to a coroutine wrapping the generator; isasyncgen/isgenerator
ran against the raw coroutine (both False), and the single-shot path
then stringified the generator into `"<async_generator object …>"` as
the chat-response text. Await the coroutine up front so the gen
detection sees the real streaming source.1 parent 8b01aa0 commit c6a7a6c
1 file changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
356 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
357 | 365 | | |
358 | 366 | | |
359 | 367 | | |
| |||
408 | 416 | | |
409 | 417 | | |
410 | 418 | | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | 419 | | |
416 | 420 | | |
417 | 421 | | |
| |||
0 commit comments