fix: 稳定 RAG、合同模板搜索与页面质量检测 #8
Reference in New Issue
Block a user
Delete Branch "wren-dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
知识库配置管理和 RAG 对话页面此前会因后端 schema 检查重复执行 DDL 产生锁等待,表现为前端持续转圈或代理超时。同时合同模板模糊搜索在分类统计 SQL 中漏掉列表参数展开,PostgreSQL 会报
syntax error at or near "$2"。页面质量检测也需要使用 VLM 判定并覆盖异常分支。主要改动
asyncio.Lock,避免每次请求重复执行ALTER TABLE。lock_timeout,降低数据库锁等待对接口的影响。tenant_code IN $2语法错误。review,避免误判为通过。影响范围
/api/v3/rag/datasets/*、/api/v3/rag/apps*相关后端服务。/api/v3/contract-templates/search。测试
.venv/bin/pytest tests/test_contract_template_search.py tests/test_page_quality_vlm.py -q:4 passed。ContractTemplateServiceImpl().SearchTemplates(q="买卖"):返回total=3,无 SQL 语法错误。npm run lint:0 errors,存在项目历史 warning。node .codex-run/verify-rag-pages.mjs:知识库管理页和对话页均无转圈、无超时文案,相关接口 200。验收建议
买卖,确认接口返回 200 且结果、分类统计正常展示。/chat-with-llm/dataset-manager和/chat-with-llm/chat,确认页面不会持续转圈。pass/review/reject中的合法状态。fix: 稳定后端服务与结构比对链路to fix: 稳定 RAG、合同模板搜索与页面质量检测