Skip to content

feat: add Kilo auto-close workflow - #11040

Merged
johnnyeric merged 1 commit into
mainfrom
johnnyeric/auto-close-stale
Jun 9, 2026
Merged

feat: add Kilo auto-close workflow#11040
johnnyeric merged 1 commit into
mainfrom
johnnyeric/auto-close-stale

Conversation

@johnnyeric

@johnnyeric johnnyeric commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Context

Kilo inherited upstream stale-closing workflows, but the policies we want for Kilo-Org/kilocode differ from upstream anomalyco/opencode and should not be re-edited during regular upstream merges.

This PR separates Kilo's stale PR/issue closing automation into a dedicated kilo-auto-close workflow and gates the upstream workflows so they only run in the upstream repository. That keeps Kilo behavior explicit while preserving upstream workflow files for easier future merges.

Important rollout note for reviewers: KILO_AUTO_CLOSE_ENABLED is currently set to false, so scheduled runs default to dry-run mode. I will manually dispatch dry runs first, review the logged candidates/actions, and only enable KILO_AUTO_CLOSE_ENABLED=true after the dry-run output looks correct.

Implementation

Adds .github/workflows/kilo-auto-close.yml based on upstream close-stale-prs.yml as the Kilo-owned workflow for both stale PRs and stale issues:

  • Scheduled and manually dispatchable workflow with a dryRun input that defaults to true.
  • Scheduled runs derive dry-run behavior from vars.KILO_AUTO_CLOSE_ENABLED; with the current value false, scheduled runs only log what would be closed.
  • PR inactivity cutoff is 30 days, based on latest activity from PR creation, last commit, last comment, or last review.
  • Issue inactivity cutoff is 60 days, using oldest-updated issue pagination and stopping once fresh issues are reached.
  • Real close mode comments before closing PRs/issues and closes issues with state_reason: not_planned.
  • API calls retain retry/backoff handling and per-item delays to avoid GitHub secondary rate limits.

Also gates the inherited upstream workflows:

  • close-stale-prs.yml now only runs for anomalyco/opencode, with a kilocode_change note pointing reviewers to kilo-auto-close.yml.
  • close-issues.yml now only runs for anomalyco/opencode, with the same Kilo isolation note.
  • script/check-workflows.ts allowlist includes kilo-auto-close.yml so CI explicitly accepts this new runnable workflow.

Screenshots / Video

Actions Variable
image

How to Test

Manual/local verification

  • Agent: bun run script/check-workflows.ts: passed with check-workflows: ok (30 workflows).
  • Ageht: bun turbo typecheck: passed for all 17 turbo tasks before the branch was pushed.

Reviewer test steps

  1. Open Actions > kilo-auto-close.
  2. Manually dispatch with dryRun=true and confirm logs show candidate PRs/issues without commenting or closing anything.
  3. Confirm repository variable KILO_AUTO_CLOSE_ENABLED remains false during initial rollout so scheduled runs also dry-run.
  4. After dry-run output is reviewed and accepted, set KILO_AUTO_CLOSE_ENABLED=true to enable scheduled real closing.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Comment thread .github/workflows/kilo-auto-close.yml
Comment thread .github/workflows/kilo-auto-close.yml Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Incremental review of the latest commit (c98e092292) — no new issues found. The previously flagged issues were resolved in prior commits and remain fixed:

  • WARNING (line 89): The unnecessary sleep on the final retry attempt is fixed — break exits before reaching sleep() on attempt === MAX_RETRIES - 1.
  • SUGGESTION (line 50): dryRunInput !== "false" correctly handles GitHub Actions boolean-as-string behavior.
Files Reviewed (4 files)
  • .github/workflows/kilo-auto-close.yml — no issues
  • .github/workflows/close-stale-prs.yml — no issues (gate to upstream-only)
  • .github/workflows/close-issues.yml — no issues (gate to upstream-only)
  • script/check-workflows.ts — no issues (allowlist updated)

Reviewed by claude-4.6-sonnet-20260217 · 500,030 tokens

Review guidance: REVIEW.md from base branch main

@johnnyeric
johnnyeric force-pushed the johnnyeric/auto-close-stale branch from 4585173 to 94af2b3 Compare June 9, 2026 12:57
@johnnyeric
johnnyeric force-pushed the johnnyeric/auto-close-stale branch from 94af2b3 to c98e092 Compare June 9, 2026 13:46
@johnnyeric
johnnyeric merged commit 7f84c13 into main Jun 9, 2026
19 checks passed
@johnnyeric
johnnyeric deleted the johnnyeric/auto-close-stale branch June 9, 2026 14:09
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants