Skip to content

Prevent documentation workflow tool retry loops - #69438

Merged
DeagleGross merged 2 commits into
dotnet:mainfrom
DeagleGross:deaglegross-fix-docs-workflow-tool-loop
Sep 22, 2026
Merged

DeagleGross merged 2 commits into
dotnet:mainfrom
DeagleGross:deaglegross-fix-docs-workflow-tool-loop

Conversation

@DeagleGross

@DeagleGross DeagleGross commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • clarify that trusted migration, breaking-change, and release-note directories are placement metadata only when those surfaces are independently required
  • prevent creation of a future-version release-note entry point or includes hierarchy when the docs repository does not already have that structure
  • stop denied-tool retry loops and require draft_failed for required operations that cannot be completed with permitted tools
  • add mkdir as the only new bash command so genuinely required documentation/article directories can be created while the semantic guardrails prevent unnecessary release-note hierarchy creation
  • preserve max-turns: 100 and keep wildcard shell access plus other broad or file-execution commands unavailable
  • add focused regression assertions for prompt policy, shell permissions, and the unchanged turn cap

Root cause

PR Documentation Check run 35718934996 successfully completed trusted setup, authentication, source analysis, and the canonical conceptual documentation edit. It then repeatedly tried excluded shell commands while attempting to create a nonexistent ASP.NET Core 12 release-note hierarchy. The agent exhausted the invocation cap with 429 Maximum LLM invocations exceeded (100 / 100) before emitting notify_source_pr, so downstream output validation failed.

This change fixes the control loop in the prompt and adds narrowly scoped defense-in-depth for legitimate directory creation. It adds only mkdir; it does not add wildcard bash, network commands, file-execution commands, or a higher turn cap.

Validation

  • python -m unittest discover -s .github/workflows/pr-docs-check -p "test_*.py"
  • gh aw compile pr-docs-check --strict --validate --approve
  • inspected the generated lock command to confirm mkdir is allowed while install, touch, cp, python3, curl, base64, rm, and wildcard agent shell grants remain absent
  • git diff --check

Copilot AI lite review requested due to automatic review settings September 22, 2026 11:38
@DeagleGross
DeagleGross requested review from a team and wtgodbe as code owners September 22, 2026 11:38

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.

Copilot review overview

🟡 Changes recommended

Strengthen the shell-permission regression test by comparing the complete parsed allowlist.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates the documentation workflow to prevent denied-tool retry loops and avoid creating nonexistent future release-note structures.

Changes:

  • Clarifies optional documentation surfaces and failure handling.
  • Adds workflow policy regression tests.
  • Regenerates workflow lock metadata while preserving permissions and turn limits.
File Summary
.github/​workflows/​pr-docs-check/​test_workflow_policy.py Adds policy and permission assertions.
.github/​workflows/​pr-docs-check.md Updates prompt policy and failure handling.
.github/​workflows/​pr-docs-check.lock.yml Regenerated workflow metadata.

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

@DeagleGross DeagleGross self-assigned this Sep 22, 2026
@DeagleGross
DeagleGross merged commit 933fe4c into dotnet:main Sep 22, 2026
12 checks passed
@DeagleGross
DeagleGross deleted the deaglegross-fix-docs-workflow-tool-loop branch September 22, 2026 13:45
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 23, 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.

3 participants