OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Bug]: 使用llm-wiki进行文档处理,输入多篇内容,但生成的wiki数量只有1个

Open t00350320 opened this issue 1 month ago • 3 comments

Issue Origin

Observed or reproduced in a real environment

Bug Description

2026-10-10 04:32:02.282 | DEBUG | vikingbot.hooks.manager:register_path:44 - Registered hook '<vikingbot.hooks.builtins.openviking_hooks.OpenVikingCompactHook object at 0x7fdb188e6270>' for event 'message.compact' 2026-10-10 04:32:02.282 | DEBUG | vikingbot.hooks.manager:register_path:44 - Registered hook '<vikingbot.hooks.builtins.openviking_hooks.OpenVikingPostCallHook object at 0x7fdb188e6a50>' for event 'tool.post_call' 2026-10-10 04:32:10.550 | INFO | vikingbot.agent.loop:_run_agent_loop:1593 - [TOOL_CALL]: read_file({"path": "compile_resources/_manifest.tsv"}) 2026-10-10 04:32:10.550 | INFO | vikingbot.agent.loop:_run_agent_loop:1593 - [TOOL_CALL]: exec({"command": "find compile_resources/18feefa0-079e-4b42-ab13-2274fcd9960f -type f -name ".md" | sort"}) 2026-10-10 04:32:10.551 | INFO | vikingbot.sandbox.backends.direct:execute:38 - [Direct] Executing: 'find compile_resources/18feefa0-079e-4b42-ab13-2274fcd9960f -type f -name ".md" | sort' 2026-10-10 04:32:10.559 | INFO | vikingbot.sandbox.backends.direct:execute:89 - [Direct] Output: STDERR: find: 'compile_resources/18feefa0-079e-4b42-ab13-2274fcd9960f': No such file or directory

2026-10-10 04:32:10.559 | INFO | vikingbot.agent.loop:_run_agent_loop:1677 - [RESULT]: source_id uri workspace_path size status src_1 viking://user/ai-note/resources/note-wiki-inputs/18feefa0-079e-4b42-ab13-2274fcd9960f/s1/c.md compile_resources/src_1/note-wiki-inputs/18feefa0-079e-4b42-ab13-2274fcd9960f/s1/c.md 5888 materialized src_1 viking://user/ai-note/resources/note-wiki-inputs/18feefa0-079e-4b42-ab13-2274fcd9960f/s10/c.md compile_resources/src_1/note-wiki-inputs/18feefa0-079e-4b42-ab13-2274fcd9960f/s10/c.md 3020 materialized src_1 viking://user/ai-note/resources/note-wiki-inputs/18feefa0-079e-4b42-ab13-2274fcd9960f/s11/c.md compile_resources/src_1/note-wiki-inputs/18feefa 2026-10-10 04:32:10.559 | INFO | vikingbot.agent.loop:_run_agent_loop:1677 - [RESULT]: STDERR: find: 'compile_resources/18feefa0-079e-4b42-ab13-2274fcd9960f': No such file or directory

2026-10-10 04:32:23.259 | INFO | vikingbot.agent.loop:_run_agent_loop:1593 - [TOOL_CALL]: exec({"command": "mkdir -p compile_staging/tmp && for f in compile_resources/src_1/note-wiki-inputs/18feefa0-079e-4b42-ab13-2274fcd9960f/s*/c.md; do echo "$f"; done > compile_staging/tmp/readlist) 2026-10-10 04:32:23.259 | INFO | vikingbot.agent.loop:_run_agent_loop:1593 - [TOOL_CALL]: read_file({"path": "compile_resources/src_1/note-wiki-inputs/18feefa0-079e-4b42-ab13-2274fcd9960f/s40/当前xx.md"}) 2026-10-10 04:32:23.259 | INFO | vikingbot.agent.loop:_run_agent_loop:1593 - [TOOL_CALL]: read_file({"path": "compile_resources/src_1/note-wiki-inputs/18feefa0-079e-4b42-ab13-2274fcd9960f/s40/xx.md"}) 2026-10-10 04:32:23.259 | INFO | vikingbot.agent.loop:_run_agent_loop:1593 - [TOOL_CALL]: read_file({"path": "compile_resources/src_1/note-wiki-inputs/18feefa0-079e-4b42-ab13-2274fcd9960f/s40/一站式xx.md"}) 2026-10-10 04:32:23.259 | INFO | vikingbot.sandbox.backends.direct:execute:38 - [Direct] Executing: 'mkdir -p compile_staging/tmp && for f in compile_resources/src_1/note-wiki-inputs/18feefa0-079e-4b42-ab13-2274fcd9960f/s*/c.md; do echo "$f"; done > compile_staging/tmp/readlist.md' 2026-10-10 04:32:23.265 | INFO | vikingbot.sandbox.backends.direct:execute:89 - [Direct] Output: (no output) 2026-10-10 04:32:23.267 | INFO | vikingbot.agent.loop:_run_agent_loop:1677 - [RESULT]: (no output) 2026-10-10 04:32:23.268 | INFO | vikingbot.agent.loop:_run_agent_loop:1677 - [RESULT]: ### 当前AIxx局限:xxx

2026-10-10 04:32:23.268 | INFO | vikingbot.agent.loop:_run_agent_loop:1677 - [RESULT]: ### xxx INFO: 127.0.0.1:32960 - "POST /runtime/v1/tasks/status HTTP/1.1" 200 OK INFO: 127.0.0.1:35264 - "POST /runtime/v1/tasks/status HTTP/1.1" 200 OK 2026-10-10 04:33:05.579 | INFO | vikingbot.agent.loop:_run_agent_loop:1593 - [TOOL_CALL]: write_file({"path": "compile_staging/target_checkout/concept/当前AIxx.md", "content": "---\ntype: concept\ntitle: 当前AIxx\ndescription: ) 2026-10-10 04:33:05.579 | INFO | vikingbot.agent.loop:_run_agent_loop:1593 - [TOOL_CALL]: write_file({"path": "compile_staging/target_checkout/concept/个性化xx.md", "content": "---\ntype: concept\ntitle: 个性化xxx,]) 2026-10-10 04:33:05.579 | INFO | vikingbot.agent.loop:_run_agent_loop:1593 - [TOOL_CALL]: write_file({"path": "compile_staging/target_checkout/concept/一站式xxmd", "content": "---\ntype: concept\ntitle: 一站式]\n---\n) 2026-10-10 04:33:05.579 | INFO | vikingbot.agent.loop:_run_agent_loop:1593 - [TOOL_CALL]: write_file({"path": "compile_staging/target_checkout/index.md", "content": "---\ntype: index\ntitle: 核心xxxx。\n---\n\n# ) 2026-10-10 04:33:05.583 | INFO | vikingbot.agent.loop:_run_agent_loop:1677 - [RESULT]: Successfully wrote 783 bytes to compile_staging/target_checkout/concept/当前xx局限.md 2026-10-10 04:33:05.583 | INFO | vikingbot.agent.loop:_run_agent_loop:1677 - [RESULT]: Successfully wrote 792 bytes to compile_staging/target_checkout/concept/个性化xxmd 2026-10-10 04:33:05.584 | INFO | vikingbot.agent.loop:_run_agent_loop:1677 - [RESULT]: Successfully wrote 888 bytes to compile_staging/target_checkout/concept/一站式xx.md 2026-10-10 04:33:05.584 | INFO | vikingbot.agent.loop:_run_agent_loop:1677 - [RESULT]: Successfully wrote 437 bytes to compile_staging/target_checkout/index.md 2026-10-10 04:33:11.154 | INFO | vikingbot.agent.loop:_run_agent_loop:1593 - [TOOL_CALL]: submit_wiki_bundle({}) 2026-10-10 04:33:11.167 | INFO | vikingbot.agent.loop:_run_agent_loop:1677 - [RESULT]: Target checkout accepted with 4 changed file(s) and 4 Wiki page(s) in the preserved final tree. 2026-10-10 04:33:11.186 | INFO | vikingbot.compile.service:_log_compile_usage:1212 - Compile cmp_006dca830a6e47359d7aed3b48518ab6 finished in 69.0s — input_tokens=54982 cached_input_tokens=0 output_tokens=2678 2026-10-10 04:33:11.186 | INFO | vikingbot.sandbox.backends.direct:stop:107 - Direct backend stopped

Steps to Reproduce

准备 10 篇内容完全不同的素材,每篇放入唯一标识:

s1/c.md  → UNIQUE_TOPIC_01:自行车传动系统
s2/c.md  → UNIQUE_TOPIC_02:咖啡烘焙
s3/c.md  → UNIQUE_TOPIC_03:一阶微分方程
...
s10/c.md → UNIQUE_TOPIC_10:旅行规划

每篇正文可以写成:

# 自行车传动系统

唯一标识:UNIQUE_TOPIC_01

正文内容……

通过当前前端批量上传后,仍然按现有方式:

上传父目录
→ 一次调用 llm-wiki
→ 输出一个 Wiki

任务完成后检查 Bot 日志:

grep -E "_manifest.tsv|read_file|readlist|submit_wiki_bundle" vikingbot.log

复现成功的判断条件:

manifest 中 materialized 数量 = 10
实际 read_file 数量 < 10
日志出现向 readlist.md 写路径的命令
submit_wiki_bundle 仍然 accepted
最终 Wiki 未覆盖全部 UNIQUE_TOPIC

Expected Behavior

生成多个llm-wiki文档

Actual Behavior

只有1篇wiki生成

Minimal Reproducible Example


Error Logs


OpenViking Version

openviking 0.4.20

Python Version

Python 3.13.15

Operating System

Linux

Model Backend

No response

Additional Context

No response

t00350320 avatar Oct 10 '26 08:10 t00350320

我用最新 main、uv 环境和启用 VikingBot compile runtime 的本地环境复现了一遍。

结论:最新代码下没有复现原问题。

测试方式:

  • 准备了 10 个相互独立的 Markdown 源文件
  • 每个源文件包含一个唯一标记:UNIQUE_TOPIC_01 到 UNIQUE_TOPIC_10
  • 使用 llm-wiki skill 执行 ov compile
  • 输出目标是 resource wiki 路径

观察结果:

  • compile 任务成功完成
  • 最终生成了 18 个 wiki 页面
  • 10 个唯一标记全部出现在最终生成的 wiki 内容里
  • server 日志显示 10 个源文件都被 compile pipeline 读取
  • bot 日志显示新 Map/Shuffle/Reduce pipeline 对所有源文件执行了 map_agent,之后进入 review/route/reduce 阶段
  • 本次运行没有看到旧的 _manifest.tsv / read_file / submit_wiki_bundle checkout 流程

所以从本地复现结果看,最新代码已经规避了这个 issue 的根因:不再由 agent 自己决定只读取 checkout 出来的一部分源文件再提交 wiki bundle,而是由 compile pipeline 负责源文件枚举和逐源处理。

这个行为变化对应的主要 PR 是 #5750:feat(compile): add a plannable Map/Shuffle/Reduce pipeline。该 PR 将 resource/skill 类型的 compile 路径切到新的 Map/Shuffle/Reduce pipeline,从工程结构上避免了旧流程里“agent 只读取部分源文件但仍提交成功”的问题。

补充说明:这里不应该把预期行为理解成“10 个输入文件必须生成 10 个 wiki 页面”。我这次测试中 10 个输入文件生成了 18 个页面。更关键的是源内容覆盖情况;这次 10 个源文件的唯一标记都被保留到了最终输出中。

sponge225 avatar Oct 10 '26 09:10 sponge225

感谢报告。#5750 已将 Resource/Skill Compile 切换到新的处理流程,由 pipeline 枚举并读取源文件。上面的最新 main 复验也确认:10 份输入的唯一标记全部出现在最终输出中,共生成 18 个 Wiki 页面,未再出现旧流程只读取部分素材就提交成功的情况。

按主干已解决关闭。该改动尚未包含在 v0.5.0 中;判断是否解决应看源内容覆盖情况,输入文件数与输出 Wiki 页数不需要一一对应。

qin-ctx avatar Oct 12 '26 09:10 qin-ctx

4. 感谢报告。#5750 已将 Resource/Skill Compile 切换到新的处理流程,由 pipeline 枚举并读取源文件。上面的最新 main 复验也确认:10 份输入的唯一标记全部出现在最终输出中,共生成 18 个 Wiki 页面,未再出现旧流程只读取部分素材就提交成功的情况。 按主干已解决关闭。该改动尚未包含在 v0.5.0 中;判断是否解决应看源内容覆盖情况,输入文件数与输出 Wiki 页数不需要一一对应。

hi, qin, 看到最新修改已合入main,但是release没有携带,您那边下一个release发版什么时间呢?我们可以有daily release的版本,可以给我们测试使用吗? 目前我们这边的使用场景,多文件上传比较多,所以这个问题比较棘手。另外,尝试手动源码编译比较困难。。。

t00350320 avatar Oct 13 '26 01:10 t00350320