GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — core: simplify triage workflow to focus on issue ownership · tstachl/opencode@a08e4c9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .opencode
    • agent
      • triage.md
    • tool
      • github-triage.ts
  • script
    • triage-unassigned.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.opencode/agent/triage.md‎

Copy file name to clipboard
+7-19Lines changed: 7 additions & 19 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
mode: primary
33
hidden: true
4-
model: opencode/qwen3.6-plus
4+
model: opencode/gpt-5.4-nano
55
color: "#44BA81"
66
tools:
77
"*": false
@@ -14,42 +14,30 @@ Use your github-triage tool to triage issues.
1414

1515
This file is the source of truth for ownership/routing rules.
1616

17-
Assign issues by choosing the team with the strongest overlap, then assign a member from that team at random.
17+
Assign issues by choosing the team with the strongest overlap. The github-triage tool will assign a random member from that team.
18+
19+
Do not add labels to issues. Only assign an owner.
20+
21+
When calling github-triage, pass one of these team values: tui, desktop_web, core, inference, windows.
1822

1923
## Teams
2024

2125
### TUI
2226

2327
Terminal UI issues, including rendering, keybindings, scrolling, terminal compatibility, SSH behavior, crashes in the TUI, and low-level TUI performance.
2428

25-
- kommander
26-
- simonklee
27-
2829
### Desktop / Web
2930

3031
Desktop application and browser-based app issues, including `opencode web`, desktop-specific UI behavior, packaging, and web view problems.
3132

32-
- Hona
33-
- Brendonovich
34-
3533
### Core
3634

37-
Core opencode server and harness issues, including sqlite, snapshots, memory, API behavior, agent context construction, tool execution, provider integrations, model behavior, and larger architectural features.
38-
39-
- jlongster
40-
- rekram1-node
41-
- nexxeln
42-
- kitlangton
35+
Core opencode server and harness issues, including sqlite, snapshots, memory, API behavior, agent context construction, tool execution, provider integrations, model behavior, documentation, and larger architectural features.
4336

4437
### Inference
4538

4639
OpenCode Zen, OpenCode Go, and billing issues.
4740

48-
- fwang
49-
- MrMushrooooom
50-
5141
### Windows
5242

5343
Windows-specific issues, including native Windows behavior, WSL interactions, path handling, shell compatibility, and installation or runtime problems that only happen on Windows.
54-
55-
- Hona
Collapse file

‎.opencode/tool/github-triage.ts‎

Copy file name to clipboard
+10-68Lines changed: 10 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
/// <reference path="../env.d.ts" />
22
import { tool } from "@opencode-ai/plugin"
3+
34
const TEAM = {
4-
desktop: ["adamdotdevin", "iamdavidhill", "Brendonovich", "nexxeln"],
5-
zen: ["fwang", "MrMushrooooom"],
6-
tui: ["kommander", "rekram1-node", "simonklee"],
7-
core: ["kitlangton", "rekram1-node", "jlongster"],
8-
docs: ["R44VC0RP"],
5+
tui: ["kommander", "simonklee"],
6+
desktop_web: ["Hona", "Brendonovich"],
7+
core: ["jlongster", "rekram1-node", "nexxeln", "kitlangton"],
8+
inference: ["fwang", "MrMushrooooom"],
99
windows: ["Hona"],
1010
} as const
1111

12-
const ASSIGNEES = [...new Set(Object.values(TEAM).flat())]
13-
1412
function pick<T>(items: readonly T[]) {
1513
return items[Math.floor(Math.random() * items.length)]!
1614
}
@@ -38,79 +36,23 @@ async function githubFetch(endpoint: string, options: RequestInit = {}) {
3836
}
3937

4038
export default tool({
41-
description: `Use this tool to assign and/or label a GitHub issue.
39+
description: `Use this tool to assign a GitHub issue.
4240
43-
Choose labels and assignee using the current triage policy and ownership rules.
44-
Pick the most fitting labels for the issue and assign one owner.
45-
46-
If unsure, choose the team/section with the most overlap with the issue and assign a member from that team at random.`,
41+
Provide the team that should own the issue. This tool picks a random assignee from that team and does not apply labels.`,
4742
args: {
48-
assignee: tool.schema
49-
.enum(ASSIGNEES as [string, ...string[]])
50-
.describe("The username of the assignee")
51-
.default("rekram1-node"),
52-
labels: tool.schema
53-
.array(tool.schema.enum(["nix", "opentui", "perf", "web", "desktop", "zen", "docs", "windows", "core"]))
54-
.describe("The labels(s) to add to the issue")
55-
.default([]),
43+
team: tool.schema.enum(Object.keys(TEAM) as [keyof typeof TEAM, ...(keyof typeof TEAM)[]]).describe("The owning team"),
5644
},
5745
async execute(args) {
5846
const issue = getIssueNumber()
5947
const owner = "anomalyco"
6048
const repo = "opencode"
61-
62-
const results: string[] = []
63-
let labels = [...new Set(args.labels.map((x) => (x === "desktop" ? "web" : x)))]
64-
const web = labels.includes("web")
65-
const text = `${process.env.ISSUE_TITLE ?? ""}\n${process.env.ISSUE_BODY ?? ""}`.toLowerCase()
66-
const zen = /\bzen\b/.test(text) || text.includes("opencode black")
67-
const nix = /\bnix(os)?\b/.test(text)
68-
69-
if (labels.includes("nix") && !nix) {
70-
labels = labels.filter((x) => x !== "nix")
71-
results.push("Dropped label: nix (issue does not mention nix)")
72-
}
73-
74-
const assignee = nix ? "rekram1-node" : web ? pick(TEAM.desktop) : args.assignee
75-
76-
if (labels.includes("zen") && !zen) {
77-
throw new Error("Only add the zen label when issue title/body contains 'zen'")
78-
}
79-
80-
if (web && !nix && !(TEAM.desktop as readonly string[]).includes(assignee)) {
81-
throw new Error("Web issues must be assigned to adamdotdevin, iamdavidhill, Brendonovich, or nexxeln")
82-
}
83-
84-
if ((TEAM.zen as readonly string[]).includes(assignee) && !labels.includes("zen")) {
85-
throw new Error("Only zen issues should be assigned to fwang or MrMushrooooom")
86-
}
87-
88-
if (assignee === "Hona" && !labels.includes("windows")) {
89-
throw new Error("Only windows issues should be assigned to Hona")
90-
}
91-
92-
if (assignee === "R44VC0RP" && !labels.includes("docs")) {
93-
throw new Error("Only docs issues should be assigned to R44VC0RP")
94-
}
95-
96-
if (assignee === "kommander" && !labels.includes("opentui")) {
97-
throw new Error("Only opentui issues should be assigned to kommander")
98-
}
49+
const assignee = pick(TEAM[args.team])
9950

10051
await githubFetch(`/repos/${owner}/${repo}/issues/${issue}/assignees`, {
10152
method: "POST",
10253
body: JSON.stringify({ assignees: [assignee] }),
10354
})
104-
results.push(`Assigned @${assignee} to issue #${issue}`)
105-
106-
if (labels.length > 0) {
107-
await githubFetch(`/repos/${owner}/${repo}/issues/${issue}/labels`, {
108-
method: "POST",
109-
body: JSON.stringify({ labels }),
110-
})
111-
results.push(`Added labels: ${labels.join(", ")}`)
112-
}
11355

114-
return results.join("\n")
56+
return `Assigned @${assignee} from ${args.team} to issue #${issue}`
11557
},
11658
})
Collapse file

‎script/triage-unassigned.ts‎

