fix: 收敛 Agent 会话队列与 worker 关闭 (#6386)

This commit is contained in:
InfinityPacer
2026-08-22 10:09:01 +08:00
committed by GitHub
parent 813ea77bc4
commit 1c07333909
6 changed files with 656 additions and 31 deletions
+7
View File
@@ -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)