mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
fix: 收敛 Agent 会话队列与 worker 关闭 (#6386)
This commit is contained in:
@@ -13,6 +13,7 @@ from app.schemas.openai import AnthropicTextBlock as _SchemaAnthropicTextBlock
|
||||
from app.api.endpoints.openai import (
|
||||
MODEL_ID,
|
||||
_is_manager_unavailable,
|
||||
_is_manager_queue_full,
|
||||
_run_managed_agent,
|
||||
)
|
||||
from app.api.openai_utils import (
|
||||
@@ -246,6 +247,12 @@ async def messages(
|
||||
503,
|
||||
error_type="api_error",
|
||||
)
|
||||
if _is_manager_queue_full(exc):
|
||||
return _anthropic_error_response(
|
||||
str(exc),
|
||||
429,
|
||||
error_type="rate_limit_error",
|
||||
)
|
||||
return _anthropic_error_response(str(exc), 500, error_type="api_error")
|
||||
finally:
|
||||
await manager.clear_session(session_id=session_id, user_id=session_id)
|
||||
|
||||
Reference in New Issue
Block a user