Skip to content

fix(pr-sous-chef): prevent back-to-back comments and add 30-min cooldown#41759

Merged
pelikhan merged 1 commit into
mainfrom
copilot/update-pr-sous-chef-behavior
Jun 26, 2026
Merged

fix(pr-sous-chef): prevent back-to-back comments and add 30-min cooldown#41759
pelikhan merged 1 commit into
mainfrom
copilot/update-pr-sous-chef-behavior

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

PR Sous Chef could post consecutive comments on the same PR (two nudges per run) and had no cooldown, allowing rapid re-engagement after a prior nudge.

Bash prefilter

  • Replaces the single-comment API fetch with a single call fetching the 10 most-recent comments, reused for both skip checks
  • Adds cooldown_seconds=1800 + filtered_cooldown counter; skips any PR where a <!-- gh-aw-pr-sous-chef-nudge -->-marked comment was posted within the last 30 minutes
  • Exposes filtered_cooldown in the compact candidates JSON passed to the agent

Agent prompt

  • New skip rule 3: documents the 30-min cooldown (mirrors the prefilter)
  • Merges nudge steps 2 + 3 into a single "post exactly one combined nudge comment" step — prevents two consecutive sous-chef comments within a run
  • pr-processor sub-agent updated to return a single combined nudge body instead of separate unresolved_review_feedback / additional_nudge fields
  • Noop summary: nudged_review_comments + nudged_othernudged; adds skipped_cooldown

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title fix(pr-sous-chef): prevent double comments and add 30-min cooldown fix(pr-sous-chef): prevent back-to-back comments and add 30-min cooldown Jun 26, 2026
Copilot AI requested a review from pelikhan June 26, 2026 17:07
@pelikhan pelikhan marked this pull request as ready for review June 26, 2026 17:18
Copilot AI review requested due to automatic review settings June 26, 2026 17:18
@pelikhan pelikhan merged commit 9f8f942 into main Jun 26, 2026
32 checks passed
@pelikhan pelikhan deleted the copilot/update-pr-sous-chef-behavior branch June 26, 2026 17:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 PR Sous Chef agentic workflow to prevent repetitive engagement on the same pull request by (1) ensuring only one nudge comment is posted per PR per run, and (2) adding a 30-minute cooldown window after a prior sous-chef nudge.

Changes:

  • Adds a 30-minute cooldown filter in the bash prefilter and exposes filtered_cooldown in the compact candidates JSON.
  • Updates the agent prompt to require posting exactly one combined nudge comment per PR per run (instead of multiple comments).
  • Updates the run-summary counting fields to include cooldown skips and a single nudged counter.
Show a summary per file
File Description
.github/workflows/pr-sous-chef.md Adds cooldown filtering + prompt updates to enforce a single combined nudge comment and updated summary fields.
.github/workflows/pr-sous-chef.lock.yml Regenerated compiled workflow reflecting the Markdown workflow changes.

Review details

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment on lines +86 to +90
# Fetch the 10 most-recent issue comments once; used for the skip checks below.
recent_comments_json="$(
gh api "repos/$EXPR_GITHUB_REPOSITORY/issues/$pr_number/comments?per_page=10&sort=created&direction=desc" \
2>/dev/null || echo "[]"
)"
Copilot AI added a commit that referenced this pull request Jun 26, 2026
…41759)

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
pelikhan added a commit that referenced this pull request Jun 26, 2026
* Initial plan

* Cache compiled regexp in applySanitizePattern using sync.Map

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* fix(pr-sous-chef): prevent double comments and add 30-min cooldown (#41759)
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

* Add non-TTY fallback for interactive add wizard (MultiSelect + text prompts) (#41717)
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

* Preserve issue-intent label metadata in `add_labels` REST payload behind feature flag (#41725)
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

* Reduce validation benchmark overhead by deduplicating Copilot permission tip emission (#41753)
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

* refactor(workflow): split custom job builder module out of compiler_jobs.go (#41754)
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

* feat: upgrade experiments_command.go manual tables to console.RenderTable() (#41718)
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

* Instruct PR sous-chef to run pr-finisher skill (#41768)
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

* Initial plan

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

* Replace sanitize regexp cache with precompiled patterns

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
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.

3 participants