Add body-allowed: false to close-discussion and close-issue safe-outputs#33639
Conversation
…fe-outputs Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
body-allowed: false to close-discussion and close-issue safe-outputs
|
@copilot terminology is allowed-body to match other fields |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Renamed throughout in commit |
|
@copilot rename allowed-body to allow-body |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in the latest commit — |
|
@copilot update safe outputs specification using w3c-spec-writer |
…ussion Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit
|
There was a problem hiding this comment.
Pull request overview
Adds an allow-body configuration knob for close-issue / close-discussion safe-outputs so workflows can close items without posting (or duplicating) a closing comment, while also adjusting generated tool schemas/metadata and documentation.
Changes:
- Introduces
allow-body(AllowBody/allow_body) config and propagates it through compiler handler configs and tool description constraints. - Adds
tools_meta.required_field_removalsand updates JS tool generation to removebodyfrominputSchema.requiredwhen configured. - Updates JS close handlers/tests plus docs/types; regenerates many workflow lockfiles accordingly.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/tool_description_enhancer.go | Appends a “no body” constraint to close tool descriptions when configured. |
| pkg/workflow/tool_description_enhancer_test.go | Adds coverage for the new close description constraint behavior. |
| pkg/workflow/safe_outputs_validation_config.go | Makes body optional in validation config for close issue/discussion. |
| pkg/workflow/safe_outputs_tools_generation.go | Adds ToolsMeta.required_field_removals and computes removals for close tools. |
| pkg/workflow/safe_outputs_tools_generation_test.go | Tests required-field removal computation. |
| pkg/workflow/compiler_safe_outputs_handlers.go | Passes allow_body into handler configs for close issue/discussion. |
| pkg/workflow/close_entity_helpers.go | Adds AllowBody to shared close config struct (YAML: allow-body). |
| docs/src/content/docs/reference/safe-outputs.md | Documents allow-body: false for close issue/discussion. |
| docs/src/content/docs/reference/safe-outputs-specification.md | Updates spec semantics and compile-time schema expectations for allow-body. |
| actions/setup/js/types/safe-outputs-config.d.ts | Adds allow-body to TS config types for close issue/discussion. |
| actions/setup/js/generate_safe_outputs_tools.cjs | Applies required_field_removals to generated tool schemas. |
| actions/setup/js/close_issue.test.cjs | Adds tests for allow_body: false behavior for close_issue. |
| actions/setup/js/close_entity_helpers.cjs | Implements comment suppression/dropping behavior when allow_body is false. |
| actions/setup/js/close_discussion.test.cjs | Adds tests for allow_body: false behavior for close_discussion. |
| actions/setup/js/close_discussion.cjs | Implements comment suppression when allow_body is false (discussion close path). |
| .github/workflows/workflow-skill-extractor.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/weekly-issue-summary.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/uk-ai-operational-resilience.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/typist.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/terminal-stylist.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/stale-repo-identifier.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/smoke-copilot.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/smoke-copilot-arm.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/sergo.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/semantic-function-refactor.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/schema-consistency-checker.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/safe-output-health.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/research.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/repository-quality-improver.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/repo-tree-map.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/repo-audit-analyzer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/python-data-charts.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/prompt-clustering-analysis.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/pr-nitpick-reviewer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/poem-bot.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/plan.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/pdf-summary.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/org-health-report.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/mcp-inspector.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/lockfile-stats.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/lint-monster.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/issue-arborist.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/github-remote-mcp-auth-test.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/github-mcp-tools-report.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/github-mcp-structural-analysis.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/firewall-escape.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/example-workflow-analyzer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/docs-noob-tester.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/developer-docs-consolidator.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/dependabot-go-checker.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/delight.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/deep-report.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-token-consumption-report.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-team-status.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-team-evolution-insights.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-syntax-error-quality.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-sentrux-report.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-security-red-team.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-security-observability.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-secrets-analysis.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-safe-outputs-conformance.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-safe-output-optimizer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-safe-output-integrator.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-repo-chronicle.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-rendering-scripts-verifier.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-regulatory.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-performance-summary.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-otel-instrumentation-advisor.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-observability-report.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-news.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-multi-device-docs-tester.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-mcp-concurrency-analysis.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-malicious-code-scan.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-issues-report.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-hippo-learn.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-grafana-otel-instrumentation-advisor.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-geo-optimizer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-function-namer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-firewall-report.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-experiment-report.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-doc-healer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-compiler-threat-spec-optimizer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-compiler-quality.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-code-metrics.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-cli-tools-tester.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-cli-performance.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-cache-strategy-analyzer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-architecture-diagram.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/daily-agentrx-trace-optimizer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/copilot-session-insights.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/copilot-pr-prompt-analysis.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/copilot-pr-nlp-analysis.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/copilot-pr-merged-report.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/copilot-cli-deep-research.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/copilot-agent-analysis.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/constraint-solving-potd.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/commit-changes-analyzer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/claude-code-user-docs-review.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/blog-auditor.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/auto-triage-issues.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/audit-workflows.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/artifacts-summary.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/api-consumption-report.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/agent-persona-explorer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
| .github/workflows/agent-performance-analyzer.lock.yml | Regenerated lockfile reflecting updated validation/tool metadata. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
actions/setup/js/close_discussion.cjs:298
- When
allow_bodyis true (default), this handler will still close the discussion even ifitem.bodyis missing/empty, resulting in a close without the expected explanatory comment. Consider returning an error unlessallow-body: falseis configured, to preserve the existing contract that close_discussion normally posts a comment.
- Files reviewed: 104/105 changed files
- Comments generated: 3
| StateReason string `yaml:"state-reason,omitempty"` // Only used for issues | ||
| AllowBody *bool `yaml:"allow-body,omitempty"` // If false, any body provided by the agent is dropped with a warning; close proceeds without a comment | ||
| } |
|
|
||
| **State Reasons**: `completed`, `not_planned`, `duplicate` (default: `completed`). Can also be set per-item in agent output. | ||
|
|
||
| **`allow-body: false`**: When set, any `body` field the agent provides is silently dropped (with a warning logged) and the issue is closed without posting a comment. Use this when you want to guarantee a clean close with no duplicate comment — for example, when a prior `add-comment` step already posted the summary. |
|
|
||
| **State Reasons**: `completed`, `not_planned`, `duplicate` (default: `completed`). Can also be set per-item in agent output. | ||
|
|
||
| **`allow-body: false`**: When set, any `body` field the agent provides is silently dropped (with a warning logged) and the issue is closed without posting a comment. Use this when you want to guarantee a clean close with no duplicate comment — for example, when a prior `add-comment` step already posted the summary. | ||
|
|
|
@copilot review all comments |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Addressed in the latest commit:
|
|
@copilot merge main and recompile, fix conflicts |
|
``
Please update the branch to resolve merge conflicts (mergeStateStatus: DIRTY). After addressing review feedback, run tests locally and push any fixes.
|
…wed-false-to-safe-outputs # Conflicts: # .github/workflows/daily-cache-strategy-analyzer.lock.yml # .github/workflows/daily-observability-report.lock.yml # .github/workflows/issue-arborist.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done — merged |
Without a declarative knob to suppress the closing comment, workflows that post a summary via
add-commentand then close cleanly can't prevent the agent from duplicating that comment in thebodyfield of the close operation — prompts alone can't guarantee this.Changes
BodyAllowed *booladded toCloseEntityConfig(shared byclose-issueandclose-discussion). Whenfalse:bodythe agent emits is dropped with a warning and the resource is closed without posting a commentbodyis removed from the MCP tool'srequiredarray at compile time (via newRequiredFieldRemovalsfield inToolsMeta)compiler_safe_outputs_handlers.gopassesbody_allowedinto the handler config;tool_description_enhancer.goemits the constraint text;safe_outputs_tools_generation.goaddscomputeRequiredFieldRemovals()and populatesToolsMeta.RequiredFieldRemovals; validation config makesbodyoptional for both close typesclose_entity_helpers.cjsandclose_discussion.cjsreadconfig.body_allowed; whenfalse, skip comment posting entirely;generate_safe_outputs_tools.cjsappliesrequired_field_removalsfrom tools_meta"body-allowed"?: booleanadded toCloseDiscussionConfigandCloseIssueConfiginsafe-outputs-config.d.tssafe-outputs.mdandsafe-outputs-specification.mdupdated with the new fieldExample
pr-sous-chef: requesting branch update — run: https://github.com/github/gh-aw/actions/runs/26197534576