返回 Bug 清单
BUG-0562project-52低已修复python-logic
connector_client dry_run 模式仍把事件文件移到 archive,无法重跑 dry_run
发现:2026-10-07验证:2026-10-27置信度:70%
症状
python connector_client.py --dry-run 第一次处理了所有 inbox 文件,第二次再跑 --dry-run 显示 inbox=0。需要手动把 archive 里的文件移回 inbox 才能重跑 dry_run。
根因
connector_client.py 的 process_one_event() 里 shutil.move(file_path, archive) 只在 not dry_run 分支里执行。但代码结构是 if not dry_run: ack; if not dry_run: move archive。两个条件独立判断,看起来没问题。但如果开发者改了条件或者 dry_run 时 handler 内部自己 move 了文件 → 下一次 dry_run 找不到原文件。另外 run_once() 开头 scan_inbox 扫不到 archive 的文件 → dry_run 第二次跑会打印 inbox=0 跳过所有事件。
修复方案
dry_run 模式绝对不能 move 文件、不能改 processed 集合。把 dry_run 的 archive/move 逻辑放到统一的 is_side_effect() 函数里判断。或者 dry_run 时把文件复制到 tmp 目录处理,处理完删除 tmp 副本。
错误签名
connector_client --dry-run second run: inbox=0 but archive has files技术信息
来源项目
project-52
涉及文件
scripts/connector_client.py → process_one_event()
标签
project-52, mcp-reported, source-agent