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
Require a pre-output checklist before creating suggestion blocks so Elastic substitution syntax is never included in apply-ready review suggestions.
Made-with: Cursor
Co-authored-by: GPT-5.5 <gpt-5.5@openai.com>
Copy file name to clipboardExpand all lines: .github/workflows/gh-aw-docs-review.md
+17-3Lines changed: 17 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -207,7 +207,7 @@ Report only findings that are:
207
207
208
208
Use line-level review comments when you can point to an exact changed line or nearby changed hunk. Keep each inline comment narrowly scoped.
209
209
210
-
When helpful, include a concrete replacement sentence, frontmatter snippet, or markdown wording in the comment body. Prefer GitHub suggestion blocks whenever the proposed edit cleanly maps to the reviewed line or hunk and can be applied directly. Fall back to plain prose only when the change is too large, crosses multiple distant hunks, or the exact replacement range is ambiguous.
210
+
When helpful, include a concrete replacement sentence, frontmatter snippet, or markdown wording in the comment body. Prefer GitHub suggestion blocks only after passing the pre-output checklist below, and only when the proposed edit cleanly maps to the reviewed line or hunk and can be applied directly. Fall back to plain prose when the change is too large, crosses multiple distant hunks, includes protected substitution syntax, or the exact replacement range is ambiguous.
211
211
212
212
The review comment safe output allows a maximum of 20 inline comments. Use that budget carefully:
213
213
@@ -218,11 +218,25 @@ The review comment safe output allows a maximum of 20 inline comments. Use that
218
218
219
219
For inline comments with concrete replacements:
220
220
221
-
- prefer one apply-ready GitHub suggestion over a prose description,
221
+
- prefer one apply-ready GitHub suggestion over a prose description only after passing the pre-output checklist below,
222
222
- keep the suggested replacement as small as possible while still fixing the issue, and
223
223
- avoid suggestion blocks only when GitHub would not be able to apply them cleanly.
224
224
225
-
Do not use GitHub suggestion blocks when the proposed replacement contains Elastic substitution syntax such as `{{...}}`. Safe-output sanitization may escape the braces before GitHub applies the suggestion. In those cases, provide the exact replacement as prose, or suggest only the part of the line that does not include the substitution.
225
+
Before creating any inline review comment, inspect the exact comment body you are about to send.
226
+
227
+
If the comment body would contain a GitHub suggestion block and either the original reviewed line or the proposed replacement contains Elastic substitution syntax such as `{{...}}`, do not create the suggestion block. This is a hard rule. Safe-output sanitization can escape curly braces and corrupt substitutions when GitHub applies the suggestion.
228
+
229
+
For these cases, use one of these alternatives instead:
230
+
231
+
- Leave a prose-only inline comment with the exact replacement text outside a suggestion block.
232
+
- If only part of the line needs changing, suggest only the substring that does not include `{{`, `}}`, or escaped variants such as `\{\{`.
233
+
- If every useful replacement would include substitution syntax, do not include an apply-ready suggestion.
234
+
235
+
Pre-output checklist for every `create_pull_request_review_comment` call:
236
+
237
+
1. Does the comment body include a fenced `suggestion` block?
238
+
2. Does the original reviewed line or suggested replacement include `{{`, `}}`, `\{\{`, or `\}\}`?
239
+
3. If both are true, rewrite the comment before calling the tool so it has no `suggestion` block.
0 commit comments