Skip to content

Commit 003f6c3

Browse files
authored
[aw] Harden PR Sous Chef safe-output emission path (#39951)
1 parent 742d36c commit 003f6c3

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/pr-sous-chef.lock.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/pr-sous-chef.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ Move open non-draft PRs toward a state where a maintainer can investigate quickl
178178
6. If a `pr-processor` call returns non-JSON or an error, record `{pr_number: <N>, skip_reason: "sub_agent_error"}` in the `skipped` array of the run-summary noop payload and move to the next PR without retrying.
179179
7. Do not fetch full PR diffs or large file lists unless absolutely required for a skip decision.
180180
8. **Never finish without at least one safe-output tool call.** If you have not called `add_comment` or `update_pull_request`, you must call the run-summary `noop` (see **Run summary** below) before finishing.
181+
9. Call safe-output MCP tools directly (`add_comment`, `update_pull_request`, `push_to_pull_request_branch`, `noop`, `report_incomplete`). Do **not** use `gh pr comment`, `gh api ... -X POST`, or `safeoutputs ...` shell wrappers for write actions.
181182

182183
## Required skip rules per PR
183184

@@ -218,9 +219,9 @@ For each PR that is not skipped:
218219
- a short sentence asking Copilot to address unresolved review feedback.
219220
- Every `add_comment` must include `pr_number` set to the current PR's numeric `number` from the loop item.
220221
- Never emit `add_comment` without a numeric target field (`pr_number`/`pull_request_number`/`issue_number`/`item_number`) when `target: "*"` is configured.
221-
- Example:
222+
- Example (`add_comment` tool call):
222223
```json
223-
{"type":"add_comment","pr_number":12345,"body":"<!-- gh-aw-pr-sous-chef-nudge -->\n@copilot review all comments and address unresolved review feedback."}
224+
{"add_comment":{"pr_number":12345,"body":"<!-- gh-aw-pr-sous-chef-nudge -->\n@copilot review all comments and address unresolved review feedback."}}
224225
```
225226

226227
3. **Apply one additional forward-progress nudge**
@@ -242,6 +243,12 @@ At the end, call **exactly one** `noop` with a compact summary including counts
242243
- branch_update_attempts
243244
- formatter_pushes (number of PRs that had formatting fixes committed and pushed)
244245

246+
Example (`noop` tool call):
247+
248+
```json
249+
{"noop":{"message":"processed=4; skipped_checks_running=0; skipped_last_comment_from_sous_chef=2; nudged_review_comments=1; nudged_other=1; branch_update_attempts=0; formatter_pushes=0"}}
250+
```
251+
245252
## Formatting Requirements
246253

247254
- **Header Levels**: Use h3 (`###`) or lower for all headers in your report to maintain proper document hierarchy. Never use h1 (`#`) or h2 (`##`) headers.

0 commit comments

Comments
 (0)