Root cause: ensure_structured_column() executed a synchronous blocking engine.connect().execute(SELECT information_schema.columns ...) inside the async request path (_build_chat_history / _maybe_compress_history), freezing the uvicorn event loop and hanging all endpoints (~200s, recovered only by docker restart). Fix: - chat_context.py: remove per-request ensure_structured_column() calls; run once idempotently at app startup (main.py lifespan). Use CURRENT_DATABASE() for PostgreSQL compatibility. - main.py: add startup-only ensure_structured_column() hook (try/except). - llm_client.py: trust_env=False + bounded httpx.Timeout/wait_for so broken endpoints fail fast instead of hanging the event loop. - chat_service.py: run media generation in a background daemon thread with its own event loop (_launch_media_task_bg) so SSE end does not cancel image/video tasks (#811); remove TEMP faulthandler diagnostic. Safe-align: persist accumulated live container changes (admin/*, knowledge, market, models, config, observability, mcp_client, platform_knowledge, im_bot_platform, chat_media, capability_registry, requirements) and add workflow_templates. Verified: live failover test (model-006 -> conn-refused) returns in ~1.9s with concurrent login 0.83s/200; event-loop responsiveness restored (sub-second).
32 lines
705 B
Plaintext
32 lines
705 B
Plaintext
# AIFlow 后端依赖
|
|
fastapi==0.115.6
|
|
uvicorn==0.34.0
|
|
sqlalchemy==2.0.36
|
|
pymysql==1.1.1
|
|
cryptography==44.0.0
|
|
passlib[bcrypt]==1.7.4
|
|
python-jose[cryptography]==3.3.0
|
|
python-multipart==0.0.18
|
|
redis==5.2.1
|
|
pydantic==2.10.3
|
|
pydantic-settings==2.7.0
|
|
python-dotenv==1.0.1
|
|
httpx==0.28.1
|
|
aiofiles==24.1.0
|
|
celery==5.4.0
|
|
qrcode==8.2
|
|
pillow==12.2.0
|
|
xskill==0.5.2
|
|
|
|
# ---- pinned celery ecosystem (known-good, extracted from running container) ----
|
|
# 避免 pip 浮动解析到与 celery 5.4.0 冲突的新版传递依赖(如 click-repl 0.2.0 的 prompt-toolkit 冲突)
|
|
amqp==5.3.1
|
|
kombu==5.6.2
|
|
billiard==4.2.4
|
|
vine==5.1.0
|
|
click==8.4.2
|
|
click-didyoumean==0.3.1
|
|
click-plugins==1.1.1.2
|
|
click-repl==0.3.0
|
|
psycopg[binary]
|