Return a clear error for missing owner/repo/issue_number in the copilot assignment tools - #3221
Open
thejdubb02 wants to merge 1 commit into
Open
Return a clear error for missing owner/repo/issue_number in the copilot assignment tools#3221thejdubb02 wants to merge 1 commit into
thejdubb02 wants to merge 1 commit into
Conversation
…ot assignment tools assign_copilot_to_issue and assign_copilot_to_issue_with_intent decode owner, repo and issue_number with mapstructure.WeakDecode, which zero-fills a missing value instead of erroring. A missing required arg then reached the GraphQL query and surfaced as a confusing "failed to get suggested actors: Could not resolve to a Repository" error. Reject the zero values after decoding, matching the is_suggestion and rationale/confidence checks in the same handlers, so the caller gets "missing required parameter: <name>". Adds table tests for the missing cases.
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
Return a clear
missing required parametererror whenowner,repo, orissue_numberis omitted fromassign_copilot_to_issue/assign_copilot_to_issue_with_intent, instead of a confusing downstream repository error.Why
Both handlers decode these required params with
mapstructure.WeakDecode, which zero-fills a missing value instead of erroring. A missing arg then reached the GraphQL query and surfaced asfailed to get suggested actors: ... Could not resolve to a Repository, which does not tell the caller what was actually wrong. The input schema already marks these three fields required, so this makes the handler enforce it, matching the existingis_suggestionandrationale/confidencechecks in the same handlers and theRequiredParamusage inrequest_copilot_review.What changed
owner,repo, orissue_numberwithmissing required parameter: <name>in bothAssignCopilotToIssueandAssignCopilotToIssueWithIntent.MCP impact
missing required parametererror for a missing required field instead of a confusing repository-resolution error.Prompts tested (tool changes only)
owneromitted now returnsmissing required parameter: owner. Verified via the new unit tests incopilot_test.go: a request missing each required field asserts the clear error, and without the fix it returns theCould not resolve to a Repository404 instead.Security / limits
Tool renaming