Skip to content

Fix smoke-claude: clarify safe-outputs auto-targeting for PR comments#13507

Merged
pelikhan merged 2 commits intomainfrom
copilot/debug-comment-addition-issue
Feb 3, 2026
Merged

Fix smoke-claude: clarify safe-outputs auto-targeting for PR comments#13507
pelikhan merged 2 commits intomainfrom
copilot/debug-comment-addition-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

The smoke-claude workflow failed to comment on the triggering PR because the agent used the discussion number (13502) for all add_comment calls instead of auto-targeting the PR.

Changes

  • Step 2 (PR comment): Explicitly instruct agent to omit item_number parameter, enabling safe-outputs auto-targeting of the triggering PR
  • Step 3 (discussion comment): Clarify the tool uses item_number parameter (not the non-existent discussion_number)
  • Label instruction: Use add_labels with auto-targeting for PR labeling

Context

Safe-outputs tools (add_comment, add_labels) auto-target the triggering item when item_number is omitted. The previous instructions were ambiguous, causing the agent to explicitly provide the wrong item number instead of relying on auto-targeting.

Before:

2. Add a comment to the current pull request with: ...
3. Use the `add_comment` tool to add a comment to the latest discussion 
   (using the `discussion_number` you extracted in step 9) ...

After:

2. Use the `add_comment` tool to add a comment to the triggering pull request 
   (omit the `item_number` parameter to auto-target the triggering PR) with: ...
3. Use the `add_comment` tool with `item_number` set to the discussion number 
   you extracted in step 9 to add a comment to that discussion ...

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/github/gh-aw/actions/artifacts/5358216241/zip
    • Triggering command: /usr/bin/curl curl -L -H Accept: application/vnd.github+json -H X-GitHub-Api-Version: 2022-11-28 REDACTED -o agent-output.zip (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Reference: https://github.com/github/gh-aw/actions/runs/21632510109/job/62349402453#step:6:1

Debug why the comment was not added the pull request exists.

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Debug why comment was not added to pull request Fix smoke-claude: clarify safe-outputs auto-targeting for PR comments Feb 3, 2026
Copilot AI requested a review from pelikhan February 3, 2026 14:03
@pelikhan pelikhan marked this pull request as ready for review February 3, 2026 14:08
Copilot AI review requested due to automatic review settings February 3, 2026 14:08
@pelikhan pelikhan merged commit bee4723 into main Feb 3, 2026
154 of 155 checks passed
@pelikhan pelikhan deleted the copilot/debug-comment-addition-issue branch February 3, 2026 14:09
Copy link
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

Clarifies the smoke-claude workflow instructions to ensure safe-outputs (add_comment, add_labels) correctly auto-target the triggering PR by omitting item_number, and to clarify how to target discussions.

Changes:

  • Updates PR comment instructions to explicitly omit item_number for auto-targeting the triggering PR.
  • Updates discussion comment instructions to use item_number (instead of discussion_number) for targeting.
  • Updates labeling instructions to use add_labels with PR auto-targeting guidance.
Comments suppressed due to low confidence (1)

.github/workflows/smoke-claude.md:112

  • This instruction assumes add_comment(item_number=<discussion number>) will comment on a discussion, but the current add_comment safe-output handler only treats the target as a discussion when the workflow event is discussion/discussion_comment. When item_number is explicitly provided, it is handled as an issue/PR comment via the REST issues API, which can fail or post to the wrong item. Either update the handler to detect/route discussion targets when item_number refers to a discussion, or adjust the workflow instructions to use a supported mechanism for discussion comments.
3. Use the `add_comment` tool with `item_number` set to the discussion number you extracted in step 9 to add a **fun comic-book style comment** to that discussion - be playful and use comic-book language like "💥 WHOOSH!"

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

Comment on lines 111 to 113

3. Use the `add_comment` tool to add a **fun comic-book style comment** to the latest discussion (using the `discussion_number` you extracted in step 9) - be playful and use comic-book language like "💥 WHOOSH!"
3. Use the `add_comment` tool with `item_number` set to the discussion number you extracted in step 9 to add a **fun comic-book style comment** to that discussion - be playful and use comic-book language like "💥 WHOOSH!"

Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The workflow still has conflicting guidance for discussion comments: step 9 (Test Requirements) instructs using add_comment with a discussion_number parameter, but the safe-outputs add_comment tool schema only supports item_number (and rejects additional properties). This inconsistency can cause the agent to emit invalid tool calls or follow the wrong parameter name—please update the step 9 instruction to match the item_number parameter used here (or otherwise align both sections).

Copilot uses AI. Check for mistakes.
3. Use the `add_comment` tool with `item_number` set to the discussion number you extracted in step 9 to add a **fun comic-book style comment** to that discussion - be playful and use comic-book language like "💥 WHOOSH!"

If all tests pass, add the label `smoke-claude` to the pull request.
If all tests pass, use the `add_labels` tool to add the label `smoke-claude` to the pull request (omit the `item_number` parameter to auto-target the triggering PR if this workflow was triggered by a pull_request event).
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

Labeling is still not explicitly gated to PR-triggered runs. Since this workflow also runs on schedule and workflow_dispatch, instructing add_labels to label “the pull request” can lead to failed or mis-targeted calls when there is no triggering PR context. Consider making this step conditional (similar to step 2): only attempt add_labels when the event is pull_request and tests pass; otherwise skip.

Copilot uses AI. Check for mistakes.
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