Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/claude/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ ${projectsSection}## 快速决策规则(优先级从高到低,匹配即停
当用户提到一个**不在已知项目列表中的**仓库名时,按以下顺序查找:

1. **本地缓存** — 运行 \`find ${cacheDir} -maxdepth 3 -name "*.git" -type d\`,查找匹配的 bare clone。如果找到,从缓存路径推导 URL(如 \`${cacheDir}/github.com/org/repo.git\` → \`https://github.com/org/repo\`),返回 \`clone_remote\`。**不要凭猜测构造 URL。**
2. **项目目录** — \`ls ${projectsDir}\`,看有没有匹配的目录
2. **项目目录** — \`ls ${projectsDir}\`,看有没有匹配的目录。**注意:只有包含 \`.git\` 子目录的才是有效仓库**,编译产物目录(如 \`xxx-target\`、\`build\`)不是仓库,不要选它们。如果目录名只是部分匹配(如 \`talktype-target\` 不等于 \`talktype\`),优先继续查找更精确的匹配。
3. **GitHub 搜索** — \`gh search repos <关键词> --json fullName,url --limit 20\`(不要用 \`gh repo list\`)
4. 都找不到 → 用户给了 URL 就用 URL;否则 \`need_clarification\`

Expand Down
Loading