fix: 路由 prompt 搜索指令要求验证 .git 目录 - #115
Merged
Merged
Conversation
路由 agent 通过工具搜索 ls 项目目录时,仍会匹配到非仓库目录 (如 talktype-target 编译产物)。即使 use_existing 验证能拒绝, 回退到 use_default 仍不符合预期。 修复: 在搜索指令中明确告知 agent 只有含 .git 的目录才是有效仓库, 编译产物目录不应被选择,部分名称匹配应继续查找更精确的结果。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @lishuceo's task in 36s —— View job PR Review: fix: 路由 prompt 搜索指令要求验证 .git 目录
✅ Approved — Clean, minimal, and well-targeted change. What this does: Enhances the Rule 6 tool-search prompt (line 117 of
Assessment: This is a sensible third-layer defense complementing PR #113 (project list filtering) and PR #114 (validation fallback). The change is prompt-only — no logic or runtime behavior modified — so the risk is effectively zero. The wording is clear and gives the LLM agent concrete examples of what to avoid, which is good prompt engineering practice. No issues found. All 42 routing tests passing per the PR description. |
lishuceo
added a commit
that referenced
this pull request
Apr 8, 2026
路由 agent 通过工具搜索 ls 项目目录时,仍会匹配到非仓库目录 (如 talktype-target 编译产物)。即使 use_existing 验证能拒绝, 回退到 use_default 仍不符合预期。 修复: 在搜索指令中明确告知 agent 只有含 .git 的目录才是有效仓库, 编译产物目录不应被选择,部分名称匹配应继续查找更精确的结果。 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ls搜索项目目录时,仍会匹配到非仓库目录(如talktype-target编译产物),即使use_existing验证能拒绝,回退到use_default仍不符合预期.git的目录才是有效仓库,部分名称匹配(如talktype-target≠talktype)应继续查找根因: PR #113 的
discoverLocalProjects过滤生效后,talktype-target不再出现在"已知项目"列表中。但路由 agent 走 Rule 6 工具搜索时,ls /root/dev/仍然能看到talktype-target,agent 将其误认为 talktype 项目。与 PR #113/#114 的关系: 这是第三层防护 — prompt 层面引导 agent 不选错误目录(前两层: 项目列表过滤 + 验证回退)
Test plan
🤖 Generated with Claude Code