summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/cli/cmd/github.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/opencode/src/cli/cmd/github.ts b/packages/opencode/src/cli/cmd/github.ts
index c7d403395..0d38e503c 100644
--- a/packages/opencode/src/cli/cmd/github.ts
+++ b/packages/opencode/src/cli/cmd/github.ts
@@ -602,21 +602,26 @@ export const GithubRunCommand = cmd({
}
const reviewContext = getReviewCommentContext()
+ const mentions = (process.env["MENTIONS"] || "/opencode,/oc")
+ .split(",")
+ .map((m) => m.trim().toLowerCase())
+ .filter(Boolean)
let prompt = (() => {
const body = payload.comment.body.trim()
- if (body === "/opencode" || body === "/oc") {
+ const bodyLower = body.toLowerCase()
+ if (mentions.some((m) => bodyLower === m)) {
if (reviewContext) {
return `Review this code change and suggest improvements for the commented lines:\n\nFile: ${reviewContext.file}\nLines: ${reviewContext.line}\n\n${reviewContext.diffHunk}`
}
return "Summarize this thread"
}
- if (body.includes("/opencode") || body.includes("/oc")) {
+ if (mentions.some((m) => bodyLower.includes(m))) {
if (reviewContext) {
return `${body}\n\nContext: You are reviewing a comment on file "${reviewContext.file}" at line ${reviewContext.line}.\n\nDiff context:\n${reviewContext.diffHunk}`
}
return body
}
- throw new Error("Comments must mention `/opencode` or `/oc`")
+ throw new Error(`Comments must mention ${mentions.map((m) => "`" + m + "`").join(" or ")}`)
})()
// Handle images