Skip to content

ci: add AI issue triage and issue lifecycle workflows - #4490

Merged
mpivchev merged 18 commits into
masterfrom
issue-triage-agent
Nov 27, 2026
Merged

mpivchev merged 18 commits into
masterfrom
issue-triage-agent

Conversation

@mpivchev

@mpivchev mpivchev commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Add two issue automation workflows:

  • issue-triage.md: a GitHub Agentic Workflow that checks weekly whether open bug reports and feature requests are already fixed or implemented and closes them with evidence. It comments on and closes at most 20 fixed issues per run for now, also on pull requests that change the workflow, and lists every finding in the run summary.
  • issue-lifecycle.yml: labels issues "stale" after 30 days without a human comment, removes the label once someone replies, and escalates issues closed by the triage agent when a human objects.

Supporting changes:

  • Exclude the generated *.lock.yml workflows from Dependabot, since gh aw compile updates their action pins.
  • Cover the generated lock files with a REUSE.toml annotation.
  • Ignore the gh aw logs / gh aw audit downloads in .github/aw/logs/.
  • Document the new workflows and the recompile step in AGENTS.md.

Assisted-by: Claude Code:claude-fable-5-2

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

Add two issue automation workflows:

- issue-triage.md: a GitHub Agentic Workflow that checks weekly whether
  open bug reports and feature requests are already fixed or implemented
  and closes them with evidence. It only closes issues when the
  ISSUE_TRIAGE_LIVE repository variable is "true"; otherwise, and on pull
  requests that change the workflow, it lists what it would close.
- issue-lifecycle.yml: labels issues "stale" after 30 days without a
  human comment, removes the label once someone replies, and escalates
  issues closed by the triage agent when a human objects.

Supporting changes:

- Exclude the generated *.lock.yml workflows from Dependabot, since
  `gh aw compile` updates their action pins.
- Cover the generated lock files with a REUSE.toml annotation.
- Ignore the `gh aw logs` / `gh aw audit` downloads in .github/aw/logs/.
- Document the new workflows and the recompile step in AGENTS.md.

Assisted-by: Claude Code:claude-fable-5-2
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 16:46
@mpivchev
mpivchev marked this pull request as draft November 24, 2026 16:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The compiled triage workflow is missing, preventing execution, and an unresolved lifecycle race can incorrectly label issues stale after a human reply.

7 open issues
What changed in this PR

Introduces issue automation for the Nextcloud iOS repository: AI-assisted checks for resolved reports, stale labeling, and escalation of agent-closed issues.

Changes:

  • Adds weekly triage workflow source with evidence-based closure instructions and live-mode safeguards.
  • Adds daily stale-label scans and comment/reopen handlers.
  • Documents workflow compilation and adjusts dependency updates, licensing coverage, and ignored logs.
File Description
REUSE.toml Adds licensing coverage for generated workflow and action-lock files.
AGENTS.md Documents issue automation and the required recompile step.
.gitignore Ignores downloaded workflow logs and audit data.
.github/​workflows/​issue-triage.md Defines candidate selection, AI triage, previews, and guarded issue closure.
.github/​workflows/​issue-lifecycle.yml Adds stale labeling, activity handling, and escalation.
.github/​dependabot.yml Excludes generated workflow locks from dependency updates.

Review effort: Balanced

Comment on lines +130 to +131
if (change.stale) {
await github.rest.issues.addLabels({ owner, repo, issue_number: change.number, labels: ['stale'] });
Comment thread .github/workflows/issue-triage.md Outdated
Comment on lines +6 to +8
# GitHub Agentic Workflow. After editing the frontmatter, run `gh aw compile issue-triage` with
# gh-aw v1.2.2 (`gh extension install github/gh-aw --pin v1.2.2`) and commit the regenerated
# issue-triage.lock.yml; never edit the lock file. Body-only edits need no recompile.
Comment thread .github/workflows/issue-lifecycle.yml Outdated
script: |
const { owner, repo } = context.repo;
const dryRun = process.env.DRY_RUN === 'true';
const maxWrites = Number(process.env.MAX_WRITES) || 200;
cursor = repository.issues.pageInfo.hasNextPage ? repository.issues.pageInfo.endCursor : null;
} while (cursor);

// Deleted users have no author; they count as human.
return;
}

await github.rest.issues.update({ owner, repo, issue_number, state: 'open' });
Comment thread .github/workflows/issue-triage.md Outdated
Comment on lines +348 to +350
.replace(/<\/?(details|summary|img)\b[^>]*>/gi, '')
.replace(/!\[[^\]]*\]\([^)]*\)/g, '')
.replace(/https?:\/\/[^\s)\]>]+/g, url => (/^https:\/\/github\.com\/nextcloud\//.test(url) ? url : '(link removed)'))
failed.push(issue_number);
core.warning(`Closing #${issue_number} failed: ${error.message}`);

if (!commented) {
Generate issue-triage.lock.yml with gh-aw v1.2.2 and add the pinned
gh-aw-actions setup entry to .github/aw/actions-lock.json.

Drop the search_commits tool from the triage workflow's GitHub toolset
and mark generated *.lock.yml workflows as linguist-generated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
@mpivchev
mpivchev marked this pull request as ready for review November 24, 2026 17:07
mpivchev and others added 16 commits November 24, 2026 18:21
… prompt

Issue lifecycle now only logs stale label changes unless the repository
variable ISSUE_LIFECYCLE_LIVE is "true", for both adding and removing the
label. Escalation of agent-closed issues keeps running unconditionally.

Enable inlined-imports in the issue triage agentic workflow so the prompt
is embedded in the lock file instead of being read from the base branch on
pull request runs, and recompile the lock file. Since body edits now affect
the lock file, the header and AGENTS.md say to recompile after any edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Replace gpt-5-mini with claude-haiku-5.5 for the triage engine, threat
detection and the close-as-fixed AGENT_MODEL, and recompile the lock file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Use claude-sonnet-5.5 for the triage engine and close-as-fixed AGENT_MODEL.
Raise timeout to 30 min, max turns to 250, AI credits to 300/600 daily,
and the per-run issue limit and close_as_fixed max from 8 to 40.

Have the agent name the first release containing the fix (sorted by tag
creation date, accounting for older v-prefixed tags) in close comments.

Recompile the lock file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Add a report_findings safe output so the agent records a verdict
(fixed, likely_fixed, not_fixed, no_evidence) for every candidate,
including issues it leaves open. The findings are written as a table
to the workflow run summary and change nothing on GitHub; candidates
the agent did not report are listed separately.

Also tell the agent to read the large candidates file one issue at a
time with jq instead of cat, and to spend effort on candidates with
signals or checkable claims rather than keeping the work minimal.

Recompile the lock file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
The agent now reports every issue it checks with report_finding, written
as the comment it would post; fixed issues are closed with that comment
only in live mode. Findings are kept in the issue-triage-state artifact,
so each run continues where the last one stopped and skips issues
without new activity.

Runs share one concurrency queue and end on the credit budget instead
of the clock. Only commits on master or in a release count as a fix.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
With the whole backlog in one list, the agent stopped after three
issues on its own. A fixed list of 20 per run, which it is told to
finish, keeps runs predictable; the saved findings move the sweep on.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
A fixed number of issues per run is too limiting. Each run gets the
full list of unchecked issues again, and the prompt no longer suggests
leaving the rest for a later run, which is why the agent stopped after
three; the run now ends only when its credit budget is used up.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Long runs got more expensive per issue: every request re-read a growing
conversation, and budget notices invalidated the prompt cache.

- Turn off budget notices and compact the conversation at about 100k tokens.
- Leave AGENTS.md, unused Copilot tools and unused GitHub toolsets out of
  every request; raise max-turns to 3000.
- Write compact candidates: cleaned and cut text without template notes,
  one line per comment with [team]/[reporter] markers, one line per signal.
- Keep threat detection on its own prompt limit.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Removes the ISSUE_TRIAGE_LIVE preview switch: every run, including those
for pull requests that change the workflow, now comments on and closes
the issues the agent finds fixed. A run closes at most 5 (closeLimit),
and the agent stops once it has reported that many. Fixed findings over
the limit, or from earlier preview runs, are checked again next run.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
- Do not close an issue that got a human comment after the scan; the
  agent never saw it. The issue is checked again next run.
- A failed lookup before closing no longer records the finding as
  handled, so it is retried instead of lost.
- Remove www. links from posted comments, not only http(s) ones.
- Tell the agent about the closing footer so it adds no follow-up
  instructions of its own, require a named fix whose landing step 3
  confirmed before "fixed", and have it keep count of its "fixed"
  findings across conversation summaries.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
- Search for the implementing commit only in the file where the code
  was found, with dates: the whole-history search returned the oldest
  unrelated match and could exceed the 30-second command wait.
- Only count release tags as the first release, not stable-*,
  customized-* or branch-named tags.
- Use at most likely_fixed when that release predates the issue, since
  the reporter already had the change.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Removes the ISSUE_LIFECYCLE_LIVE switch and the pull request dry run:
the stale scan and unstale job now change labels on every run; only a
manual run with dry_run only logs them. Scans share one concurrency
group so a pull request scan and a scheduled one never overlap, and a
max_writes of 0 or below no longer falls back to 200 or lifts the cap.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
The first live run skimmed most candidates in batches and cited
features that were later removed (PiP in #828). Now:

- The agent reads one whole candidate per command.
- A jq helper summarizes a name's history per commit (lines added,
  removed, left), so the agent cites the change behind today's code and
  sees removals; git grep on the release confirms a removal shipped.
- It reads the cited commit's own lines, and "fixed" needs every part
  of the request in master today; comments name only that change's
  release.
- Closing checks that every commit and pull request link exists.
- The footer also fits feature requests and unreleased fixes.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
@mpivchev
mpivchev enabled auto-merge (squash) November 27, 2026 13:28
@mpivchev
mpivchev disabled auto-merge November 27, 2026 13:33
@mpivchev
mpivchev merged commit b2fc38d into master Nov 27, 2026
11 checks passed
@mpivchev
mpivchev deleted the issue-triage-agent branch November 27, 2026 13:33
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.

3 participants