Merge main and preserve dispatch backlog across monitor windows
Signed-off-by: Sy03 <1370724210@qq.com>
This commit is contained in:
commit
ea7de7e3de
769 files changed
+73802
-22805
No files matched your search
@@ -481,7 +481,22 @@ class AsyncOmniBase(OmniBase):
|
||||
if state is not None and rid not in delivered:
|
||||
queue = getattr(state, "queue", None)
|
||||
if queue is not None:
|
||||
await state.queue.put(self._synthetic_abort_output_message(rid))
|
||||
final_stage_id = getattr(state, "final_stage_id", None)
|
||||
if final_stage_id is None:
|
||||
final_stage_id = 0
|
||||
stage_metadata = getattr(self, "_stage_meta_list", ())
|
||||
final_output_type = (
|
||||
getattr(stage_metadata[final_stage_id], "final_output_type", None)
|
||||
if final_stage_id < len(stage_metadata)
|
||||
else None
|
||||
) or "text"
|
||||
await state.queue.put(
|
||||
self._synthetic_abort_output_message(
|
||||
rid,
|
||||
stage_id=final_stage_id,
|
||||
final_output_type=final_output_type,
|
||||
)
|
||||
)
|
||||
delivered.add(rid)
|
||||
for rid in request_ids:
|
||||
self._record_request_failure_once(rid, reason="client_abort")
|
||||
@@ -493,13 +508,18 @@ class AsyncOmniBase(OmniBase):
|
||||
logger.info("[AsyncOmni] Aborted request(s) %s", ",".join(request_ids))
|
||||
|
||||
@staticmethod
|
||||
def _synthetic_abort_output_message(request_id: str) -> OutputMessage:
|
||||
def _synthetic_abort_output_message(
|
||||
request_id: str,
|
||||
*,
|
||||
stage_id: int,
|
||||
final_output_type: str,
|
||||
) -> OutputMessage:
|
||||
"""Terminal abort OutputMessage used when the engine returned none."""
|
||||
engine_output = OmniRequestOutput(
|
||||
request_id=request_id,
|
||||
finished=True,
|
||||
stage_id=0,
|
||||
final_output_type="text",
|
||||
stage_id=stage_id,
|
||||
final_output_type=final_output_type,
|
||||
outputs=[
|
||||
CompletionOutput(
|
||||
index=0,
|
||||
@@ -514,7 +534,7 @@ class AsyncOmniBase(OmniBase):
|
||||
)
|
||||
return OutputMessage(
|
||||
request_id=request_id,
|
||||
stage_id=0,
|
||||
stage_id=stage_id,
|
||||
replica_id=None,
|
||||
engine_outputs=engine_output,
|
||||
metrics=None,
|
||||
|
||||
Reference in new issue
Block a user