deerflow2/.planning/phases/06-/06-06-SUMMARY.md

57 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
phase: 06-
plan: 06
subsystem: backend-middleware
tags: [uploads, mentions, context, gap-closure]
requires:
- phase: 06-05
provides: UAT gap diagnosis and closure plan
provides:
- 过滤 ref_kind=mention避免被识别为本次上传
- UploadsMiddleware 新增 mention 过滤回归测试
affects: [06-UAT, uploads-middleware, thread-context]
tech-stack:
added: []
patterns: [metadata-discriminator, middleware-guard-rail]
key-files:
created:
- .planning/phases/06-/06-06-SUMMARY.md
modified:
- backend/packages/harness/deerflow/agents/middlewares/uploads_middleware.py
- backend/tests/test_uploads_middleware_core_logic.py
key-decisions:
- "后端以 ref_kind=mention 作为强判定,明确将 mention 引用排除出 new_files。"
- "保留原有 filename/path/sync 行为,只做最小补丁以降低回归风险。"
requirements-completed: [ATREF-04]
duration: 12min
completed: 2026-04-15
---
# Phase 06 Plan 06: Mention/Upload Misclassification Fix Summary
修复了“提及文件被误判为本次上传文件”的核心问题:`additional_kwargs.files` 中 `ref_kind=mention` 条目现在不会进入 UploadsMiddleware 的 `new_files`
## Accomplishments
-`UploadsMiddleware._files_from_kwargs` 增加判定:`ref_kind == "mention"` 直接跳过。
- 新增两条回归测试:
- 纯 mention 条目应被完全过滤;
- mixed list 中真实 upload 保留、mention 过滤。
## Files Created/Modified
- `.planning/phases/06-/06-06-SUMMARY.md`
- `backend/packages/harness/deerflow/agents/middlewares/uploads_middleware.py`
- `backend/tests/test_uploads_middleware_core_logic.py`
## Verification
- 尝试执行:`cd backend && pytest -q tests/test_uploads_middleware_core_logic.py -k "mention or files_from_kwargs"`
- 环境结果:`pytest` 不可用(`python3 -m pytest` 报 `No module named pytest`
## Self-Check: PASSED (code) / PARTIAL (runtime)
- FOUND: mention 过滤逻辑已在 middleware 生效
- FOUND: 单测覆盖已补齐
- BLOCKED: 当前环境缺少 pytest未能本地运行后端测试