refactor(eval+memoir):精简内部评测路由与服务,composite/对话摘要与 judge 能力补强
- 访谈:新增 interview_state_hints,联动 orchestrator 与提示词 - 回忆录:story_pipeline_sync/state/memory/post_commit 与 Celery 任务调整 - 基建:开发用 celery broker、compose/development 脚本、依赖注入 - eval-web:移除数据集/实验/版本等页面与流式轮询,突出 Playground - 文档与单测同步
This commit is contained in:
@@ -289,10 +289,8 @@ def ingest_transcript_sync(
|
||||
)
|
||||
embedding_provider = None
|
||||
|
||||
# 向量写入与 enrichment 任一失败时,此前若在**同一事务内**已开始失败的 SQL,
|
||||
# 会导致 session 进入「必须 rollback」状态,进而让后续 commit 抛出
|
||||
# PendingRollbackError,污染 Celery 里共用的 `db`。
|
||||
# 用 SAVEPOINT 包一层:失败仅回滚本段,source/chunks 主体仍可由外层提交。
|
||||
# 向量写入在 SAVEPOINT 内;失败仅回滚本段,source/chunks 主体仍可由外层提交。
|
||||
# enrichment 已迁移到独立异步任务 (memory_enrichment_tasks.enrich_memory_source)。
|
||||
try:
|
||||
with session.begin_nested():
|
||||
if chunk_records and embedding_provider is not None:
|
||||
@@ -302,25 +300,29 @@ def ingest_transcript_sync(
|
||||
if emb:
|
||||
vectors_written += 1
|
||||
update_chunk_embedding_sync(session, chunk_id, emb)
|
||||
if settings.memory_enrichment_enabled:
|
||||
from app.features.memory.enrichment import (
|
||||
enrich_memory_after_ingest_sync,
|
||||
)
|
||||
|
||||
enrich_memory_after_ingest_sync(
|
||||
session, user_id, source.id, llm=None
|
||||
)
|
||||
enrichment_ok = True
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
"memory embedding/enrichment 跳过(sync): {} exc_type={}",
|
||||
"memory embedding 跳过(sync): {} exc_type={}",
|
||||
e,
|
||||
type(e).__name__,
|
||||
)
|
||||
if settings.memory_enrichment_enabled:
|
||||
enrichment_ok = False
|
||||
|
||||
session.commit()
|
||||
|
||||
if settings.memory_enrichment_enabled:
|
||||
try:
|
||||
from app.tasks.memory_enrichment_tasks import enrich_memory_source
|
||||
|
||||
enrich_memory_source.delay(user_id, source.id)
|
||||
enrichment_ok = True
|
||||
except Exception as e:
|
||||
enrichment_ok = False
|
||||
logger.warning(
|
||||
"memory enrichment 任务派发失败: {} exc_type={}",
|
||||
e,
|
||||
type(e).__name__,
|
||||
)
|
||||
|
||||
logger.info(
|
||||
"event=memory_ingest_done user_id={} conversation_id={} source_id={} "
|
||||
"chunks={} vectors_written={} embedding_available={} enrichment_enabled={} enrichment_ok={} sync=1",
|
||||
|
||||
Reference in New Issue
Block a user