You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: fix PR Sous Chef safe output failures by using safeoutputs CLI examples
The agent was confused by contradictory instructions: rule 9 said "do NOT use
safeoutputs shell wrappers" while the system prompt instructed it to run
`safeoutputs --help`. The agent tried `safeoutputs --help | sed ...` (blocked —
sed not in allow list), then fell back to a full binary path (blocked), and
gave up without emitting any safe outputs.
Changes:
- Rule 9: Replaced "do not use safeoutputs shell wrappers" with explicit
instruction to USE `safeoutputs <tool> --param value` CLI commands and NOT to
pipe them or run `--help`
- noop example: Changed from JSON `{"noop":{...}}` to CLI
`safeoutputs noop --message "..."`
- add_comment example: Changed from JSON to `safeoutputs add_comment --pr_number`
- Added update_pull_request example to prevent `gh pr update-branch` confusion
- Updated contract test to check `pr_number 12345` (CLI) instead of
`"pr_number":12345` (JSON)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy file name to clipboardExpand all lines: .github/workflows/pr-sous-chef.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,7 +179,7 @@ Move open non-draft PRs toward a state where a maintainer can investigate quickl
179
179
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.
180
180
7. Do not fetch full PR diffs or large file lists unless absolutely required for a skip decision.
181
181
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.
182
-
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.
182
+
9.Use `safeoutputs <tool> --param value` shell commands for all safe-output operations (`add_comment`, `update_pull_request`, `push_to_pull_request_branch`, `noop`, `report_incomplete`). Do **not** use `gh pr comment`, `gh pr update-branch`, `gh api ... -X POST`, or any GitHub API write calls outside of `safeoutputs`. Do **not** pipe `safeoutputs` to other commands or run `safeoutputs --help` — the tool schemas are already provided; use the examples below directly.
183
183
184
184
## Required skip rules per PR
185
185
@@ -211,6 +211,10 @@ For each PR that is not skipped:
211
211
1.**Update branch if possible**
212
212
- If the PR is behind its base branch (or otherwise indicates branch update needed), attempt `update_pull_request` with `update_branch: true`.
213
213
- Use a minimal append body marker so maintainers can trace the action, including `pr-sous-chef` and the run URL.
@@ -220,9 +224,9 @@ For each PR that is not skipped:
220
224
- a short sentence asking Copilot to address unresolved review feedback.
221
225
- Every `add_comment` must include `pr_number`set to the current PR's numeric `number` from the loop item.
222
226
- Never emit `add_comment` without a numeric target field (`pr_number`/`pull_request_number`/`issue_number`/`item_number`) when `target: "*"` is configured.
223
-
- Example (`add_comment`tool call):
224
-
```json
225
-
{"add_comment":{"pr_number":12345,"body":"<!-- gh-aw-pr-sous-chef-nudge -->\n@copilot review all comments and address unresolved review feedback."}}
227
+
- Example (`add_comment` shell call):
228
+
```bash
229
+
safeoutputs add_comment --pr_number12345 --body $'<!-- gh-aw-pr-sous-chef-nudge -->\n@copilot review all comments and address unresolved review feedback.'
226
230
```
227
231
228
232
3. **Apply one additional forward-progress nudge**
@@ -244,10 +248,10 @@ At the end, call **exactly one** `noop` with a compact summary including counts
244
248
- branch_update_attempts
245
249
- formatter_pushes (number of PRs that had formatting fixes committed and pushed)
0 commit comments