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

@@ -10,6 +10,7 @@ from app.features.memory.enrichment import enrich_memory_after_ingest_async
from app.features.memory.llm_schemas import EnrichmentPayload
from app.features.memory.models import MemorySource
from app.features.user.models import User
from app.features.memory.constants import memory
def test_enrichment_payload_roundtrip() -> None:
@@ -31,7 +32,7 @@ async def test_enrich_memory_after_ingest_async_single_llm_call(
) -> None:
from app.features.memory import enrichment as mod
monkeypatch.setattr("app.core.config.settings.memory_enrichment_enabled", True)
monkeypatch.setattr("app.features.memory.constants.memory.enrichment_enabled", True)
invoke_count = {"n": 0}
@@ -113,7 +114,7 @@ async def test_enrich_memory_skips_when_parse_returns_none(
) -> None:
from app.features.memory import enrichment as mod
monkeypatch.setattr("app.core.config.settings.memory_enrichment_enabled", True)
monkeypatch.setattr("app.features.memory.constants.memory.enrichment_enabled", True)
async def fake_run(*_args, **_kwargs):
return None