Skip MCP Apps UI form when issue_write update includes a state change#2163
Merged
SamMorrowDrums merged 3 commits intomainfrom Mar 6, 2026
Merged
Skip MCP Apps UI form when issue_write update includes a state change#2163SamMorrowDrums merged 3 commits intomainfrom
SamMorrowDrums merged 3 commits intomainfrom
Conversation
When using issue_write with method "update" and a state parameter (e.g. "closed"), the MCP Apps UI form was incorrectly shown. The form only handles title/body editing and would lose the state transition. Now when a state change is requested, the UI form is skipped and the update executes directly. Fixes #798 Co-authored-by: mattdholloway <918573+mattdholloway@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix incorrect MCP UI displayed on issue updates
Skip MCP Apps UI form when issue_write update includes a state change
Mar 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the issue_write MCP tool’s “Insiders mode” UI gating so UI-capable clients don’t get redirected to the MCP Apps edit form when an update request includes a state transition (since the current UI form only submits title/body and would drop the state change).
Changes:
- Update the
issue_writeinsiders UI gate to bypass the form whenmethod: "update"includes astateparameter. - Add unit tests covering: (1) state-change updates bypass the UI form, (2) title-only updates still return the UI form message.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/github/issues.go | Adjusts insiders UI-gate logic to skip the form for updates that include a state change. |
| pkg/github/issues_test.go | Adds test coverage for the new UI-gate bypass behavior for state changes vs title-only updates. |
Comments suppressed due to low confidence (1)
pkg/github/issues.go:1096
- The comment notes the UI form only edits title/body, but the UI gate still returns the form for
method == "update"wheneverstateis not set. That means UI clients attempting to update other supported fields (e.g.,labels,assignees,milestone,type,state_reason/duplicate_of) will still be routed through a form submission that drops those fields. Consider expanding the bypass condition to skip the form whenever any non-title/body update parameters are present, or update the UI app to preserve/submit them, to avoid silent partial updates.
// Skip the UI form when a state change is requested because
// the form only handles title/body editing and would lose the
// state transition (e.g. closing or reopening the issue).
state, _ := OptionalParam[string](args, "state")
if state == "" {
issueNumber, numErr := RequiredInt(args, "issue_number")
if numErr != nil {
return utils.NewToolResultError("issue_number is required for update method"), nil, nil
}
return utils.NewToolResultText(fmt.Sprintf("Ready to update issue #%d in %s/%s. IMPORTANT: The issue has NOT been updated yet. Do NOT tell the user the issue was updated. The user MUST click Submit in the form to update it.", issueNumber, owner, repo)), nil, nil
}
} else {
return utils.NewToolResultText(fmt.Sprintf("Ready to create an issue in %s/%s. IMPORTANT: The issue has NOT been created yet. Do NOT tell the user the issue was created. The user MUST click Submit in the form to create it.", owner, repo)), nil, nil
}
Check for the "state" key directly in the args map rather than using OptionalParam and ignoring its error. This ensures that a wrongly-typed state value bypasses the UI form (falling through to the normal validation path) instead of silently showing the form. Co-authored-by: mattdholloway <918573+mattdholloway@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
SamMorrowDrums
approved these changes
Mar 6, 2026
Collaborator
SamMorrowDrums
left a comment
There was a problem hiding this comment.
Thanks for addressing quickly @mattdholloway! ✨
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Skip the MCP Apps UI edit form when
issue_writeis called withmethod: "update"and astateparameter, since the form only handles title/body and would silently drop the state transition.Why
When closing or reopening an issue via
issue_write, the UI gate intercepted the call and rendered a title/body edit form — which has no state controls. The user saw an irrelevant "Update issue" form instead of the issue actually being closed.What changed
pkg/github/issues.go: In the insiders UI gate, check forstatekey presence in args on update — if present, fall through to direct execution instead of returning the form message. Uses direct map key lookup (args["state"]) rather thanOptionalParamto avoid silently ignoring type errors.pkg/github/issues_test.go: Added two test cases: state change bypasses UI form; title-only update still shows formMCP impact
issue_writewithmethod: "update"+statenow executes directly on UI-capable clients instead of showing the edit form.Prompts tested (tool changes only)
Security / limits
Tool renaming
Lint & tests
./script/lint./script/testDocs
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.