Skip to content

Commit 1d20b06

Browse files
authored
Smoke Copilot: enforce add_comment budget in prompt (#34611)
1 parent 80265a5 commit 1d20b06

4 files changed

Lines changed: 43 additions & 9 deletions

File tree

.github/workflows/smoke-copilot.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ Talk like a caveman in all your responses and outputs. Use short, broken sentenc
145145

146146
**IMPORTANT: Keep all outputs extremely short and concise. Use single-line responses where possible. No verbose explanations.**
147147

148+
## Hard Limit: `add_comment` Budget
149+
150+
`safe-outputs.add-comment.max` is `2`. Never exceed 2 total `add_comment` calls in this run.
151+
152+
- Call #1 is required for the discussion interaction test (comment on latest discussion).
153+
- Call #2 depends on trigger:
154+
- `pull_request` event: post the brief PR summary comment, and **skip** the fun discussion follow-up comment.
155+
- non-`pull_request` event: **skip** the PR summary comment and post the fun discussion follow-up comment.
156+
148157
## Tool Access Overview
149158

150159
This workflow uses `cli-proxy: true`. The following MCP servers are **NOT available as MCP tools** — they are mounted exclusively as **shell CLI commands** (see `<mcp-clis>` section above). You **must** use them via the `bash` tool:
@@ -208,7 +217,7 @@ These are **not** MCP protocol tools — they are bash executables. Call them wi
208217
- Overall status: PASS or FAIL
209218
- Mention the pull request author and any assignees
210219

211-
4. Use the `add_comment` tool to add a **fun and creative comment** to the newly created discussion (use the temporary ID `aw_smoke_discussion` from step 11) - be playful and entertaining in your comment
220+
4. **Only if this workflow was NOT triggered by a pull_request event**: Use the `add_comment` tool to add a **fun and creative comment** to the newly created discussion (use the temporary ID `aw_smoke_discussion` from step 11) - be playful and entertaining in your comment
212221

213222
5. Use the `send_slack_message` tool to send a brief summary message (e.g., "Smoke test ${{ github.run_id }}: All tests passed! ✅")
214223

pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,15 @@ jobs:
240240

241241
**IMPORTANT: Keep all outputs extremely short and concise. Use single-line responses where possible. No verbose explanations.**
242242

243+
## Hard Limit: `add_comment` Budget
244+
245+
`safe-outputs.add-comment.max` is `2`. Never exceed 2 total `add_comment` calls in this run.
246+
247+
- Call #1 is required for the discussion interaction test (comment on latest discussion).
248+
- Call #2 depends on trigger:
249+
- `pull_request` event: post the brief PR summary comment, and **skip** the fun discussion follow-up comment.
250+
- non-`pull_request` event: **skip** the PR summary comment and post the fun discussion follow-up comment.
251+
243252
## Test Requirements
244253

245254
1. **GitHub MCP Testing**: Review the last 2 merged pull requests in __GH_AW_GITHUB_REPOSITORY__
@@ -270,13 +279,13 @@ jobs:
270279
- Timestamp
271280
- Pull request author and assignees
272281

273-
2. Add a **very brief** comment (max 5-10 lines) to the current pull request with:
282+
2. **Only if this workflow was triggered by a pull_request event**: Add a **very brief** comment (max 5-10 lines) to the current pull request with:
274283
- PR titles only (no descriptions)
275284
- ✅ or ❌ for each test result
276285
- Overall status: PASS or FAIL
277286
- Mention the pull request author and any assignees
278287

279-
3. Use the `add_comment` tool to add a **fun and creative comment** to the latest discussion (using the `discussion_number` you extracted in step 7) - be playful and entertaining in your comment
288+
3. **Only if this workflow was NOT triggered by a pull_request event**: Use the `add_comment` tool to add a **fun and creative comment** to the latest discussion (using the `discussion_number` you extracted in step 7) - be playful and entertaining in your comment
280289

281290
4. Use the `send_slack_message` tool to send a brief summary message (e.g., "Smoke test __GH_AW_GITHUB_RUN_ID__: All tests passed! ✅")
282291

@@ -899,4 +908,3 @@ jobs:
899908
setupGlobals(core, github, context, exec, io, getOctokit);
900909
const { main } = require('${{ runner.temp }}/gh-aw/actions/check_membership.cjs');
901910
await main();
902-

pkg/workflow/testdata/wasm_golden/WasmBinary/smoke-copilot.golden

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,15 @@ jobs:
240240

241241
**IMPORTANT: Keep all outputs extremely short and concise. Use single-line responses where possible. No verbose explanations.**
242242

243+
## Hard Limit: `add_comment` Budget
244+
245+
`safe-outputs.add-comment.max` is `2`. Never exceed 2 total `add_comment` calls in this run.
246+
247+
- Call #1 is required for the discussion interaction test (comment on latest discussion).
248+
- Call #2 depends on trigger:
249+
- `pull_request` event: post the brief PR summary comment, and **skip** the fun discussion follow-up comment.
250+
- non-`pull_request` event: **skip** the PR summary comment and post the fun discussion follow-up comment.
251+
243252
## Test Requirements
244253

245254
1. **GitHub MCP Testing**: Review the last 2 merged pull requests in __GH_AW_GITHUB_REPOSITORY__
@@ -270,13 +279,13 @@ jobs:
270279
- Timestamp
271280
- Pull request author and assignees
272281

273-
2. Add a **very brief** comment (max 5-10 lines) to the current pull request with:
282+
2. **Only if this workflow was triggered by a pull_request event**: Add a **very brief** comment (max 5-10 lines) to the current pull request with:
274283
- PR titles only (no descriptions)
275284
- ✅ or ❌ for each test result
276285
- Overall status: PASS or FAIL
277286
- Mention the pull request author and any assignees
278287

279-
3. Use the `add_comment` tool to add a **fun and creative comment** to the latest discussion (using the `discussion_number` you extracted in step 7) - be playful and entertaining in your comment
288+
3. **Only if this workflow was NOT triggered by a pull_request event**: Use the `add_comment` tool to add a **fun and creative comment** to the latest discussion (using the `discussion_number` you extracted in step 7) - be playful and entertaining in your comment
280289

281290
4. Use the `send_slack_message` tool to send a brief summary message (e.g., "Smoke test __GH_AW_GITHUB_RUN_ID__: All tests passed! ✅")
282291

@@ -899,4 +908,3 @@ jobs:
899908
setupGlobals(core, github, context, exec, io, getOctokit);
900909
const { main } = require('${{ runner.temp }}/gh-aw/actions/check_membership.cjs');
901910
await main();
902-

pkg/workflow/testdata/wasm_golden/fixtures/smoke-copilot.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ strict: true
113113

114114
**IMPORTANT: Keep all outputs extremely short and concise. Use single-line responses where possible. No verbose explanations.**
115115

116+
## Hard Limit: `add_comment` Budget
117+
118+
`safe-outputs.add-comment.max` is `2`. Never exceed 2 total `add_comment` calls in this run.
119+
120+
- Call #1 is required for the discussion interaction test (comment on latest discussion).
121+
- Call #2 depends on trigger:
122+
- `pull_request` event: post the brief PR summary comment, and **skip** the fun discussion follow-up comment.
123+
- non-`pull_request` event: **skip** the PR summary comment and post the fun discussion follow-up comment.
124+
116125
## Test Requirements
117126

118127
1. **GitHub MCP Testing**: Review the last 2 merged pull requests in ${{ github.repository }}
@@ -143,13 +152,13 @@ strict: true
143152
- Timestamp
144153
- Pull request author and assignees
145154

146-
2. Add a **very brief** comment (max 5-10 lines) to the current pull request with:
155+
2. **Only if this workflow was triggered by a pull_request event**: Add a **very brief** comment (max 5-10 lines) to the current pull request with:
147156
- PR titles only (no descriptions)
148157
- ✅ or ❌ for each test result
149158
- Overall status: PASS or FAIL
150159
- Mention the pull request author and any assignees
151160

152-
3. Use the `add_comment` tool to add a **fun and creative comment** to the latest discussion (using the `discussion_number` you extracted in step 7) - be playful and entertaining in your comment
161+
3. **Only if this workflow was NOT triggered by a pull_request event**: Use the `add_comment` tool to add a **fun and creative comment** to the latest discussion (using the `discussion_number` you extracted in step 7) - be playful and entertaining in your comment
153162

154163
4. Use the `send_slack_message` tool to send a brief summary message (e.g., "Smoke test ${{ github.run_id }}: All tests passed! ✅")
155164

0 commit comments

Comments
 (0)