Skip to content

fix(trajectory): export count=0 当 sourceDir 无 manifest — 回退定位汇聚库 (#58) - #59

Merged
dahai80 merged 1 commit into
mainfrom
fix/trajectory-export-count-zero
Aug 7, 2026
Merged

fix(trajectory): export count=0 当 sourceDir 无 manifest — 回退定位汇聚库 (#58)#59
dahai80 merged 1 commit into
mainfrom
fix/trajectory-export-count-zero

Conversation

@dahai80

@dahai80 dahai80 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

修复 #58

exportTrajectories 在 SFT/DPO/GRPO 三格式下返回 count=0

根因

ExportOptions.sourceDir 命名暗示"session 源目录",但语义实为"汇聚库目录"(manifest.json + raw/ 所在)。调用方按字面把 session 源目录传给 sourceDir 时,readManifest 找不到 manifest → loadAll 返回 [] → 三格式 count=0。

本地 CLI/测试因传对了目录(汇聚库)所以 11 pass,但 fusion-autotest 直接调 API 按字面传参 → 触发 bug。

修复

  • ExportOptions 新增可选 storeDir(汇聚库,优先使用)
  • exportTrajectoriesstoreDir > sourceDir > destDir 顺序解析首个含 manifest 的目录(resolveStore),不再静默返回空
  • loadAll 参数语义明确为 storeDir
  • 找不到 manifest 时打印明确日志(含三个候选目录)

测试

Closes #58

🤖 Generated with Claude Code

根因: ExportOptions.sourceDir 命名暗示 "session 源目录", 但语义实为
"汇聚库目录" (manifest.json + raw/ 所在)。调用方按字面传 session 源目录时,
readManifest 找不到 manifest → loadAll 返回 [] → 三格式 count=0。

修复:
- ExportOptions 新增可选 storeDir (汇聚库, 优先)
- exportTrajectories 按 storeDir > sourceDir > destDir 顺序解析首个含
  manifest 的目录 (resolveStore), 避免静默返回空
- loadAll 参数语义明确为 storeDir
- 新增 2 回归用例 (#58 场景 + storeDir 显式优先), 共 13 pass

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dahai80
dahai80 merged commit 053f6fc into main Aug 7, 2026
1 check passed
@dahai80
dahai80 deleted the fix/trajectory-export-count-zero branch August 7, 2026 10:16
@dahai80 dahai80 mentioned this pull request Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: 轨迹导出 SFT/DPO/GRPO 三格式返回 count=0

1 participant