Skip to content

Support create-issue: false to disable automatic issue output - #69369

Merged
pelikhan merged 3 commits into
mainfrom
copilot/allow-opting-out-create-issue
Oct 16, 2026
Merged

pelikhan merged 3 commits into
mainfrom
copilot/allow-opting-out-create-issue

Conversation

Copilot AI commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflows with only builtin safe outputs automatically receive a create_issue tool and an instruction to use it, with no explicit opt-out. This can contradict workflows that must not publish issues.

safe-outputs:
  create-issue: false
  • Configuration: Accept explicit false; suppress both the tool and automatic reporting instruction.
  • Imports: Preserve disablement through merging while retaining top-level configuration precedence.
  • Compatibility: Keep builtin outputs enabled and existing default, null, and object configurations unchanged.
  • Documentation: Replace the misleading opt-out guidance with the supported configuration.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to opt out of auto-injected create-issue Support create-issue: false to disable automatic issue output Oct 16, 2026
Copilot AI requested a review from pelikhan October 16, 2026 13:36
@pelikhan
pelikhan marked this pull request as ready for review October 16, 2026 13:39
Copilot AI max review requested due to automatic review settings October 16, 2026 13:39
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · sonnet50 · 14.2 AIC · ⌖ 15 AIC · ◇ 6.64 AIC · ⊞ 12.6K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · gpt56 · 7.63 AIC · ⌖ 5.33 AIC · ⊞ 14.6K · ◷

