Skip to content

fix(dev-lead): resolve review threads after fixing + notify CodeRabbit on CHANGES_REQUESTED - #285

Merged
don-petry merged 3 commits into
mainfrom
fix/dev-lead-resolve-review-threads
May 19, 2026
Merged

fix(dev-lead): resolve review threads after fixing + notify CodeRabbit on CHANGES_REQUESTED#285
don-petry merged 3 commits into
mainfrom
fix/dev-lead-resolve-review-threads

Conversation

@don-petry

@don-petry don-petry commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Problem

The dev-lead prompts said "Do not resolve the threads yourself" — this was wrong in two ways:

  1. It prevented the agent from resolving threads it had just fixed, leaving stale CHANGES_REQUESTED state on every PR it touched
  2. The rationale ("they will be resolved automatically") is false for bot reviewers — CodeRabbit, Copilot, and Gemini do NOT auto-resolve when new commits are pushed

Additionally, the script never posted `@coderabbitai resolve` after a successful push, so CodeRabbit's `request_changes_workflow` CHANGES_REQUESTED review never cleared to APPROVED even when all findings were addressed.

Changes

`scripts/dev-lead-fix-reviews.sh`

  • Added `notify_coderabbit_resolve()`: after a successful `commit_and_push`, checks if `coderabbitai[bot]` has an outstanding CHANGES_REQUESTED review and posts `@coderabbitai resolve`, which triggers CodeRabbit to mark all threads resolved and post APPROVED
  • Both `reviewThreads` GraphQL queries now fetch `id` and `isOutdated` so the agent can resolve threads
  • `notify_coderabbit_resolve` called in `fix-reviews`, `fix-bot-comment`, and `human-pr` intents after successful push

`prompts/dev-lead/fix-reviews.md`

  • Removed the wrong "do not resolve" instruction
  • Added: resolve each thread after fixing it via `resolveReviewThread` GraphQL mutation
  • Added: resolve threads marked `isOutdated: true` without a code change

`prompts/dev-lead/fix-bot-comment.md`

  • Same thread-resolution instructions with bot-specific thread query

`prompts/dev-lead/human-pr.md`

  • Same thread-resolution instructions for human review threads

Correct lifecycle after this fix

  1. Agent fixes the code issue → resolves the thread → reviewer sees clean slate
  2. Bot gets a chance to re-review the new commit and flag anything remaining
  3. If CodeRabbit had CHANGES_REQUESTED → script posts `@coderabbitai resolve` → CodeRabbit posts APPROVED

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Automatic resolution of review threads when code fixes are applied
    • Enhanced status tracking with clear indicators for resolved, outdated, or skipped review threads
    • Notification system to manage outstanding bot-generated reviews
  • Documentation

    • Updated review workflow templates for improved clarity on thread resolution and handling processes

Review Change Stack

Three related gaps closed:

1. Thread resolution after fixing
   - fix-reviews, fix-bot-comment, and human-pr prompts now instruct the
     agent to resolve each thread immediately after addressing it (via the
     resolveReviewThread GraphQL mutation) and to resolve any thread marked
     isOutdated without a code change. This gives reviewers (human and bot)
     a clean slate to re-review rather than leaving stale CHANGES_REQUESTED
     state indefinitely.

2. isOutdated + id fields in GraphQL queries
   - Both reviewThreads queries in dev-lead-fix-reviews.sh now fetch id and
     isOutdated so the agent has the data it needs to resolve threads.

3. CodeRabbit CHANGES_REQUESTED handshake
   - Added notify_coderabbit_resolve() which posts @coderabbitai resolve
     after a successful commit+push whenever coderabbitai[bot] has an
     outstanding CHANGES_REQUESTED review. This triggers CodeRabbit to mark
     all its threads resolved and post APPROVED (when request_changes_workflow
     is enabled), clearing the stale review state that previously persisted
     even after all findings were addressed in code.

The old "Do not resolve the threads yourself" instruction was wrong: it
was intended to mean "don't use GitHub's thread-resolve API yourself" but
inadvertently blocked the correct resolution workflow for all reviewers.

Closes #281 (partial — CodeRabbit resolution gap)
Copilot AI review requested due to automatic review settings May 19, 2026 03:36
@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@don-petry has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 1 second before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 781e1417-c50a-46ed-93f1-87389670047c

📥 Commits

Reviewing files that changed from the base of the PR and between 29bbf55 and 7d662af.

📒 Files selected for processing (4)
  • prompts/dev-lead/fix-bot-comment.md
  • prompts/dev-lead/fix-reviews.md
  • prompts/dev-lead/human-pr.md
  • scripts/dev-lead-fix-reviews.sh
📝 Walkthrough

Walkthrough

The PR updates the dev-lead agent workflow to automatically resolve review threads. Three agent prompt templates are revised to instruct agents to resolve fixed and outdated threads using GraphQL mutations, and the bash script is updated with a new notification function and GraphQL query changes to fetch thread IDs and trigger bot resolution comments after successful edits.

Changes

Thread Resolution Workflow

Layer / File(s) Summary
Bot comment thread resolution instructions
prompts/dev-lead/fix-bot-comment.md
Adds "Resolving threads from this bot" section with GraphQL query and mutation examples for listing and resolving bot-authored threads, updates output format to require per-issue entries indicating whether bot threads were resolved, including outdated ones.
General review thread resolution workflow
prompts/dev-lead/fix-reviews.md
Rewrites task flow to resolve threads immediately via resolveReviewThread GraphQL mutation; requires resolving fixed threads and outdated threads without code changes; updates output format to label each thread entry as [resolved], outdated — resolved without change, or skipped — <reason> [left open].
Human PR thread resolution guidelines
prompts/dev-lead/human-pr.md
Clarifies thread id field availability for resolution; adds constraints requiring resolution of every fixed thread, resolving isOutdated threads without code changes, and leaving intentionally skipped threads unresolved; updates output format to explicit per-thread status bullets.
Script notification and query integration
scripts/dev-lead-fix-reviews.sh
Adds notify_coderabbit_resolve() function that checks for outstanding bot CHANGES_REQUESTED reviews and posts @coderabbitai resolve comments; updates fix-reviews and human-pr GraphQL queries to include id field; calls notification function after successful commits for all three workflow intents.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the two main changes: resolving review threads after fixing and notifying CodeRabbit on CHANGES_REQUESTED state.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dev-lead-resolve-review-threads

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a mechanism for the dev-lead agent to explicitly resolve review threads. It updates prompt documentation for bot and human reviews with instructions and GraphQL mutations for thread resolution. Additionally, the dev-lead-fix-reviews.sh script was updated to fetch thread IDs and include a new function to notify CodeRabbit to resolve its threads when changes are pushed. Feedback was provided to improve the reliability of the CodeRabbit status check by implementing pagination and targeting only the most recent review state.

Comment thread scripts/dev-lead-fix-reviews.sh Outdated
Comment on lines +87 to +89
has_cr_changes_requested=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
--jq '[.[] | select(.user.login == "coderabbitai[bot]" and .state == "CHANGES_REQUESTED")] | length' \
2>/dev/null || echo "0")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The current check for CodeRabbit's review status has two issues:

  1. It doesn't use --paginate, which means it only inspects the first 30 reviews. On long-lived PRs, the most recent (and relevant) reviews might be missed since GitHub returns them in chronological order.
  2. It checks if any review from CodeRabbit is in CHANGES_REQUESTED state. If a bot previously requested changes but has since approved the PR in a subsequent review, this logic will still trigger unnecessarily.

It's better to use --paginate and check only the state of the latest review from the bot.

Suggested change
has_cr_changes_requested=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
--jq '[.[] | select(.user.login == "coderabbitai[bot]" and .state == "CHANGES_REQUESTED")] | length' \
2>/dev/null || echo "0")
has_cr_changes_requested=$(gh api --paginate "repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
--jq '[.[] | select(.user.login == "coderabbitai[bot]")] | last | if .state == "CHANGES_REQUESTED" then 1 else 0 end' \
2>/dev/null || echo "0")

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 dev-lead automation to actively resolve review threads it fixes (including isOutdated threads) and to notify CodeRabbit to clear lingering CHANGES_REQUESTED states after a successful push.

