From 7cd8405b503c1ac88f18a3529e77c5e753dba35f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 09:23:52 +0000 Subject: [PATCH] [instructions] Document close-issue state-reason config modes Sync safe-outputs-content.md with the runtime state-reason selection added in #47045: scalar (fixed), list (agent-chosen subset), and omitted (agent chooses any of completed/not_planned/duplicate). Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/aw/safe-outputs-content.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/aw/safe-outputs-content.md b/.github/aw/safe-outputs-content.md index eb9904ff259..3037f7df44d 100644 --- a/.github/aw/safe-outputs-content.md +++ b/.github/aw/safe-outputs-content.md @@ -69,12 +69,14 @@ description: Safe-output reference for issue, discussion, comment, and pull requ required-labels: [automated] # Optional: only close if ALL these labels are present required-title-prefix: "[bot]" # Optional: only close matching prefix max: 20 # Optional: max closures (default: 1) - state-reason: "not_planned" # Optional: "completed" (default), "not_planned", "duplicate" + state-reason: "not_planned" # Optional: scalar fixes the reason; list lets the agent choose a subset; omit to let the agent choose any of "completed", "not_planned", "duplicate" allow-body: false # Optional: when false, any body the agent emits is dropped (warning logged) and the issue closes without a comment; defaults to true target-repo: "owner/repo" # Optional: cross-repository allowed-repos: [owner/other] # Optional: additional repos agent can close issues in ``` + `state-reason` has three config modes: **scalar** (`state-reason: not_planned`) fixes the reason; **list** (`state-reason: [not_planned, duplicate]`) restricts the agent to that subset; **omitted** lets the agent choose any of `completed`, `not_planned`, `duplicate`. In list/omitted modes a `state_reason` enum is injected into the `close_issue` tool schema and the agent's choice is validated at runtime. + Set `allow-body: false` to guarantee a clean close with no comment — useful when an earlier `add-comment` step already posted the summary and you want to prevent the agent from duplicating it. To close as a duplicate, the agent emits `duplicate_of` in the `close_issue` output (a bare number, `#N`, `owner/repo#N`, or issue URL) together with `state-reason: duplicate`; this creates a native GitHub duplicate relationship (a `marked_as_duplicate` timeline event) rather than just a comment.