Generated by Ponytail Reviewer for #69369

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Commit pushed: d7f951c

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (146 new lines in pkg/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/69369-explicit-create-issue-opt-out.md — review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch — it was generated from the PR diff (create_issue.go, imports.go, safe_outputs_config_extraction.go, safe_outputs_config_types.go, safe_outputs_state.go, main_workflow_schema.json)
  2. Complete the missing sections — add context the AI couldn't infer, refine the decision rationale, and list real alternatives you considered
  3. Commit the finalized ADR to docs/adr/ on your branch
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-69369: Support Explicit create-issue: false Opt-Out for Safe Outputs

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

❓ Why ADRs Matter

"AI made me procrastinate on key design decisions. Because refactoring was cheap, I could always say 'I'll deal with this later.' Deferring decisions corroded my ability to think clearly."

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · opus50 · 42.9 AIC · ⌖ 51.3 AIC · ⊞ 1.9K · ◷
Comment /review to run again

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-16T13:42:51Z
review_event: REQUEST_CHANGES
top_themes:
  - incomplete create-issue opt-out
  - report-incomplete still opens issues
files_reviewed:
  - docs/src/content/docs/reference/safe-outputs.md
  - pkg/parser/schema_safe_outputs_target_test.go
  - pkg/parser/schemas/main_workflow_schema.json
  - pkg/workflow/create_issue.go
  - pkg/workflow/imports.go
  - pkg/workflow/safe_outputs_config_extraction.go
  - pkg/workflow/safe_outputs_config_types.go
  - pkg/workflow/safe_outputs_default_create_issue_test.go
  - pkg/workflow/safe_outputs_state.go
comment_count: 1

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 85.6 AIC · ⌖ 5.91 AIC · ⊞ 12.5K · ◷
Comment /review to run again

@github-actions github-actions Bot 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.

Verdict

No actionable blocking issues found in the diff.

ScopeReviewed the create-issue opt-out flow across schema validation, config extraction, import merge precedence, default injection, tests, and docs. The behavior looks consistent and the added coverage hits the key cases.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 85.6 AIC · ⌖ 5.91 AIC · ⊞ 12.5K
Comment /review to run again

// instruction for the agent. This aligns create-issue with the other builtin safe outputs
// (noop, missing-tool, missing-data) that are always available.
func applyDefaultCreateIssue(workflowData *WorkflowData) {
if workflowData.SafeOutputs != nil && workflowData.SafeOutputs.CreateIssuesDisabled {

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.

create-issue: false is not a complete opt-out here: it skips the auto-injected create_issue tool, but the implicit report-incomplete.create-issue default is still true, so these workflows can still publish GitHub issues on incomplete runs.

💡 Why this blocks the feature contract The PR promises a way for workflows to disable issue publication entirely, especially for workflows that must not open issues. Right now `extractSafeOutputsConfig` still auto-defaults `report-incomplete.create-issue` from `defaultReportIncompleteCreateIssue(config)`, and nothing in this new early return overrides that when `CreateIssuesDisabled` is set. That leaves a second issue-creation path enabled and can still require `issues: write` unexpectedly.

A minimal fix is to force the implicit report-incomplete default to false whenever create-issue: false is set, unless the workflow explicitly sets report-incomplete.create-issue itself. For example:

if _, exists := outputMap["report-incomplete"]; !exists {
    value := defaultReportIncompleteCreateIssue(config)
    if config.CreateIssuesDisabled {
        value = "false"
    }
    config.ReportIncomplete = &ReportIncompleteConfig{
        CreateIssue: &value,
        TitlePrefix: "",
        Labels: nil,
        Implicit: true,
    }
}

That keeps the explicit report-incomplete: configuration as the override while making the new opt-out actually close the implicit issue path.

@pelikhan
pelikhan merged commit 8fa2ae4 into main Oct 16, 2026
7 checks passed
@pelikhan
pelikhan deleted the copilot/allow-opting-out-create-issue branch October 16, 2026 13:52

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — found one correctness regression that needs a fix before merge; everything else is well covered.

📋 Key Themes & Highlights

Key Themes

  • Early-return ordering bug in applyDefaultCreateIssue (pkg/workflow/safe_outputs_state.go:198): the new CreateIssuesDisabled check returns before the repo-memory ledger block runs, so create-issue: false combined with a configured repo-memory ledger silently drops ThreatDetection/NoOp setup that previously always ran. Verified with a standalone reproduction test. See inline comment for a suggested fix and the missing regression test case.

Positive Highlights

  • ✅ Thorough test coverage for the main opt-out path: schema validation (true/string/zero-max correctly rejected), auto-injection suppression, import precedence (main overrides import, import-only disables, explicit re-enable via {} or null), and compiled lock-file assertions that create_issue tooling/prompt text are actually absent.
  • ✅ Clean, minimal schema addition (const: false) consistent with existing oneOf pattern for other nullable/boolean safe-output fields.
  • ✅ Docs update correctly describes the new opt-out and clarifies the auto-injection caveat.

Note: investigation was bounded to the pre-fetched diff plus targeted reads of applyDefaultCreateIssue, mergeSafeOutputConfig, and the repo-memory ledger helpers — no open-ended tracing was needed given the diff size.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 116 AIC · ⌖ 15 AIC · ⊞ 10.1K
Comment /matt to run again

// instruction for the agent. This aligns create-issue with the other builtin safe outputs
// (noop, missing-tool, missing-data) that are always available.
func applyDefaultCreateIssue(workflowData *WorkflowData) {
if workflowData.SafeOutputs != nil && workflowData.SafeOutputs.CreateIssuesDisabled {

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.

[/diagnosing-bugs] Returning early here also skips the repo-memory ledger setup (ThreatDetection + NoOp) a few lines below, which is unrelated to create-issue and previously always ran. A workflow with create-issue: false and a repo-memory ledger configured will silently lose its ledger audit wiring.

💡 Repro and suggested fix

Confirmed with a standalone test: calling applyDefaultCreateIssue on a WorkflowData with SafeOutputs.CreateIssuesDisabled: true and a RepoMemoryConfig containing a Ledger entry leaves ThreatDetection and NoOp both nil after the call, whereas before this PR they were always populated when a ledger was configured.

Fix: move the CreateIssuesDisabled check so it only short-circuits the create-issue injection block, not the repo-memory ledger block, e.g.:

func applyDefaultCreateIssue(workflowData *WorkflowData) {
	if workflowData.CommentMemoryConfig != nil || hasNonBuiltinSafeOutputsEnabled(workflowData.SafeOutputs) {
		return
	}
	if repoMemoryLedgerEnabled(workflowData.RepoMemoryConfig) {
		// ... existing ledger setup, unaffected by CreateIssuesDisabled
		return
	}
	if workflowData.SafeOutputs != nil && workflowData.SafeOutputs.CreateIssuesDisabled {
		return
	}
	// ... existing create-issue injection
}

Please add a regression test combining create-issue: false with a configured repo-memory ledger to lock in the expected ThreatDetection/NoOp setup.

@copilot please address this.

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 opt-out can bypass required repo-memory ledger audit setup when all builtin outputs are disabled.

1 open finding
What changed in this PR

Adds create-issue: false to gh-aw workflows so authors can disable automatic issue output.

Changes:

  • Supports explicit disablement of the issue tool and reporting instruction.
  • Preserves import precedence and existing defaults.
  • Adds regression coverage and documents the opt-out.
File Description
pkg/​workflow/​safe_outputs_state.go Skips automatic issue injection when disabled.
pkg/​workflow/​safe_outputs_default_create_issue_test.go Tests suppression, builtins, and import precedence.
pkg/​workflow/​safe_outputs_config_types.go Tracks explicit disablement.
pkg/​workflow/​safe_outputs_config_extraction.go Extracts the disablement flag.
pkg/​workflow/​imports.go Preserves imported disablement.
pkg/​workflow/​create_issue.go Handles false during parsing.
pkg/​parser/​schemas/​main_workflow_schema.json Accepts explicit false.
pkg/​parser/​schema_safe_outputs_target_test.go Tests accepted and rejected configurations.
docs/​src/​content/​docs/​reference/​safe-outputs.md Documents the supported opt-out.

🧠 Review effort: Max


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +198 to +200
if workflowData.SafeOutputs != nil && workflowData.SafeOutputs.CreateIssuesDisabled {
return
}
github-actions Bot added a commit that referenced this pull request Oct 17, 2026
…eat-detection ca-cert

PR #69369 added the create-issue: false opt-out and PR #69364 added
safe-outputs.threat-detection.ca-cert, updating docs/src/content/docs/reference
but not the agent-facing .github/aw instruction files.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

Allow opting out of the auto-injected create-issue safe output

3 participants