Skip to content

Smoke Copilot: enforce add_comment budget in prompt before output phase#34611

Merged
mnkiefer merged 3 commits into
mainfrom
copilot/fix-smoke-copilot-failure
May 25, 2026
Merged

Smoke Copilot: enforce add_comment budget in prompt before output phase#34611
mnkiefer merged 3 commits into
mainfrom
copilot/fix-smoke-copilot-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 25, 2026

Smoke Copilot was intermittently failing late because the prompt could ask for more add_comment calls than safe-outputs.add-comment.max: 2 allows. This change moves the constraint into explicit early planning instructions so the model budgets comment calls up front instead of failing at safe-output processing time.

  • Prompt-level guardrail (primary fix)

    • Added a new Hard Limit: add_comment Budget section to smoke-copilot.md.
    • Explicitly defines the two-call budget and allocates calls by event type to prevent overproduction of comments.
  • Output contract tightened

    • Made output comment steps mutually exclusive:
      • pull_request runs: post the brief PR summary comment.
      • non-pull_request runs: post the fun discussion comment.
    • This removes the prior ambiguity where both could be produced in the same run.
  • Golden artifacts updated

    • Synced the same constraint language and conditional output rules in:
      • pkg/workflow/testdata/wasm_golden/fixtures/smoke-copilot.md
      • pkg/workflow/testdata/wasm_golden/WasmBinary/smoke-copilot.golden
      • pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden
## Hard Limit: `add_comment` Budget

`safe-outputs.add-comment.max` is `2`. Never exceed 2 total `add_comment` calls in this run.

- Call #1 is required in discussion interaction testing.
- Call #2 depends on trigger:
  - `pull_request` event: post PR summary comment; skip discussion follow-up comment.
  - non-`pull_request` event: skip PR summary comment; post discussion follow-up comment.

Copilot AI linked an issue May 25, 2026 that may be closed by this pull request
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Smoke Copilot improvement issue by enforcing output constraints Smoke Copilot: enforce add_comment budget in prompt before output phase May 25, 2026
Copilot AI requested a review from mnkiefer May 25, 2026 09:36
@mnkiefer
Copy link
Copy Markdown
Collaborator

@copilot Recompile worklfows

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 25, 2026

@copilot Recompile worklfows

I recompiled smoke-copilot (gh aw compile smoke-copilot --validate --verbose) and there were no resulting diffs, so the workflow lockfile is already up to date at a0f8760.

@mnkiefer mnkiefer marked this pull request as ready for review May 25, 2026 10:29
Copilot AI review requested due to automatic review settings May 25, 2026 10:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

⚠️ PR Code Quality Reviewer failed during code quality review.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #34611 does not have the 'implementation' label and has only 33 new lines of code in business logic directories (threshold: 100).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

🧪 Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. The only changes are to workflow markdown (.md) files and golden test fixtures (.golden). Test Quality Sentinel skipped.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Smoke Copilot prompt/test artifacts to explicitly budget add_comment safe-output calls up front (matching safe-outputs.add-comment.max: 2) and to make the two “extra comment” outputs mutually exclusive based on event type, preventing late safe-output failures caused by overproducing add_comment calls.

Changes:

  • Added a new “Hard Limit: add_comment Budget” section that explicitly caps total add_comment calls at 2 and pre-allocates them.
  • Tightened the Output contract so only one of the PR-summary comment vs. discussion follow-up comment can be produced (depending on pull_request vs. non-pull_request triggers).
  • Updated wasm golden artifacts and fixture markdown to match the new prompt rules.
Show a summary per file
File Description
pkg/workflow/testdata/wasm_golden/WasmBinary/smoke-copilot.golden Adds explicit add_comment budgeting and makes Output comment steps conditional by event type.
pkg/workflow/testdata/wasm_golden/fixtures/smoke-copilot.md Mirrors the new hard limit section and conditional Output instructions in the fixture prompt.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden Updates compiled golden output to reflect the new budgeting/conditional Output contract.
.github/workflows/smoke-copilot.md Adds the add_comment budget guardrail and makes the discussion Output comment conditional for non-PR runs.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 0

@github-actions github-actions Bot mentioned this pull request May 25, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 1.2M

Comment thread .github/workflows/smoke-copilot.md
@mnkiefer
Copy link
Copy Markdown
Collaborator

@copilot Implement suggested fix by github-actions.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 25, 2026

@copilot Implement suggested fix by github-actions.

Implemented in 4e0eb1f. I applied the github-actions suggestion by replacing brittle step-number references with semantic wording in the add_comment budget section, and synced the matching golden artifacts.

@mnkiefer mnkiefer merged commit 1d20b06 into main May 25, 2026
14 of 26 checks passed
@mnkiefer mnkiefer deleted the copilot/fix-smoke-copilot-failure branch May 25, 2026 11:16
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.

Smoke Copilot improvement

3 participants