Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Align assignee confidence to uppercase LOW/MEDIUM/HIGH; add non-strin…
…g/object test
  • Loading branch information
kelsey-myers authored Jul 6, 2026
commit 5130b8c5b0c9ac2110260b7ddbf5baf9fa5462c1
10 changes: 5 additions & 5 deletions pkg/github/__toolsnaps__/update_issue_assignees.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"readOnlyHint": false,
"title": "Update Issue Assignees"
},
"description": "Update the assignees of an existing issue. This replaces the current assignees with the provided list. When setting values, include a confidence level (low, medium, or high) reflecting how certain you are about the choice.",
"description": "Update the assignees of an existing issue. This replaces the current assignees with the provided list. When setting values, include a confidence level (LOW, MEDIUM, or HIGH) reflecting how certain you are about the choice.",
"inputSchema": {
"properties": {
"assignees": {
Expand All @@ -20,11 +20,11 @@
{
"properties": {
"confidence": {
"description": "How confident you are in this choice. Use 'high' for clear signal or explicit user request, 'medium' for reasonable inference with some ambiguity, 'low' for best guess with limited signal.",
"description": "How confident you are in this choice. Use 'HIGH' for clear signal or explicit user request, 'MEDIUM' for reasonable inference with some ambiguity, 'LOW' for best guess with limited signal.",
"enum": [
"low",
"medium",
"high"
"LOW",
"MEDIUM",
"HIGH"
],
"type": "string"
},
Expand Down
14 changes: 12 additions & 2 deletions pkg/github/granular_tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func TestGranularUpdateIssueAssigneesObjectForm(t *testing.T) {
},
expectedReq: map[string]any{
"assignees": []any{
map[string]any{"login": "octocat", "rationale": "Authored the crashing file", "confidence": "high", "suggest": true},
map[string]any{"login": "octocat", "rationale": "Authored the crashing file", "confidence": "HIGH", "suggest": true},
},
},
},
Expand Down Expand Up @@ -402,7 +402,17 @@ func TestGranularUpdateIssueAssigneesInvalidInput(t *testing.T) {
map[string]any{"login": "octocat", "confidence": "maybe"},
},
},
expectedErrText: "confidence must be one of: low, medium, high",
expectedErrText: "confidence must be one of: LOW, MEDIUM, HIGH",
},
{
name: "assignee entry is neither string nor object",
requestArgs: map[string]any{
"owner": "owner",
"repo": "repo",
"issue_number": float64(1),
"assignees": []any{float64(123)},
},
expectedErrText: "each assignee must be a string or an object",
},
}
Comment thread
kelsey-myers marked this conversation as resolved.
Resolved

Expand Down
11 changes: 6 additions & 5 deletions pkg/github/issues_granular.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func GranularUpdateIssueAssignees(t translations.TranslationHelperFunc) inventor
ToolsetMetadataIssues,
mcp.Tool{
Name: "update_issue_assignees",
Description: t("TOOL_UPDATE_ISSUE_ASSIGNEES_DESCRIPTION", "Update the assignees of an existing issue. This replaces the current assignees with the provided list. When setting values, include a confidence level (low, medium, or high) reflecting how certain you are about the choice."),
Description: t("TOOL_UPDATE_ISSUE_ASSIGNEES_DESCRIPTION", "Update the assignees of an existing issue. This replaces the current assignees with the provided list. When setting values, include a confidence level (LOW, MEDIUM, or HIGH) reflecting how certain you are about the choice."),
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_UPDATE_ISSUE_ASSIGNEES_USER_TITLE", "Update Issue Assignees"),
ReadOnlyHint: false,
Expand Down Expand Up @@ -286,8 +286,8 @@ func GranularUpdateIssueAssignees(t translations.TranslationHelperFunc) inventor
},
"confidence": {
Type: "string",
Description: "How confident you are in this choice. Use 'high' for clear signal or explicit user request, 'medium' for reasonable inference with some ambiguity, 'low' for best guess with limited signal.",
Enum: []any{"low", "medium", "high"},
Description: "How confident you are in this choice. Use 'HIGH' for clear signal or explicit user request, 'MEDIUM' for reasonable inference with some ambiguity, 'LOW' for best guess with limited signal.",
Enum: []any{"LOW", "MEDIUM", "HIGH"},
},
"is_suggestion": {
Type: "boolean",
Expand Down Expand Up @@ -359,8 +359,9 @@ func GranularUpdateIssueAssignees(t translations.TranslationHelperFunc) inventor
if err != nil {
return utils.NewToolResultError(err.Error()), nil, nil
}
if confidence != "" && confidence != "low" && confidence != "medium" && confidence != "high" {
return utils.NewToolResultError("confidence must be one of: low, medium, high"), nil, nil
confidence = normalizeConfidence(confidence)
if confidence != "" && confidence != "LOW" && confidence != "MEDIUM" && confidence != "HIGH" {
return utils.NewToolResultError("confidence must be one of: LOW, MEDIUM, HIGH"), nil, nil
}
Comment thread
kelsey-myers marked this conversation as resolved.
Resolved
isSuggestion, err := OptionalParam[bool](v, "is_suggestion")
if err != nil {
Expand Down
Loading