Skip to content

Allow model selection when assigning Copilot to an issue - #3990

Open
toutfic wants to merge 2 commits into
github:mainfrom
CALINFO-NC:feat/copilot-assignment-model
Open

toutfic wants to merge 2 commits into
github:mainfrom
CALINFO-NC:feat/copilot-assignment-model

Conversation

@toutfic

@toutfic toutfic commented Nov 30, 2026 •

Copy link
Copy Markdown

Summary

Add the optional string model to assign_copilot_to_issue. A client can pass the model identifier for a particular assignment or leave model selection to Copilot.

Why

An issue dispatcher may need to use a model chosen by the person delegating the work. Putting its name in custom_instructions only changes the prompt. This change passes the identifier to GitHub's assignment API.

This complements #2849, which adds custom_agent, and addresses the model-selection use case discussed in #2057. The two branches merge cleanly. A combined regression test on the fork verifies that both values reach GitHub in the same assignment.

MCP impact

  • The new argument is optional. Calls with an omitted or empty string produce the previous GraphQL variables and feature header.
  • With a model selected, the mutation sends agentAssignment.model and uses the documented coding_agent_model_selection feature header. GitHub determines model availability for the caller. GitHub assignment API
  • The input normalizer still converts legacy arguments before SDK validation and preserves additional launch options. The output schema, OAuth scope and tool name are unchanged.

Remote tool

create_pull_request_with_copilot is implemented by GitHub's hosted server. The public agent tasks API accepts model, custom_agent and create_pull_request, but returns an asynchronous task and exposes no equivalent to the MCP tool's required title. Hosted tool request #3015 · Start a task

Verification

  • Exercised tool calls with an omitted, empty and explicit model. The tests inspect the outgoing assignment JSON and HTTP header, including the behavior of base_ref and custom_instructions.
  • Verified on GitHub's live GraphQL schema that the model-selection header accepts both model and customAgent. The same validation rejects model when the historical and model-selection features are combined with the transport's comma-and-space format. A literal @skip(if: true) on the mutation field prevented execution.
  • Ran bash script/test (Go race detector), go vet ./... and golangci-lint v2.14.0. Regenerated the README and tool snapshot and updated the bundled Copilot delegation skill.

@toutfic
toutfic requested a review from a team as a code owner November 30, 2026 13:45
Copilot AI adaptive review requested due to automatic review settings November 30, 2026 13:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Maintainer validation is needed to confirm that the replacement GraphQL gate honors the selected model and preserves existing launch options during asynchronous Copilot execution, beyond schema validation.

No open issues 🎉

What changed in this PR

Adds optional model selection to assign_copilot_to_issue, allowing callers to choose a model through GitHub’s assignment API while preserving existing behavior when the model is omitted or empty.

Changes:

  • Passes the selected model in the assignment mutation and selects the corresponding feature header.
  • Preserves additional launch options during legacy input normalization.
  • Adds request-level tests and updates tool documentation, the schema snapshot, and delegation guidance.
File Description
README.md Documents the optional model argument.
pkg/​skills/​catalog/​skills/​copilot-task-delegation/​SKILL.md Explains how to delegate with a specified model.
pkg/​github/​typed_copilot_ui_outputs.go Preserves launch options during input normalization.
pkg/​github/​copilot.go Adds model input, mutation serialization, and feature-header selection.
pkg/​github/​copilot_test.go Covers omitted, empty, and explicit models in outgoing requests.
pkg/​github/​__toolsnaps__/​assign_copilot_to_issue.snap Records the updated tool input schema.

Review effort: Balanced (adaptive)

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.

2 participants