Skip to content

Commit 46ced5f

Browse files
rekram1-nodebalcsida
authored andcommitted
ci: update triage workflow (anomalyco#13944)
1 parent 37eb600 commit 46ced5f

File tree

4 files changed

+129
-119
lines changed

4 files changed

+129
-119
lines changed

.opencode/agent/triage.md

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
mode: primary
33
hidden: true
4-
model: opencode/claude-haiku-4-5
4+
model: opencode/minimax-m2.5
55
color: "#44BA81"
66
tools:
77
"*": false
@@ -12,6 +12,8 @@ You are a triage agent responsible for triaging github issues.
1212

1313
Use your github-triage tool to triage issues.
1414

15+
This file is the source of truth for ownership/routing rules.
16+
1517
## Labels
1618

1719
### windows
@@ -43,12 +45,30 @@ Desktop app issues:
4345

4446
**Only** add if the issue explicitly mentions nix.
4547

48+
If the issue does not mention nix, do not add nix.
49+
50+
If the issue mentions nix, assign to `rekram1-node`.
51+
4652
#### zen
4753

4854
**Only** add if the issue mentions "zen" or "opencode zen" or "opencode black".
4955

5056
If the issue doesn't have "zen" or "opencode black" in it then don't add zen label
5157

58+
#### core
59+
60+
Use for core server issues in `packages/opencode/`, excluding `packages/opencode/src/cli/cmd/tui/`.
61+
62+
Examples:
63+
64+
- LSP server behavior
65+
- Harness behavior (agent + tools)
66+
- Feature requests for server behavior
67+
- Agent context construction
68+
- API endpoints
69+
- Provider integration issues
70+
- New, broken, or poor-quality models
71+
5272
#### docs
5373

5474
Add if the issue requests better documentation or docs updates.
@@ -66,13 +86,47 @@ TUI issues potentially caused by our underlying TUI library:
6686

6787
When assigning to people here are the following rules:
6888

69-
adamdotdev:
70-
ONLY assign adam if the issue will have the "desktop" label.
89+
Desktop / Web:
90+
Use for desktop-labeled issues only.
91+
92+
- adamdotdevin
93+
- iamdavidhill
94+
- Brendonovich
95+
- nexxeln
96+
97+
Zen:
98+
ONLY assign if the issue will have the "zen" label.
99+
100+
- fwang
101+
- MrMushrooooom
102+
103+
TUI (`packages/opencode/src/cli/cmd/tui/...`):
104+
105+
- thdxr for TUI UX/UI product decisions and interaction flow
106+
- kommander for OpenTUI engine issues: rendering artifacts, keybind handling, terminal compatibility, SSH behavior, and low-level perf bottlenecks
107+
- rekram1-node for TUI bugs that are not clearly OpenTUI engine issues
108+
109+
Core (`packages/opencode/...`, excluding TUI subtree):
110+
111+
- thdxr for sqlite/snapshot/memory bugs and larger architectural core features
112+
- jlongster for opencode server + API feature work (tool currently remaps jlongster -> thdxr until assignable)
113+
- rekram1-node for harness issues, provider issues, and other bug-squashing
114+
115+
For core bugs that do not clearly map, either thdxr or rekram1-node is acceptable.
116+
117+
Docs:
118+
119+
- R44VC0RP
120+
121+
Windows:
122+
123+
- Hona (assign any issue that mentions Windows or is likely Windows-specific)
71124

72-
fwang:
73-
ONLY assign fwang if the issue will have the "zen" label.
125+
Determinism rules:
74126

75-
jayair:
76-
ONLY assign jayair if the issue will have the "docs" label.
127+
- If title + body does not contain "zen", do not add the "zen" label
128+
- If "nix" label is added but title + body does not mention nix/nixos, the tool will drop "nix"
129+
- If title + body mentions nix/nixos, assign to `rekram1-node`
130+
- If "desktop" label is added, the tool will override assignee and randomly pick one Desktop / Web owner
77131

78-
In all other cases use best judgment. Avoid assigning to kommander needlessly, when in doubt assign to rekram1-node.
132+
In all other cases, choose the team/section with the most overlap with the issue and assign a member from that team at random.

.opencode/tool/github-triage.ts

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
/// <reference path="../env.d.ts" />
2-
// import { Octokit } from "@octokit/rest"
32
import { tool } from "@opencode-ai/plugin"
43
import DESCRIPTION from "./github-triage.txt"
54

5+
const TEAM = {
6+
desktop: ["adamdotdevin", "iamdavidhill", "Brendonovich", "nexxeln"],
7+
zen: ["fwang", "MrMushrooooom"],
8+
tui: ["thdxr", "kommander", "rekram1-node"],
9+
core: ["thdxr", "rekram1-node", "jlongster"],
10+
docs: ["R44VC0RP"],
11+
windows: ["Hona"],
12+
} as const
13+
14+
const ASSIGNEES = [...new Set(Object.values(TEAM).flat())]
15+
16+
function pick<T>(items: readonly T[]) {
17+
return items[Math.floor(Math.random() * items.length)]!
18+
}
19+
620
function getIssueNumber(): number {
721
const issue = parseInt(process.env.ISSUE_NUMBER ?? "", 10)
822
if (!issue) throw new Error("ISSUE_NUMBER env var not set")
@@ -29,60 +43,79 @@ export default tool({
2943
description: DESCRIPTION,
3044
args: {
3145
assignee: tool.schema
32-
.enum(["thdxr", "adamdotdevin", "rekram1-node", "fwang", "jayair", "kommander"])
46+
.enum(ASSIGNEES as [string, ...string[]])
3347
.describe("The username of the assignee")
3448
.default("rekram1-node"),
3549
labels: tool.schema
36-
.array(tool.schema.enum(["nix", "opentui", "perf", "desktop", "zen", "docs", "windows"]))
50+
.array(tool.schema.enum(["nix", "opentui", "perf", "web", "desktop", "zen", "docs", "windows", "core"]))
3751
.describe("The labels(s) to add to the issue")
3852
.default([]),
3953
},
4054
async execute(args) {
4155
const issue = getIssueNumber()
42-
// const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN })
4356
const owner = "anomalyco"
4457
const repo = "opencode"
4558

4659
const results: string[] = []
60+
let labels = [...new Set(args.labels.map((x) => (x === "desktop" ? "web" : x)))]
61+
const web = labels.includes("web")
62+
const text = `${process.env.ISSUE_TITLE ?? ""}\n${process.env.ISSUE_BODY ?? ""}`.toLowerCase()
63+
const zen = /\bzen\b/.test(text) || text.includes("opencode black")
64+
const nix = /\bnix(os)?\b/.test(text)
65+
66+
if (labels.includes("nix") && !nix) {
67+
labels = labels.filter((x) => x !== "nix")
68+
results.push("Dropped label: nix (issue does not mention nix)")
69+
}
70+
71+
const assignee = nix
72+
? "rekram1-node"
73+
: web
74+
? pick(TEAM.desktop)
75+
: args.assignee === "jlongster"
76+
? "thdxr"
77+
: args.assignee
78+
79+
if (args.assignee === "jlongster" && assignee === "thdxr") {
80+
results.push("Remapped assignee: jlongster -> thdxr (jlongster not assignable yet)")
81+
}
82+
83+
if (labels.includes("zen") && !zen) {
84+
throw new Error("Only add the zen label when issue title/body contains 'zen'")
85+
}
86+
87+
if (web && !nix && !(TEAM.desktop as readonly string[]).includes(assignee)) {
88+
throw new Error("Web issues must be assigned to adamdotdevin, iamdavidhill, Brendonovich, or nexxeln")
89+
}
90+
91+
if ((TEAM.zen as readonly string[]).includes(assignee) && !labels.includes("zen")) {
92+
throw new Error("Only zen issues should be assigned to fwang or MrMushrooooom")
93+
}
4794

48-
if (args.assignee === "adamdotdevin" && !args.labels.includes("desktop")) {
49-
throw new Error("Only desktop issues should be assigned to adamdotdevin")
95+
if (assignee === "Hona" && !labels.includes("windows")) {
96+
throw new Error("Only windows issues should be assigned to Hona")
5097
}
5198

52-
if (args.assignee === "fwang" && !args.labels.includes("zen")) {
53-
throw new Error("Only zen issues should be assigned to fwang")
99+
if (assignee === "R44VC0RP" && !labels.includes("docs")) {
100+
throw new Error("Only docs issues should be assigned to R44VC0RP")
54101
}
55102

56-
if (args.assignee === "kommander" && !args.labels.includes("opentui")) {
103+
if (assignee === "kommander" && !labels.includes("opentui")) {
57104
throw new Error("Only opentui issues should be assigned to kommander")
58105
}
59106

60-
// await octokit.rest.issues.addAssignees({
61-
// owner,
62-
// repo,
63-
// issue_number: issue,
64-
// assignees: [args.assignee],
65-
// })
66107
await githubFetch(`/repos/${owner}/${repo}/issues/${issue}/assignees`, {
67108
method: "POST",
68-
body: JSON.stringify({ assignees: [args.assignee] }),
109+
body: JSON.stringify({ assignees: [assignee] }),
69110
})
70-
results.push(`Assigned @${args.assignee} to issue #${issue}`)
71-
72-
const labels: string[] = args.labels.map((label) => (label === "desktop" ? "web" : label))
111+
results.push(`Assigned @${assignee} to issue #${issue}`)
73112

74113
if (labels.length > 0) {
75-
// await octokit.rest.issues.addLabels({
76-
// owner,
77-
// repo,
78-
// issue_number: issue,
79-
// labels,
80-
// })
81114
await githubFetch(`/repos/${owner}/${repo}/issues/${issue}/labels`, {
82115
method: "POST",
83116
body: JSON.stringify({ labels }),
84117
})
85-
results.push(`Added labels: ${args.labels.join(", ")}`)
118+
results.push(`Added labels: ${labels.join(", ")}`)
86119
}
87120

88121
return results.join("\n")

.opencode/tool/github-triage.txt

Lines changed: 3 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,6 @@
11
Use this tool to assign and/or label a GitHub issue.
22

3-
You can assign the following users:
4-
- thdxr
5-
- adamdotdevin
6-
- fwang
7-
- jayair
8-
- kommander
9-
- rekram1-node
3+
Choose labels and assignee using the current triage policy and ownership rules.
4+
Pick the most fitting labels for the issue and assign one owner.
105

11-
12-
You can use the following labels:
13-
- nix
14-
- opentui
15-
- perf
16-
- web
17-
- zen
18-
- docs
19-
20-
Always try to assign an issue, if in doubt, assign rekram1-node to it.
21-
22-
## Breakdown of responsibilities:
23-
24-
### thdxr
25-
26-
Dax is responsible for managing core parts of the application, for large feature requests, api changes, or things that require significant changes to the codebase assign him.
27-
28-
This relates to OpenCode server primarily but has overlap with just about anything
29-
30-
### adamdotdevin
31-
32-
Adam is responsible for managing the Desktop/Web app. If there is an issue relating to the desktop app or `opencode web` command. Assign him.
33-
34-
35-
### fwang
36-
37-
Frank is responsible for managing Zen, if you see complaints about OpenCode Zen, maybe it's the dashboard, the model quality, billing issues, etc. Assign him to the issue.
38-
39-
### jayair
40-
41-
Jay is responsible for documentation. If there is an issue relating to documentation assign him.
42-
43-
### kommander
44-
45-
Sebastian is responsible for managing an OpenTUI (a library for building terminal user interfaces). OpenCode's TUI is built with OpenTUI. If there are issues about:
46-
- random characters on screen
47-
- keybinds not working on different terminals
48-
- general terminal stuff
49-
Then assign the issue to Him.
50-
51-
### rekram1-node
52-
53-
ALL BUGS SHOULD BE assigned to rekram1-node unless they have the `opentui` label.
54-
55-
Assign Aiden to an issue as a catch all, if you can't assign anyone else. Most of the time this will be bugs/polish things.
56-
If no one else makes sense to assign, assign rekram1-node to it.
57-
58-
Always assign to aiden if the issue mentions "acp", "zed", or model performance issues
59-
60-
## Breakdown of Labels:
61-
62-
### nix
63-
64-
Any issue that mentions nix, or nixos should have a nix label
65-
66-
### opentui
67-
68-
Anything relating to the TUI itself should have an opentui label
69-
70-
### perf
71-
72-
Anything related to slow performance, high ram, high cpu usage, or any other performance related issue should have a perf label
73-
74-
### desktop
75-
76-
Anything related to `opencode web` command or the desktop app should have a desktop label. Never add this label for anything terminal/tui related
77-
78-
### zen
79-
80-
Anything related to OpenCode Zen, billing, or model quality from Zen should have a zen label
81-
82-
### docs
83-
84-
Anything related to the documentation should have a docs label
85-
86-
### windows
87-
88-
Use for any issue that involves the windows OS
6+
If unsure, choose the team/section with the most overlap with the issue and assign a member from that team at random.

packages/script/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ const team = [
5454
"kommander",
5555
"jayair",
5656
"fwang",
57+
"MrMushrooooom",
5758
"adamdotdevin",
5859
"iamdavidhill",
60+
"Brendonovich",
61+
"nexxeln",
62+
"Hona",
63+
"jlongster",
5964
"opencode-agent[bot]",
6065
"R44VC0RP",
6166
]

0 commit comments

Comments
 (0)