Skip to content

Commit f09dd5e

Browse files
Copilotmattdholloway
authored andcommitted
Use key presence check instead of OptionalParam in UI gate
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>
1 parent 50a0461 commit f09dd5e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/github/issues.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,8 +1083,7 @@ Options are:
10831083
// Skip the UI form when a state change is requested because
10841084
// the form only handles title/body editing and would lose the
10851085
// state transition (e.g. closing or reopening the issue).
1086-
state, _ := OptionalParam[string](args, "state")
1087-
if state == "" {
1086+
if _, hasState := args["state"]; !hasState {
10881087
issueNumber, numErr := RequiredInt(args, "issue_number")
10891088
if numErr != nil {
10901089
return utils.NewToolResultError("issue_number is required for update method"), nil, nil

0 commit comments

Comments
 (0)