refactor(api): TOML 配置 SSOT、统一错误契约、Auth/事务加固与可观测性 (#33)

配置 SSOT(TOML + .env)
统一错误契约
Auth 与事务边界
Redis / Celery 可靠性:业务 Redis(DB/0)与 Celery broker/backend(DB/1)显式拆分;连接池、sync client
可观测性(OpenTelemetry + LGTM)
This commit is contained in:
Sully
2026-05-22 13:44:50 +08:00
committed by GitHub
parent f09ae248f9
commit 53e0065e3e
298 changed files with 15247 additions and 4344 deletions

View File

@@ -12,6 +12,7 @@ from app.agents.image_prompt.prompt_agent import PromptGenerationAgent
from app.core.config import settings
from app.core.logging import get_logger
from app.features.memoir.memoir_images.settings import MemoirImageSettings
from app.features.memoir.constants import memoir
logger = get_logger(__name__)
@@ -84,7 +85,7 @@ def get_image_prompt_orchestrator() -> ImagePromptOrchestrator:
try:
llm = LlmGateway().langchain_llm_for(LlmUseCase("image_prompt"))
except Exception as e:
if settings.image_prompt_fallback_disabled:
if memoir.image_prompt_fallback_disabled:
raise
logger.warning(
"ImagePromptOrchestrator LLM 初始化失败,使用确定性 fallback: {}",