Skip to content

Commit 2c0cd0f

Browse files
committed
Add explicit MCP tool calls for no-changes cleanup scenario
The coding agent was not closing the PR and issue when no upstream changes were found, even though instructions said to do so. Updated both the custom instructions and the main prompt to include exact mcp_github_update_pull_request, mcp_github_add_issue_comment, and mcp_github_update_issue tool call examples with all parameters.
1 parent d65ffbf commit 2c0cd0f

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

.github/prompts/agentic-merge-upstream.prompt.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,13 @@ Run the finish script which updates `.lastmerge`, runs a final build, and pushes
333333
mcp_github_add_issue_labels(owner: "copilot-community-sdk", repo: "copilot-sdk-java", issue_number: <PR_NUMBER>, labels: ["upstream-sync"])
334334
```
335335

336-
> **No-changes scenario (coding agent only):** If after analyzing the upstream diff there are no relevant changes to port to the Java SDK, close the auto-created pull request, then close the triggering issue as "not planned" with a comment explaining that no changes were applicable.
336+
> **No-changes scenario (coding agent only):** If after analyzing the upstream diff there are no relevant changes to port to the Java SDK, you **MUST** close the auto-created pull request and the triggering issue using these exact MCP tool calls:
337+
>
338+
> 1. Close the PR: `mcp_github_update_pull_request(owner: "copilot-community-sdk", repo: "copilot-sdk-java", pullNumber: <PR_NUMBER>, state: "closed")`
339+
> 2. Comment on the issue: `mcp_github_add_issue_comment(owner: "copilot-community-sdk", repo: "copilot-sdk-java", issue_number: <ISSUE_NUMBER>, body: "No relevant upstream changes to port. Closing as not planned.")`
340+
> 3. Close the issue: `mcp_github_update_issue(owner: "copilot-community-sdk", repo: "copilot-sdk-java", issue_number: <ISSUE_NUMBER>, state: "closed", state_reason: "not_planned")`
341+
>
342+
> **Do NOT skip these steps.** All three tool calls are required when there are no changes to port.
337343
338344
**If running manually** (e.g., from VS Code via the reusable prompt), create the Pull Request using the GitHub MCP tool (`mcp_github_create_pull_request`). Use `owner: copilot-community-sdk`, `repo: copilot-sdk-java`, `head: $BRANCH_NAME`, `base: main`. Then add the label:
339345

.github/prompts/coding-agent-merge-instructions.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,18 @@ Add the 'upstream-sync' label to the existing PR using the GitHub MCP tool:
1515
mcp_github_add_issue_labels(owner: "copilot-community-sdk", repo: "copilot-sdk-java", issue_number: <PR_NUMBER>, labels: ["upstream-sync"])
1616

1717
If after analyzing the upstream diff there are no relevant changes to port to the Java SDK,
18-
close the pull request that was automatically created for you, then close this issue as
19-
'not planned' with a comment explaining that no changes were applicable.
18+
you MUST close the pull request and the issue. Use these exact GitHub MCP tool calls:
19+
20+
1. Close the auto-created pull request:
21+
22+
mcp_github_update_pull_request(owner: "copilot-community-sdk", repo: "copilot-sdk-java", pullNumber: <PR_NUMBER>, state: "closed")
23+
24+
2. Add a comment to the issue explaining no changes were needed:
25+
26+
mcp_github_add_issue_comment(owner: "copilot-community-sdk", repo: "copilot-sdk-java", issue_number: <ISSUE_NUMBER>, body: "No relevant upstream changes to port to the Java SDK. Closing as not planned.")
27+
28+
3. Close the issue as 'not planned':
29+
30+
mcp_github_update_issue(owner: "copilot-community-sdk", repo: "copilot-sdk-java", issue_number: <ISSUE_NUMBER>, state: "closed", state_reason: "not_planned")
31+
32+
Do NOT skip these steps. All three tool calls are required.

0 commit comments

Comments
 (0)