diff --git a/.flue/workflows/issue-triage.ts b/.flue/workflows/issue-triage.ts
index 068e24688bb9..e8f529b09fb8 100644
--- a/.flue/workflows/issue-triage.ts
+++ b/.flue/workflows/issue-triage.ts
@@ -32,16 +32,10 @@ const fixResultSchema = v.object({
});
const labelResultSchema = v.object({
- priority: v.pipe(
- v.nullable(v.string()),
- v.description(
- 'Exactly one priority label name (e.g. "P4: important"), or null if unable to determine priority',
- ),
- ),
- packages: v.pipe(
+ labels: v.pipe(
v.array(v.string()),
v.description(
- 'One or more package label names (e.g. ["pkg: astro", "pkg: react"]). Empty array if unable to determine package.',
+ 'The labels to apply to the issue (e.g. ["- P1: chore", "pkg: react"]). Array must contain one "priority" label.',
),
),
});
@@ -143,7 +137,7 @@ Return only "yes" or "no" inside the ---RESULT_START--- / ---RESULT_END--- block
await flue.shell(`gh issue comment ${issueNumber} --body-file -`, {
stdin: comment,
- env: { GH_TOKEN: flue.secrets.GITHUB_TOKEN },
+ env: { GH_TOKEN: flue.secrets.FREDKBOT_GITHUB_TOKEN },
});
if (reproduceResult.reproducible) {
@@ -163,9 +157,8 @@ Return only "yes" or "no" inside the ---RESULT_START--- / ---RESULT_END--- block
.map((line) => JSON.parse(line) as { name: string; description: string });
// Filter to priority labels (P followed by a digit) and package labels (pkg: prefix)
- const priorityLabels = allLabels.filter((l) => /^P\d/.test(l.name));
+ const priorityLabels = allLabels.filter((l) => /^- P\d/.test(l.name));
const packageLabels = allLabels.filter((l) => l.name.startsWith('pkg:'));
- const candidateLabels = [...priorityLabels, ...packageLabels];
const labelResult = await flue.prompt(
`Label the following GitHub issue based on our Triage Report which summarizes what we learned in our attempt to reproduce, diagnose, and fix the issue.
@@ -173,24 +166,22 @@ Return only "yes" or "no" inside the ---RESULT_START--- / ---RESULT_END--- block
Select the most appropriate labels from the list below. Use the label descriptions to guide your decision, combined with the triage report's cause and impact analysis.
### Rules
-- Select exactly ONE priority label based on the severity and impact of the bug. Pay close attention to the "Cause" and "Impact" sections of the triage report.
-- You must select ONE priorty label! If you are not sure, just use your best judgement based on the label descriptions and the findings of the triage report.
+- Select exactly ONE priority label based on the label description and the severity and impact of the bug. Pay close attention to the "Cause" and "Impact" sections of the triage report.
+- You must select ONE priority label! If you are not sure, just use your best judgement based on the label descriptions and the findings of the triage report.
- Select 0-3 package labels based on where where the issue lives (or most likely lives) in the monorepo. The triage report's diagnosis should make it clear. If you cannot confidently determine the affected package(s), return an empty array for packages.
- Return the exact label names as they appear above — do not modify them.
### Priority Labels (select exactly one)
-${priorityLabels.map((l) => `- **${l.name}**: ${l.description || '(no description)'}`).join('\n')}
+${priorityLabels.map((l) => `- "${l.name}": ${l.description || '(no description)'}`).join('\n')}
### Package Labels (select zero or more)
-${packageLabels.map((l) => `- **${l.name}**: ${l.description || '(no description)'}`).join('\n')}
+${packageLabels.map((l) => `- "${l.name}": ${l.description || '(no description)'}`).join('\n')}
---
-
-# ${issue.title}
-
-${issue.body}
-
+
+${issueJson}
+
${comment}
@@ -199,13 +190,10 @@ ${comment}
{ result: labelResultSchema },
);
- const labelsToAdd = [
- ...(labelResult.priority ? [labelResult.priority] : []),
- ...labelResult.packages,
- ].filter((name) => candidateLabels.some((l) => l.name === name));
-
- if (labelsToAdd.length > 0) {
- const labelFlags = labelsToAdd.map((l) => `--add-label ${JSON.stringify(l)}`).join(' ');
+ if (labelResult.labels.length > 0) {
+ const labelFlags = labelResult.labels
+ .map((l) => `--add-label ${JSON.stringify(l)}`)
+ .join(' ');
await flue.shell(`gh issue edit ${issueNumber} ${labelFlags}`, {
env: { GH_TOKEN: flue.secrets.GITHUB_TOKEN },
});
@@ -218,13 +206,8 @@ ${comment}
env: { GH_TOKEN: flue.secrets.GITHUB_TOKEN },
});
} else {
- // Not reproducible: add "needs repro" and remove "needs triage".
- // We handle both labels here (instead of just adding "needs repro") to avoid
- // the issue-labeled.yml workflow posting a duplicate auto-comment.
- await flue.shell(
- `gh issue edit ${issueNumber} --add-label "needs repro" --remove-label "needs triage"`,
- { env: { GH_TOKEN: flue.secrets.GITHUB_TOKEN } },
- );
+ // Not reproducible: do nothing. The "needs triage" label stays on the issue
+ // so that it can continue to be worked on and triaged by the humans.
}
return { reproduceResult, diagnoseResult, fixResult, isPushed };
}
diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml
index e928dabadd76..a2c45e4b0440 100644
--- a/.github/workflows/issue-triage.yml
+++ b/.github/workflows/issue-triage.yml
@@ -84,6 +84,7 @@ jobs:
- name: Run workflow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ FREDKBOT_GITHUB_TOKEN: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.CI_ANTHROPIC_API_KEY }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |