Skip to content

[bug] recall 的 codebase 检索硬编码 cwd/teamwiki,与 pull/团队仓路径冲突 #81

Description

@jeff-r2026

现象

teamai recall 的 codebase 图谱检索只在当前工作目录下找 wiki:

// src/recall.ts:262,284
const hasWiki = await pathExists(path.join(process.cwd(), 'teamwiki'));
const wikiRoot = path.join(process.cwd(), 'teamwiki');

只要用户不在恰好含有 teamwiki/ 的目录运行(子目录、monorepo 子包、或任意非同步目录),codebase recall 就静默失效(异常被 catch 后仅 log.warn)。

实测:当前机器存在 ~/.teamai/team-repo,但在仓库根目录跑 teamai recall 时 codebase 检索完全不触发。

路径约定不一致

同一份 wiki 在不同命令里有三套路径约定:

来源 wiki 路径
recall cwd/teamwikisrc/recall.ts:284
pull(同步落点) projectRoot ?? cwd 下(src/pull.ts:624
deep-enrich(默认) cwd/.teamai/team-repo/teamwikisrc/index.ts:757

project scope 下 projectRoot 常是 monorepo 根,用户在子包里跑 recall 时 wiki 在父目录,必然找不到。

建议

抽取统一的 resolveWikiRoot(config) 单点解析,按优先级 projectRoot/teamwikirepo.localPath/teamwikicwd/teamwiki,供 recall / pull / deep-enrich 共用。

严重程度:高(codebase 检索在常见目录下完全不可用)。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions