# 附件自动关联后台任务 TODO - [x] 梳理当前前端内存任务断链原因。 - [x] 明确第一版边界:页面/会话退出可恢复,服务进程重启暂不承诺恢复。 - [x] 新增后端任务 schema。 - [x] 新增后端后台任务服务。 - [x] 新增任务创建和查询接口。 - [x] 补后端任务测试。 - [x] 新增前端任务 service。 - [x] 调整 AI 模式附件关联流程为创建后端任务。 - [x] 持久化消息里的 `attachmentAssociationJob`。 - [x] 历史会话恢复时继续轮询未完成任务。 - [x] 更新前端源码断言测试。 - [x] 容器内运行后端定向测试。 - [x] 运行前端定向测试和构建。 ## 验证记录 - `docker exec -w /app -e SERVER_VENV_DIR=/tmp/x-financial-server-venv x-financial-local-linux /tmp/x-financial-server-venv/bin/pytest -q server/tests/test_attachment_association_jobs.py server/tests/test_ocr_endpoints.py server/tests/test_reimbursement_endpoints.py::test_claim_item_attachment_upload_preview_and_delete server/tests/test_openapi_schema.py` - `node --test web/tests/workbench-ai-mode-switch.test.mjs web/tests/ai-attachment-association-model.test.mjs` - `npm --prefix web run build` - 已重启 `x-financial-local-linux`,并确认 `/api/v1/reimbursements/attachment-association-jobs/not-exist` 返回自定义任务失效提示。