summaryrefslogtreecommitdiffhomepage
path: root/.opencode
diff options
context:
space:
mode:
Diffstat (limited to '.opencode')
-rw-r--r--.opencode/agent/duplicate-pr.md2
-rw-r--r--.opencode/tool/github-pr-search.ts5
2 files changed, 7 insertions, 0 deletions
diff --git a/.opencode/agent/duplicate-pr.md b/.opencode/agent/duplicate-pr.md
index c053ace5d..257145508 100644
--- a/.opencode/agent/duplicate-pr.md
+++ b/.opencode/agent/duplicate-pr.md
@@ -12,6 +12,8 @@ You are a duplicate PR detection agent. When a PR is opened, your job is to sear
Use the github-pr-search tool to search for PRs that might be addressing the same issue or feature.
+IMPORTANT: The input will contain a line `CURRENT_PR_NUMBER: NNNN`. This is the current PR number, you should not mark that the current PR as a duplicate of itself.
+
Search using keywords from the PR title and description. Try multiple searches with different relevant terms.
If you find potential duplicates:
diff --git a/.opencode/tool/github-pr-search.ts b/.opencode/tool/github-pr-search.ts
index 668557e38..587fdfaaf 100644
--- a/.opencode/tool/github-pr-search.ts
+++ b/.opencode/tool/github-pr-search.ts
@@ -45,6 +45,11 @@ export default tool({
}
const prs = result.items as PR[]
+
+ if (prs.length === 0) {
+ return `No other PRs found matching "${args.query}"`
+ }
+
const formatted = prs.map((pr) => `${pr.title}\n${pr.html_url}`).join("\n\n")
return `Found ${result.total_count} PRs (showing ${prs.length}):\n\n${formatted}`