Skip to content

Commit e7b58d9

Browse files
authored
fix(nexu-pal): skip internal-author issue triage (#599)
1 parent 3981f31 commit e7b58d9

File tree

4 files changed

+37
-16
lines changed

4 files changed

+37
-16
lines changed

β€Ž.github/workflows/nexu-pal-issue-opened.ymlβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ jobs:
4545
ISSUE_NUMBER: ${{ github.event.issue.number }}
4646
ISSUE_TITLE: ${{ github.event.issue.title }}
4747
ISSUE_BODY: ${{ github.event.issue.body }}
48+
ISSUE_AUTHOR_ASSOCIATION: ${{ github.event.issue.author_association }}
4849
run: node scripts/nexu-pal/process-issue-opened.mjs

β€Žscripts/nexu-pal/lib/triage-opened-engine.mjsβ€Ž

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ function sanitizeJsonResponse(raw) {
116116
return raw.replace(/^```(?:json)?\s*\n?/m, "").replace(/\n?```\s*$/m, "");
117117
}
118118

119+
function isInternalIssueAuthor(authorAssociation) {
120+
return authorAssociation === "MEMBER" || authorAssociation === "OWNER";
121+
}
122+
119123
async function detectAndTranslate({ chat, issueTitle, issueBody }) {
120124
const content = `Title: ${issueTitle}\n\nBody:\n${issueBody}`;
121125

@@ -249,6 +253,7 @@ function buildNeedsInformationComment({ missingItems, reason }) {
249253
export async function buildOpenedIssueTriagePlan({
250254
issueTitle,
251255
issueBody,
256+
issueAuthorAssociation,
252257
chat,
253258
}) {
254259
const plan = createTriagePlan();
@@ -298,6 +303,31 @@ export async function buildOpenedIssueTriagePlan({
298303
plan.diagnostics.push(...translation.diagnostics);
299304
}
300305

306+
const classification = await classifyBugOnly({
307+
chat,
308+
englishTitle,
309+
englishBody,
310+
});
311+
312+
if (classification.is_bug === true) {
313+
plan.labelsToAdd.push("bug");
314+
}
315+
316+
plan.diagnostics.push(
317+
`bug classification: ${classification.reason ?? "no reason provided"}`,
318+
);
319+
320+
plan.diagnostics.push(
321+
`author association: ${issueAuthorAssociation ?? "unknown"}`,
322+
);
323+
324+
if (isInternalIssueAuthor(issueAuthorAssociation)) {
325+
plan.diagnostics.push(
326+
"internal author detected; skipped roadmap/duplicate/completeness/needs-triage checks",
327+
);
328+
return plan;
329+
}
330+
301331
const roadmap = await matchRoadmap({
302332
title: englishTitle,
303333
body: englishBody,
@@ -315,20 +345,6 @@ export async function buildOpenedIssueTriagePlan({
315345
plan.diagnostics.push(...duplicate.diagnostics);
316346
}
317347

318-
const classification = await classifyBugOnly({
319-
chat,
320-
englishTitle,
321-
englishBody,
322-
});
323-
324-
if (classification.is_bug === true) {
325-
plan.labelsToAdd.push("bug");
326-
}
327-
328-
plan.diagnostics.push(
329-
`bug classification: ${classification.reason ?? "no reason provided"}`,
330-
);
331-
332348
const completeness = await assessInformationCompleteness({
333349
chat,
334350
englishTitle,

β€Žscripts/nexu-pal/process-issue-opened.mjsβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const repo = process.env.GITHUB_REPOSITORY;
1414
const issueNumber = process.env.ISSUE_NUMBER;
1515
const issueTitle = process.env.ISSUE_TITLE ?? "";
1616
const issueBody = process.env.ISSUE_BODY ?? "";
17+
const issueAuthorAssociation = process.env.ISSUE_AUTHOR_ASSOCIATION ?? "NONE";
1718

1819
if (!endpoint || !apiKey || !ghToken || !repo || !issueNumber) {
1920
console.error(
@@ -55,6 +56,7 @@ async function main() {
5556
const plan = await buildOpenedIssueTriagePlan({
5657
issueTitle,
5758
issueBody,
59+
issueAuthorAssociation,
5860
chat,
5961
});
6062

β€Žspecs/current/nexu-pal.mdβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ Runs in order:
2222

2323
3. **Intent classification** β€” Sends the normalized English title and body to the LLM and assigns only the `bug` label when the issue clearly describes broken behavior.
2424

25-
4. **Completeness check** β€” Uses the LLM to decide whether the issue is too incomplete to continue triage. If so, adds `needs-information`, posts a follow-up comment, and pauses there.
25+
4. **Internal-member short-circuit** β€” If `issue.author_association` is `MEMBER` or `OWNER`, the opened-issue flow stops after translation + bug classification. Internal issues skip known-issue matching, completeness checks, and `needs-triage` labeling.
2626

27-
5. **Triage label** β€” If the issue is not roadmap-matched and does not need more information, adds the `needs-triage` label.
27+
5. **Completeness check** β€” For non-internal authors, uses the LLM to decide whether the issue is too incomplete to continue triage. If so, adds `needs-information`, posts a follow-up comment, and pauses there.
28+
29+
6. **Triage label** β€” For non-internal authors, if the issue is not roadmap-matched and does not need more information, adds the `needs-triage` label.
2830

2931
The opened-issue flow is split into a small pipeline:
3032

0 commit comments

Comments
Β (0)