7ea50aac14
* tweak: use theme tokens for debug bar surface * chore: update nix node_modules hashes * feat(tui): add heap snapshot functionality for TUI and server (#19028) * ci * change model for changelog * release: v1.3.2 * fix(opencode): skip typechecking generated models snapshot (#19018) * Revert "fix(app): more startup efficiency (#18985)" This reverts commit98b3340cee. * Revert "fix(app): startup efficiency (#18854)" This reverts commit546748a461. * effectify Worktree service (#18679) * fix: increase operations-per-run to 1000 and pin stale action to v10.2.0 The stale-issues workflow was hitting the default 30 operations limit, preventing it from processing all 2900+ issues/PRs. Increased to 1000 to handle the full backlog. Also pinned to exact v10.2.0 for reproducibility. * Add close-issues script and GitHub Action - Create script/github/close-issues.ts to close stale issues after 60 days - Add GitHub Action workflow to run daily at 2 AM - Remove old stale-issues workflow to avoid conflicts * Fix close-issues workflow permissions - Add contents: read permission for checkout - Use github.token instead of secrets.GITHUB_TOKEN * Process issues sequentially to avoid rate limits * Change issue close reason from not_planned to completed * fix(opencode): avoid snapshotting files over 2MB (#19043) * fix: provide merge context to beta conflict resolver (#19055) * tweak: only spawn lsp servers for files in current instance (or cwd if instance is global) (#19058) * fix: beta resolver typecheck + build smoke check (#19060) * fix: unblock beta conflict recovery (#19068) * electron: add createDirectory to open directory picker (#19071) * electron: remove file extension from electron-store wrapper (#19082) * app: pre-warm project globalSync state when navigate project via keybind (#19088) * fix(app): move message navigation off cmd+arrow (#18728) * Reapply "fix(app): startup efficiency (#18854)" This reverts commita379eb3867. * Reapply "fix(app): more startup efficiency (#18985)" This reverts commitcbe1337f24. * fix(app): hash inline script for csp * Revert "fix(app): startup efficiency" * Reapply "fix(app): startup efficiency" This reverts commit898456a25c. * fix(app): opencode web server url * chore(app): markdown playground in storyboard * chore(app): markdown playground in storyboard * feat(core): initial implementation of syncing (#17814) * chore: generate * chore: bump modelcontextprotocol/sdk to 1.27.1 (#19064) * chore: storybook tweaks * feat: restore git-backed review modes with effectful git service (#18900) * chore: generate * chore: update nix node_modules hashes * chore: cleanup * chore: remove dead code for todoread tool (#19128) * chore: storybook tweaks * fix(opencode): classify ZlibError from Bun fetch as retryable instead of unknown (#19104) Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> * fix(task): respect agent permission config for todowrite tool (#19125) * fix(app): agent normalization (#19169) * fix: Windows e2e stability (CrossSpawnSpawner, snapshot isolation, session race guards) (#19163) * fix+refactor(mcp): lifecycle tests, cancelPending fix, Effect migration (#19042) * effectify Bus service: migrate to Effect PubSub + InstanceState (#18579) * file: use Effect.cached for scan deduplication (#19164) * ignore: update disavowed list (#19184) * skill: use Effect.cached for load deduplication (#19165) * chore: generate * fix: bump gitlab-ai-provider to 5.3.3 for DWS tool approval support (#19185) * test: restore 5 workers on Windows e2e (#19188) * fix(opencode): image paste on Windows Terminal 1.25+ with kitty keyboard (#17674) * chore: update nix node_modules hashes * wip: zen * wip: zen * go: do not respect disabled zen models * fix: ensure enterprise url is set properly during auth flow (#19212) * revert: roll back git-backed review modes (#19295) * chore: generate * tui: bypass local SSE event streaming in worker (#19183) * feat: embed WebUI in binary with proxy flags (#19299) Co-authored-by: BlankParticle <blankparticle@gmail.com> * release: v1.3.3 * refactor: kilo compat for v1.3.3 * fix: Typecheck issues * fix(build): normalize backslashes in web UI bundle import paths Replace backslashes with forward slashes in embedded web UI file import paths to ensure correct module resolution on Windows. * fix: Add mcp reconnect error handling * chore(script): use forward slashes in web UI bundle export keys Ensure embedded file map keys use POSIX-style paths so lookups are consistent across platforms. * chore: regenerate source links --------- Co-authored-by: Jay V <air@live.ca> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Dax <mail@thdxr.com> Co-authored-by: Dax Raad <d@ironbay.co> Co-authored-by: opencode <opencode@sst.dev> Co-authored-by: Kit Langton <kit.langton@gmail.com> Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com> Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com> Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com> Co-authored-by: James Long <longster@gmail.com> Co-authored-by: André Cruz <acruz@cloudflare.com> Co-authored-by: Ariane Emory <97994360+ariane-emory@users.noreply.github.com> Co-authored-by: Vladimir Glafirov <vglafirov@gitlab.com> Co-authored-by: Frank <frank@anoma.ly> Co-authored-by: BlankParticle <blankparticle@gmail.com> Co-authored-by: Imanol Maiztegui <imanol.mzd@gmail.com>
98 lines
2.4 KiB
TypeScript
Executable File
98 lines
2.4 KiB
TypeScript
Executable File
#!/usr/bin/env bun
|
|
|
|
const repo = "anomalyco/opencode"
|
|
const days = 60
|
|
const msg =
|
|
"To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one."
|
|
|
|
const token = process.env.GITHUB_TOKEN
|
|
if (!token) {
|
|
console.error("GITHUB_TOKEN environment variable is required")
|
|
process.exit(1)
|
|
}
|
|
|
|
const cutoff = new Date(Date.now() - days * 24 * 60 * 60 * 1000)
|
|
|
|
type Issue = {
|
|
number: number
|
|
updated_at: string
|
|
}
|
|
|
|
const headers = {
|
|
Authorization: `Bearer ${token}`,
|
|
"Content-Type": "application/json",
|
|
Accept: "application/vnd.github+json",
|
|
"X-GitHub-Api-Version": "2022-11-28",
|
|
}
|
|
|
|
async function close(num: number) {
|
|
const base = `https://api.github.com/repos/${repo}/issues/${num}`
|
|
|
|
const comment = await fetch(`${base}/comments`, {
|
|
method: "POST",
|
|
headers,
|
|
body: JSON.stringify({ body: msg }),
|
|
})
|
|
if (!comment.ok) throw new Error(`Failed to comment #${num}: ${comment.status} ${comment.statusText}`)
|
|
|
|
const patch = await fetch(base, {
|
|
method: "PATCH",
|
|
headers,
|
|
body: JSON.stringify({ state: "closed", state_reason: "completed" }),
|
|
})
|
|
if (!patch.ok) throw new Error(`Failed to close #${num}: ${patch.status} ${patch.statusText}`)
|
|
|
|
console.log(`Closed https://github.com/${repo}/issues/${num}`)
|
|
}
|
|
|
|
async function main() {
|
|
let page = 1
|
|
let closed = 0
|
|
|
|
while (true) {
|
|
const res = await fetch(
|
|
`https://api.github.com/repos/${repo}/issues?state=open&sort=updated&direction=asc&per_page=100&page=${page}`,
|
|
{ headers },
|
|
)
|
|
if (!res.ok) throw new Error(res.statusText)
|
|
|
|
const all = (await res.json()) as Issue[]
|
|
if (all.length === 0) break
|
|
console.log(`Fetched page ${page} ${all.length} issues`)
|
|
|
|
const stale: number[] = []
|
|
for (const i of all) {
|
|
const updated = new Date(i.updated_at)
|
|
if (updated < cutoff) {
|
|
stale.push(i.number)
|
|
} else {
|
|
console.log(`\nFound fresh issue #${i.number}, stopping`)
|
|
if (stale.length > 0) {
|
|
for (const num of stale) {
|
|
await close(num)
|
|
closed++
|
|
}
|
|
}
|
|
console.log(`Closed ${closed} issues total`)
|
|
return
|
|
}
|
|
}
|
|
|
|
if (stale.length > 0) {
|
|
for (const num of stale) {
|
|
await close(num)
|
|
closed++
|
|
}
|
|
}
|
|
|
|
page++
|
|
}
|
|
|
|
console.log(`Closed ${closed} issues total`)
|
|
}
|
|
|
|
main().catch((err) => {
|
|
console.error("Error:", err)
|
|
process.exit(1)
|
|
})
|