Fix smoke-claude: clarify safe-outputs auto-targeting for PR comments#13507
Fix smoke-claude: clarify safe-outputs auto-targeting for PR comments#13507
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
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_numberfor auto-targeting the triggering PR. - Updates discussion comment instructions to use
item_number(instead ofdiscussion_number) for targeting. - Updates labeling instructions to use
add_labelswith 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 currentadd_commentsafe-output handler only treats the target as a discussion when the workflow event isdiscussion/discussion_comment. Whenitem_numberis 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 whenitem_numberrefers 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.
|
|
||
| 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!" | ||
|
|
There was a problem hiding this comment.
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).
| 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). |
There was a problem hiding this comment.
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.
The smoke-claude workflow failed to comment on the triggering PR because the agent used the discussion number (13502) for all
add_commentcalls instead of auto-targeting the PR.Changes
item_numberparameter, enabling safe-outputs auto-targeting of the triggering PRitem_numberparameter (not the non-existentdiscussion_number)add_labelswith auto-targeting for PR labelingContext
Safe-outputs tools (
add_comment,add_labels) auto-target the triggering item whenitem_numberis omitted. The previous instructions were ambiguous, causing the agent to explicitly provide the wrong item number instead of relying on auto-targeting.Before:
After:
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/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
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.