Skip to content

Return a clear error for missing owner/repo/issue_number in the copilot assignment tools - #3221

Open
thejdubb02 wants to merge 1 commit into
github:mainfrom
thejdubb02:fix/copilot-assign-required-params
Open

Return a clear error for missing owner/repo/issue_number in the copilot assignment tools#3221
thejdubb02 wants to merge 1 commit into
github:mainfrom
thejdubb02:fix/copilot-assign-required-params

Conversation

@thejdubb02

Copy link
Copy Markdown

Summary

Return a clear missing required parameter error when owner, repo, or issue_number is omitted from assign_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 as failed 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 existing is_suggestion and rationale/confidence checks in the same handlers and the RequiredParam usage in request_copilot_review.

What changed

  • After decoding, reject a zero-value owner, repo, or issue_number with missing required parameter: <name> in both AssignCopilotToIssue and AssignCopilotToIssueWithIntent.
  • Added table tests for the missing cases.

MCP impact

  • Tool schema or behavior changed
    • No schema change (the three fields were already marked required). The two tools now return a clear missing required parameter error for a missing required field instead of a confusing repository-resolution error.

Prompts tested (tool changes only)

  • "Assign Copilot to this issue" with owner omitted now returns missing required parameter: owner. Verified via the new unit tests in copilot_test.go: a request missing each required field asserts the clear error, and without the fix it returns the Could not resolve to a Repository 404 instead.

Security / limits

  • No security or limits impact

Tool renaming

  • I am not renaming tools as part of this PR

…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.
@thejdubb02
thejdubb02 requested a review from a team as a code owner September 3, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant