[问题/Issue] 章节9.4.4:action 类型笔记未被检索,与注释不一致

Author: ljyzzZCreated Aug 26, 2026Updated Aug 26, 2026
Labelsdocumentation

1. 遇到问题的章节 / Affected Chapter

Chapter 9.4.4

2. 问题类型 / Issue Type

文档不清晰 / Unclear Documentation

3. 具体问题描述 / Problem Description

ProjectAssistant._retrieve_relevant_notes() 只显式检索了 blocker 类型笔记,没有显式检索 action 类型笔记,和注释不符,容易引起读者困惑。

虽然通用搜索可能命中 action,但前提是笔记标题或正文包含当前 query。因此,一条仍需执行但与当前 query 没有直接关键词重叠的 action 笔记不会被加入上下文。 这与后文为 action 设置较高相关性分数,以及“优先关注行动计划”的设计意图不一致。

预期行为:同时优先检索 blockeraction 类型笔记,再与通用搜索结果合并去重。

4. 问题重现材料 / Reproduction Materials

当前实现只检索了 blocker

# 优先检索 blocker 和 action 类型的笔记
blockers = self.note_tool.run({
    "action": "list",
    "note_type": "blocker",
    "limit": 2
})

search_results = self.note_tool.run({
    "action": "search",
    "query": query,
    "limit": limit
})

all_notes = {
    note.get("note_id") or note.get("id"): note
    for note in (blockers or []) + (search_results or [])
}

建议增加对 action 的显式检索:

# 优先检索 blocker 和 action 类型的笔记
blockers = self.note_tool.run({
    "action": "list",
    "note_type": "blocker",
    "limit": 1
})

actions = self.note_tool.run({
    "action": "list",
    "note_type": "action",
    "limit": 1
})

search_results = self.note_tool.run({
    "action": "search",
    "query": query,
    "limit": limit
})

all_notes = {
    note.get("note_id") or note.get("id"): note
    for note in (
        (blockers or [])
        + (actions or [])
        + (search_results or [])
    )
}

默认 limit=3 时,可以为 blockeraction 和通用搜索结果分别保留一个名额。

5. 补充信息 / Additional Information

No response

确认事项 / Verification

  • 我已阅读过相关章节的文档 / I have read the relevant chapter documentation
  • 我已搜索过现有的Issues,确认此问题未被报告 / I have searched existing Issues and confirmed this hasn't been reported
  • 我已尝试过基本的故障排除(如重启、重新安装依赖等) / I have tried basic troubleshooting (restart, reinstall dependencies, etc.)

Source: datawhalechina/hello-agents