Changes:

  • Add notify_coderabbit_resolve() to post @coderabbitai resolve when CodeRabbit has requested changes, and invoke it after successful pushes for relevant intents.
  • Extend reviewThreads GraphQL queries to include id and isOutdated so threads can be resolved via resolveReviewThread.
  • Update dev-lead prompt templates to instruct resolving threads after fixes (and resolving outdated threads without code changes).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
scripts/dev-lead-fix-reviews.sh Adds CodeRabbit resolve notification logic and enriches thread queries with id/isOutdated.
prompts/dev-lead/fix-reviews.md Updates guidance to resolve fixed/outdated threads via GraphQL mutation.
prompts/dev-lead/fix-bot-comment.md Adds bot-thread resolution instructions and a command snippet to list/resolve threads.
prompts/dev-lead/human-pr.md Adds human-thread resolution instructions and updated summary format.

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

Comment thread scripts/dev-lead-fix-reviews.sh Outdated
Comment on lines +83 to +91
echo "[dry-run] would check for coderabbitai CHANGES_REQUESTED and post @coderabbitai resolve"
return 0
fi
local has_cr_changes_requested
has_cr_changes_requested=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
--jq '[.[] | select(.user.login == "coderabbitai[bot]" and .state == "CHANGES_REQUESTED")] | length' \
2>/dev/null || echo "0")
if [ "${has_cr_changes_requested:-0}" -gt 0 ]; then
echo "::notice::coderabbitai has CHANGES_REQUESTED — posting @coderabbitai resolve"
Comment thread prompts/dev-lead/fix-bot-comment.md Outdated
Comment on lines +46 to +48
--jq '.data.repository.pullRequest.reviewThreads.nodes
| map(select(.isResolved == false
and (.comments.nodes[0].author.login == "${ACTOR}" or .isOutdated == true)))'

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@prompts/dev-lead/fix-bot-comment.md`:
- Around line 46-48: The jq filter currently allows matching outdated threads
from any reviewer; update the filter expression used in the shell snippet (the
--jq string) so that outdated threads are only selected when authored by this
bot: require (.comments.nodes[0].author.login == "${ACTOR}") to be true for both
unresolved OR isOutdated cases (i.e., select threads where author == ACTOR and
(isResolved == false or isOutdated == true)); alternatively, if the intended
behavior is to resolve every outdated thread regardless of author, update the
prose at line 59 to explicitly state "Resolve every thread you fixed from this
bot and every thread marked isOutdated: true (regardless of author)" so the
current filter is knowingly correct.

In `@scripts/dev-lead-fix-reviews.sh`:
- Around line 77-94: The notify_coderabbit_resolve function currently posts the
literal "`@coderabbitai` resolve" which force-resolves all CodeRabbit threads;
change it so it never indiscriminately posts that command—either remove the gh
pr comment call entirely or gate it behind an explicit opt-in (e.g., an env var
like ENABLE_CODERABBIT_AUTO_RESOLVE) and only run when that opt-in is true;
alternatively implement targeted resolution logic (use the GH API to inspect
review threads and only post resolves for specific thread IDs that are verified
as fixed/outdated) instead of posting the global "`@coderabbitai` resolve" string;
update references in notify_coderabbit_resolve and the has_cr_changes_requested
check accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 27050f55-dbc7-45ff-a622-705546b1fe65

📥 Commits

Reviewing files that changed from the base of the PR and between dbea5f0 and 29bbf55.

📒 Files selected for processing (4)
  • prompts/dev-lead/fix-bot-comment.md
  • prompts/dev-lead/fix-reviews.md
  • prompts/dev-lead/human-pr.md
  • scripts/dev-lead-fix-reviews.sh

Comment thread prompts/dev-lead/fix-bot-comment.md Outdated
Comment thread scripts/dev-lead-fix-reviews.sh Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 29bbf558e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/dev-lead-fix-reviews.sh Outdated
Comment on lines +87 to +89
has_cr_changes_requested=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
--jq '[.[] | select(.user.login == "coderabbitai[bot]" and .state == "CHANGES_REQUESTED")] | length' \
2>/dev/null || echo "0")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Check only current CodeRabbit requests before resolving

In PRs where CodeRabbit requested changes earlier and later approved after fixes, this query still counts the old historical CHANGES_REQUESTED review, so any subsequent successful fix-reviews, fix-bot-comment, or human-pr run will post @coderabbitai resolve even when CodeRabbit has no outstanding request. This repo already treats stale reviews as historical by checking the review's commit SHA in scripts/review-one-pr.sh, so this should similarly restrict to the latest CodeRabbit review or at least a request on the current head SHA before sending the resolve command.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Skipped: comment is from another GitHub bot.

Comment thread prompts/dev-lead/fix-bot-comment.md Outdated
Comment on lines +47 to +48
| map(select(.isResolved == false
and (.comments.nodes[0].author.login == "${ACTOR}" or .isOutdated == true)))'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit outdated bot-comment resolution to that bot

For a bot-comment run, this filter includes every unresolved outdated thread on the PR, even when the thread was opened by a human or a different bot, because the author check is ORed with isOutdated. In a PR with an unrelated outdated human review thread, the agent is explicitly instructed to resolve it while handling ${ACTOR}'s comment, which violates the surrounding “from this bot” scope and can hide feedback that the bot-comment workflow should leave alone.

Useful? React with 👍 / 👎.

Comment thread scripts/dev-lead-fix-reviews.sh Outdated
Comment on lines +87 to +89
has_cr_changes_requested=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
--jq '[.[] | select(.user.login == "coderabbitai[bot]" and .state == "CHANGES_REQUESTED")] | length' \
2>/dev/null || echo "0")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Paginate the CodeRabbit review lookup

On PRs with more than 30 reviews, this REST call only inspects the first page because it does not pass --paginate or a larger per_page; GitHub's List reviews endpoint defaults per_page to 30 (see https://docs.github.com/rest/pulls/reviews). If CodeRabbit's current CHANGES_REQUESTED review is on a later page, notify_coderabbit_resolve will skip posting @coderabbitai resolve, leaving the outstanding CodeRabbit state uncleared on the busy PRs this helper is meant to fix.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Skipped: comment is from another GitHub bot.

Comment thread prompts/dev-lead/fix-reviews.md Outdated
Comment on lines +34 to +38
mutation($id: ID!) {
resolveReviewThread(input: {threadId: $id}) {
thread { isResolved }
}
}' -F id="<threadId>"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Escape GraphQL variables before envsubst

These prompt templates are run through envsubst in build_and_run before the agent sees them, so the new GraphQL variables are expanded as shell variables and disappear because $id is not exported. The generated prompt contains invalid GraphQL like mutation(: ID!) and threadId:, so agents following this instruction cannot resolve any review thread; the same envsubst stripping affects the other added GraphQL snippets that use $owner, $repo, $pr, and $id.

Useful? React with 👍 / 👎.

Per Gemini, Copilot, and CodeRabbit review of #285:

- notify_coderabbit_resolve: use --paginate so all reviews are seen on
  long-lived PRs; derive current state from the latest CodeRabbit review
  (tail -1 on chronological .state output) rather than any historical one,
  avoiding noisy re-posts after a prior approval or dismissal

- fix-bot-comment.md: pass ACTOR as a jq --arg so the variable expands
  at runtime instead of being compared as the literal string "${ACTOR}";
  scope isOutdated resolution to threads from this bot only (not any
  reviewer) to avoid resolving another reviewer's still-valid threads

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 061c35bff4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread prompts/dev-lead/fix-bot-comment.md Outdated
}
}
}' -F owner="${REPO%%/*}" -F repo="${REPO##*/}" -F pr=${PR_NUMBER} \
--jq --arg actor "${ACTOR}" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Move actor binding into the jq expression

In fix-bot-comment runs where the agent follows this helper to find threads for ${ACTOR}, this command will fail before returning any thread IDs: the official gh api syntax exposes --jq <expression> only, so --arg actor ... is parsed as an unsupported GitHub CLI flag rather than a jq option. As a result, bot-comment fixes cannot discover or resolve the bot's open/outdated review threads; pass the actor via the jq expression/env or pipe to a separate jq --arg actor ... invocation instead.

Useful? React with 👍 / 👎.

pullRequest(number:$pr) {
reviewThreads(first:50) {
nodes { isResolved line path comments(first:5) { nodes { body author { login } } } }
nodes { id isResolved isOutdated line path comments(first:5) { nodes { body author { login } } } }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Filter human-pr threads before exposing resolvable IDs

When a human review triggers human-pr while bot review threads are also unresolved, this query now hands the agent resolvable id values for every unresolved thread on the PR, not just human threads. The updated human-pr prompt then instructs the agent to resolve every fixed or outdated thread in OPEN_THREADS_JSON, so a human-only response can resolve CodeRabbit/Copilot/Sonar threads in the first page and hide bot feedback that this intent was not scoped to handle.

Useful? React with 👍 / 👎.

pullRequest(number:$pr) {
reviewThreads(first:50) {
nodes { isResolved line path comments(first:5) { nodes { body author { login } } } }
nodes { id isResolved isOutdated line path comments(first:5) { nodes { body author { login } } } }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Filter bot-triggered threads before exposing IDs

When a trusted bot review triggers fix-reviews while unresolved human review threads are also present, this query now includes resolvable IDs for every unresolved thread on the PR. Because the new prompt tells the agent to resolve every fixed or outdated thread from OPEN_THREADS_JSON, a bot-review run can mark human feedback resolved even though the intent was only routed from a bot review event.

Useful? React with 👍 / 👎.

Comment thread prompts/dev-lead/fix-reviews.md Outdated
- Do not resolve the threads yourself — they will be resolved automatically when the conversation is updated
### Resolving a thread

After fixing (or confirming outdated), resolve it immediately:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Defer thread resolution until after a successful push

In runs where the agent fixes code but commit_and_push later fails because of auth, branch permissions, or a transient push error, this instruction has already resolved the review thread before any fix reaches the PR branch. The workflow then exits and the runner's local changes are lost, leaving reviewer feedback hidden as resolved even though the PR still contains the original issue; resolution should happen only after the script has successfully pushed the fix.

Useful? React with 👍 / 👎.

…by author

Per ChatGPT Codex P1/P2 findings on #285:

- build_and_run: scope envsubst to variables declared in the prompt's
  <!-- VARIABLES: --> header. Previously, envsubst replaced all $VAR
  patterns including GraphQL variables ($id, $owner, $repo, $pr) in code
  examples, silently stripping them before the agent ever saw the prompt.
  Now only the declared template variables are substituted.

- fix-bot-comment.md: replace --jq --arg (unsupported by gh api graphql)
  with a pipe to jq --arg, which correctly passes the actor login as a
  jq variable for the thread-lookup query.

- All three prompts (fix-reviews, fix-bot-comment, human-pr): rewrite the
  resolveReviewThread mutation example to use an inline string literal
  (THREAD_NODE_ID placeholder) instead of a GraphQL $id variable, making
  the pattern safe even without the envsubst scoping fix and clearer for
  the agent to follow.

- All three prompts: add constraint to only resolve threads from the
  reviewer who triggered this run — do not resolve threads belonging to
  other reviewers (human or bot) to avoid accidentally clearing still-
  valid concerns from a different reviewer.
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry merged commit 31d9e9d into main May 19, 2026
16 checks passed
@don-petry
don-petry deleted the fix/dev-lead-resolve-review-threads branch May 19, 2026 04:18
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.

2 participants