Commit 1b212bd
committed
fix(detoken,openai): unhang client on detoken init failure; map "error" to API error path
- detoken: on _add_new_group_req_index failure, set FINISHED_ERROR, push an
empty-string sentinel into out_tokens_queue at finish_token_index, mark
can_released_mark, and continue with the rest of the group instead of
re-raising. Without this the http loop stays blocked (queue empty, no
finish ever forwarded) and the shm req leaks until client disconnect.
- openai: surface FINISHED_ERROR as a controlled error response. Non-stream
chat / completions return HTTP 500; streaming chat / completions yield an
SSE error event followed by [DONE] and stop. Previously "error" leaked
into ChatCompletionResponseChoice / CompletionChoice whose finish_reason
literals reject it, raising Pydantic ValidationError.1 parent f184e8f commit 1b212bd
2 files changed
Lines changed: 59 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
78 | 91 | | |
79 | 92 | | |
80 | 93 | | |
| |||
355 | 368 | | |
356 | 369 | | |
357 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
358 | 374 | | |
359 | 375 | | |
360 | 376 | | |
| |||
473 | 489 | | |
474 | 490 | | |
475 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
476 | 501 | | |
477 | 502 | | |
478 | 503 | | |
| |||
882 | 907 | | |
883 | 908 | | |
884 | 909 | | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
885 | 913 | | |
886 | 914 | | |
887 | 915 | | |
| |||
916 | 944 | | |
917 | 945 | | |
918 | 946 | | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
919 | 956 | | |
920 | 957 | | |
921 | 958 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
72 | 79 | | |
73 | | - | |
74 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
75 | 89 | | |
76 | 90 | | |
77 | 91 | | |
| |||
83 | 97 | | |
84 | 98 | | |
85 | 99 | | |
86 | | - | |
| 100 | + | |
87 | 101 | | |
88 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
89 | 106 | | |
90 | 107 | | |
91 | 108 | | |
| |||
0 commit comments