Skip to content

Commit d289591

Browse files
snomiaoclaude
andauthored
Remove ANSWERED_LABEL management from bug-cop (#47)
* Remove ANSWERED_LABEL management from bug-cop The ANSWERED_LABEL is never managed by the bot and has been commented out to avoid confusion. This change: - Comments out ANSWERED_LABEL export as it's never used by the bot - Removes ANSWERED_LABEL from working labels array - Removes ANSWERED_LABEL from askForInfo label set - Improves code formatting for current labels filtering 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * docs(gh-bugcop.tsx): update comments to clarify bot functionality regarding issue labels and context handling * chore(gh-bugcop.tsx): update comment for ANSWERED_LABEL to include date for clarity on its status * chore(GithubBugcopTaskStatus.tsx): remove unused ANSWERED_LABEL import and comment out related code to clean up the component --------- Co-authored-by: Claude <[email protected]>
1 parent 8878141 commit d289591

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

app/tasks/gh-bugcop/GithubBugcopTaskStatus.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import prettyMilliseconds from "pretty-ms";
55
import { useEffect, useState } from "react";
66
import sflow from "sflow";
77
import useAsyncEffect from "use-async-effect";
8-
import { ANSWERED_LABEL, ASKING_LABEL, GithubBugcopTask } from "./gh-bugcop";
8+
import { ASKING_LABEL, GithubBugcopTask } from "./gh-bugcop";
99

1010
if (import.meta.main) render(<GithubBugcopTaskStatus />);
1111

@@ -17,7 +17,7 @@ export default function GithubBugcopTaskStatus({}) {
1717
// Color mappers
1818
const getStatusColor = (labels?: string[]) => {
1919
if (labels?.includes(ASKING_LABEL)) return "yellow";
20-
if (labels?.includes(ANSWERED_LABEL)) return "green";
20+
// if (labels?.includes(ANSWERED_LABEL)) return "green";
2121
return "red";
2222
};
2323

app/tasks/gh-bugcop/gh-bugcop.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
// 1. bot matches label "bug-cop:ask-for-info", and if user have added context, remove "bug-cop:ask-for-info" and add "bug-cop:answered"
1+
/**
2+
* Github Bugcop Bot
3+
* 1. bot matches issues for label "bug-cop:ask-for-info"
4+
* 2. if user have added context, remove "bug-cop:ask-for-info" and add "bug-cop:response-received"
5+
*/
6+
27
// for repo
38
import { db } from "@/src/db";
49
import { TaskMetaCollection } from "@/src/db/TaskMeta";
@@ -24,7 +29,7 @@ export const REPOLIST = [
2429
"https://github.com/Comfy-Org/desktop",
2530
];
2631
export const ASKING_LABEL = "bug-cop:ask-for-info";
27-
export const ANSWERED_LABEL = "bug-cop:answered";
32+
// export const ANSWERED_LABEL = "bug-cop:answered"; // 2025-08-09 “answered” is never managed by bot
2833
export const RESPONSE_RECEIVED_LABEL = "bug-cop:response-received";
2934
export const GithubBugcopTaskDefaultMeta = {
3035
repoUrls: REPOLIST,
@@ -230,14 +235,17 @@ async function processIssue(issue: GH["issue"]) {
230235

231236
const responseReceived = hasNewComment || isBodyAddedContent; // check if user responsed info by new comment or body update
232237
const status: "responseReceived" | "askForInfo" = responseReceived ? "responseReceived" : "askForInfo";
233-
const workinglabels = [ASKING_LABEL, ANSWERED_LABEL, RESPONSE_RECEIVED_LABEL];
238+
const workinglabels = [ASKING_LABEL, RESPONSE_RECEIVED_LABEL];
234239
const labelSet = {
235240
responseReceived: [RESPONSE_RECEIVED_LABEL],
236-
askForInfo: [ANSWERED_LABEL, ASKING_LABEL],
241+
askForInfo: [ASKING_LABEL],
237242
closed: [], // clear bug-cop labels
238243
}[status];
239244

240-
const currentLabels = issue.labels.filter(l => l != null).map((l) => (typeof l === "string" ? l : (l.name ?? ""))).filter(Boolean);
245+
const currentLabels = issue.labels
246+
.filter((l) => l != null)
247+
.map((l) => (typeof l === "string" ? l : (l.name ?? "")))
248+
.filter(Boolean);
241249
const addLabels = difference(labelSet, currentLabels);
242250
const removeLabels = difference(
243251
currentLabels.filter((label) => workinglabels.includes(label)),

0 commit comments

Comments
 (0)