Copy file name to clipboard
+129Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
#!/usr/bin/env bun
2+
3+
import { parseArgs } from "util"
4+
5+
async function run(command: string, args: string[], options: Bun.SpawnOptions.OptionsObject = {}) {
6+
const process = Bun.spawn([command, ...args], options)
7+
const status = await process.exited
8+
if (status !== 0) throw new Error(`${command} ${args.join(" ")} exited with ${status}`)
9+
return process
10+
}
11+
12+
async function text(command: string, args: string[]) {
13+
const process = await run(command, args, { stdout: "pipe", stderr: "inherit" })
14+
return new Response(process.stdout).text()
15+
}
16+
17+
async function main() {
18+
const { values } = parseArgs({
19+
args: Bun.argv.slice(2),
20+
options: {
21+
days: { type: "string", short: "d", default: "30" },
22+
limit: { type: "string", short: "l", default: "200" },
23+
"dry-run": { type: "boolean", default: false },
24+
help: { type: "boolean", short: "h", default: false },
25+
},
26+
})
27+
28+
if (values.help) {
29+
console.log(`
30+
Usage: bun script/triage-unassigned.ts [options]
31+
32+
Triage open GitHub issues created in the last 30 days with no assignee.
33+
34+
Options:
35+
-d, --days <days> Look back this many days (default: 30)
36+
-l, --limit <count> Maximum issues to process (default: 200)
37+
--dry-run Print matching issues without running triage
38+
-h, --help Show this help message
39+
40+
Examples:
41+
bun script/triage-unassigned.ts
42+
bun script/triage-unassigned.ts --limit 3
43+
bun script/triage-unassigned.ts --dry-run
44+
`)
45+
process.exit(0)
46+
}
47+
48+
const days = Number(values.days)
49+
const limit = Number(values.limit)
50+
if (!Number.isInteger(days) || days < 1) throw new Error("--days must be a positive integer")
51+
if (!Number.isInteger(limit) || limit < 1) throw new Error("--limit must be a positive integer")
52+
53+
const created = new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString().slice(0, 10)
54+
const query = `no:assignee created:>=${created}`
55+
const issues = JSON.parse(
56+
await text("gh", [
57+
"issue",
58+
"list",
59+
"--state",
60+
"open",
61+
"--search",
62+
query,
63+
"--limit",
64+
String(limit),
65+
"--json",
66+
"number,title,body",
67+
]),
68+
) as Array<{ number: number; title: string; body?: string | null }>
69+
70+
console.log(`Found ${issues.length} open unassigned issues created since ${created}`)
71+
if (issues.length === 0) return
72+
73+
if (values["dry-run"]) {
74+
for (const issue of issues) console.log(`#${issue.number} ${issue.title}`)
75+
return
76+
}
77+
78+
const githubToken = process.env.GITHUB_TOKEN || (await text("gh", ["auth", "token"])).trim()
79+
const failures: Array<{ issue: number; error: string }> = []
80+
81+
for (const [index, issue] of issues.entries()) {
82+
console.log(`\n[${index + 1}/${issues.length}] Triaging #${issue.number} ${issue.title}`)
83+
const result = Bun.spawn(
84+
[
85+
"opencode",
86+
"run",
87+
"--agent",
88+
"triage",
89+
`The following issue was just opened, triage it:
90+
91+
Issue: #${issue.number}
92+
Title: ${issue.title}
93+
94+
Body:
95+
${issue.body ?? ""}`,
96+
],
97+
{
98+
env: {
99+
...process.env,
100+
GITHUB_TOKEN: githubToken,
101+
ISSUE_NUMBER: String(issue.number),
102+
ISSUE_TITLE: issue.title,
103+
ISSUE_BODY: issue.body ?? "",
104+
},
105+
stdin: "inherit",
106+
stdout: "inherit",
107+
stderr: "inherit",
108+
},
109+
)
110+
const status = await result.exited
111+
112+
if (status === 0) {
113+
console.log(`[${index + 1}/${issues.length}] Done #${issue.number}`)
114+
continue
115+
}
116+
117+
failures.push({ issue: issue.number, error: `opencode exited with ${status}` })
118+
console.error(`[${index + 1}/${issues.length}] Failed #${issue.number}: opencode exited with ${status}`)
119+
}
120+
121+
console.log(`\nFinished triaging ${issues.length - failures.length}/${issues.length} issues`)
122+
if (failures.length === 0) return
123+
124+
console.error("Failures:")
125+
for (const failure of failures) console.error(`#${failure.issue}: ${failure.error}`)
126+
process.exit(1)
127+
}
128+
129+
void main()

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.