diff --git a/actions/setup/js/assign_agent_helpers.cjs b/actions/setup/js/assign_agent_helpers.cjs index a199efa7462..b431ec1cc66 100644 --- a/actions/setup/js/assign_agent_helpers.cjs +++ b/actions/setup/js/assign_agent_helpers.cjs @@ -359,10 +359,13 @@ async function assignAgentToIssue(assignableId, agentId, currentAssignees, agent if (customInstructions) debugMsg += `, customInstructions=${customInstructions.substring(0, 50)}...`; core.debug(debugMsg); + // Build GraphQL-Features header - include coding_agent_model_selection when model is provided + const graphqlFeatures = model ? "issues_copilot_assignment_api_support,coding_agent_model_selection" : "issues_copilot_assignment_api_support"; + const response = await github.graphql(mutation, { ...variables, headers: { - "GraphQL-Features": "issues_copilot_assignment_api_support", + "GraphQL-Features": graphqlFeatures, }, }); diff --git a/actions/setup/js/assign_agent_helpers.test.cjs b/actions/setup/js/assign_agent_helpers.test.cjs index 03328968147..f2088e79271 100644 --- a/actions/setup/js/assign_agent_helpers.test.cjs +++ b/actions/setup/js/assign_agent_helpers.test.cjs @@ -258,6 +258,11 @@ describe("assign_agent_helpers.cjs", () => { actorIds: ["AGENT_456", "USER_1"], }) ); + + // Should only include issues_copilot_assignment_api_support when model is not provided + const calledArgs = mockGithub.graphql.mock.calls[0]; + const variables = calledArgs[1]; + expect(variables.headers["GraphQL-Features"]).toBe("issues_copilot_assignment_api_support"); }); it("should preserve existing assignees when adding agent", async () => { @@ -324,6 +329,8 @@ describe("assign_agent_helpers.cjs", () => { expect(mutation).toContain("agentAssignment"); expect(mutation).toContain("model: $model"); expect(variables.model).toBe("claude-opus-4.6"); + // Should include coding_agent_model_selection feature flag when model is provided + expect(variables.headers["GraphQL-Features"]).toBe("issues_copilot_assignment_api_support,coding_agent_model_selection"); }); it("should include customAgent in agentAssignment when provided", async () => {