Skip to content

[q] fix(pr-sous-chef): deterministic spam filter using marker #32623

@github-actions

Description

@github-actions

Q Workflow Optimization Report

Issue Found

PR Sous Chef — Non-Deterministic Spam Filter

The existing prefilter step (lines 66-79) checked for the string pr-sous-chef in:

  • user.login — the bot login may not contain this string (e.g., github-copilot[bot])
  • body — relied on the AI agent voluntarily including pr-sous-chef in comment bodies (non-deterministic)

This meant the filter could silently miss comments posted by sous chef, causing the same PR to be nudged repeatedly on every 15-minute run.

Changes Made

.github/workflows/pr-sous-chef.md

  1. Shell prefilter — changed the jq filter from a loose case-insensitive substring match on login/body to an exact check for <!-- pr-sous-chef --> in the comment body.
  2. Agent prompt — added mandatory rule: every add_comment call must end with <!-- pr-sous-chef --> on its own line. Explained that skipping the marker causes spam on subsequent runs.
  3. pr-processor sub-agent — same marker mandate, and updated skip-condition wording to reference the exact marker.

Expected Improvements

  • Eliminates repeated nudges on the same PR — the marker is invisible to users but exact and deterministic to check
  • No reliance on AI improvising freeform text; the marker is a hard requirement in the prompt

Validation

pr-sous-chef compiled successfully with zero errors/warnings.

Note: .lock.yml files will be regenerated automatically after merge.

Fixes #32532 (comment requesting deterministic spam prevention)

🎩 Equipped by Q · ● 16M ·

  • expires on May 18, 2026, 1:53 PM UTC

Note

This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download bundle artifact

The bundle file is available in the agent artifact in the workflow run linked above.

To create a pull request with the changes:

# Download the artifact from the workflow run
gh run download 25963425157 -n agent -D /tmp/agent-25963425157

# Fetch the bundle into a temporary ref, then update the local branch
git fetch /tmp/agent-25963425157/aw-q-pr-sous-chef-deterministic-filter.bundle refs/heads/q/pr-sous-chef-deterministic-filter:refs/bundles/create-pr-q-pr-sous-chef-deterministic-filter-18ba1c4ed991ac21-466fa5c7
git update-ref refs/heads/q/pr-sous-chef-deterministic-filter-18ba1c4ed991ac21 refs/bundles/create-pr-q-pr-sous-chef-deterministic-filter-18ba1c4ed991ac21-466fa5c7
git checkout q/pr-sous-chef-deterministic-filter-18ba1c4ed991ac21
# Ensure the working tree matches the updated branch
git reset --hard
# Remove the temporary bundle ref
git update-ref -d refs/bundles/create-pr-q-pr-sous-chef-deterministic-filter-18ba1c4ed991ac21-466fa5c7

# Push the branch to origin
git push origin q/pr-sous-chef-deterministic-filter-18ba1c4ed991ac21

# Create the pull request
gh pr create --title '[q] fix(pr-sous-chef): deterministic spam filter using  marker' --base main --head q/pr-sous-chef-deterministic-filter-18ba1c4ed991ac21 --repo github/gh-aw

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions