@@ -14,28 +14,30 @@ namespace GitHub.Copilot.Test.E2E;
1414public partial class StructuredOutputE2ETests ( E2ETestFixture fixture , ITestOutputHelper output )
1515 : E2ETestBase ( fixture , "structured_output" , output )
1616{
17- private SessionConfig StructuredSessionConfig ( ) => new ( )
18- {
19- Model = "gpt-4.1" ,
20- AvailableTools = [ ] ,
21- Provider = new ProviderConfig
17+ private SessionConfig StructuredSessionConfig ( ) => E2ETestBackendConfiguration . Current != E2ETestBackend . Capi
18+ ? new ( ) { AvailableTools = [ ] }
19+ : new ( )
2220 {
23- Type = "openai" ,
24- WireApi = "completions" ,
25- BaseUrl = Ctx . ProxyUrl ,
26- ModelId = "gpt-4.1" ,
27- WireModel = "gpt-4.1" ,
28- ApiKey = Environment . GetEnvironmentVariable ( "GITHUB_ACTIONS" ) == "true"
21+ Model = "gpt-4.1" ,
22+ AvailableTools = [ ] ,
23+ Provider = new ProviderConfig
24+ {
25+ Type = "openai" ,
26+ WireApi = "completions" ,
27+ BaseUrl = Ctx . ProxyUrl ,
28+ ModelId = "gpt-4.1" ,
29+ WireModel = "gpt-4.1" ,
30+ ApiKey = Environment . GetEnvironmentVariable ( "GITHUB_ACTIONS" ) == "true"
2931 ? "fake-token-for-e2e-tests"
3032 : Environment . GetEnvironmentVariable ( "GITHUB_TOKEN" ) ?? "fake-token-for-e2e-tests" ,
31- Headers = new Dictionary < string , string >
32- {
33- [ "Copilot-Integration-Id" ] = "copilot-developer-cli" ,
34- [ "Copilot-Harness-Id" ] = "copilot-sdk" ,
35- [ "X-GitHub-Api-Version" ] = "2026-08-01" ,
33+ Headers = new Dictionary < string , string >
34+ {
35+ [ "Copilot-Integration-Id" ] = "copilot-developer-cli" ,
36+ [ "Copilot-Harness-Id" ] = "copilot-sdk" ,
37+ [ "X-GitHub-Api-Version" ] = "2026-08-01" ,
38+ } ,
3639 } ,
37- } ,
38- } ;
40+ } ;
3941
4042 [ Fact ]
4143 public async Task Infers_Typed_Result_After_Custom_Tool ( )
@@ -93,9 +95,8 @@ public async Task Sends_Explicit_Schema_For_Message_And_Batch()
9395 """{"type":"object","properties":{"count":{"type":"integer"},"color":{"type":"string"}},"required":["count","color"],"additionalProperties":false}""" ) ;
9496 var accepted = await session . Rpc . SendMessagesAsync (
9597 [ new ( ) { Prompt = "There are 42 red widgets in stock." } , new ( ) { Prompt = "Report the widget count and color." } ] ,
96- responseFormat : new ResponseFormat
98+ responseFormat : new ResponseFormatJsonSchema
9799 {
98- Type = "json_schema" ,
99100 JsonSchema = new JsonSchemaResponseFormat
100101 {
101102 Name = "inventory" ,
@@ -339,9 +340,8 @@ public async Task Rejects_Unsupported_Or_Oversized_Schemas_Before_Admission()
339340 } ) ) ;
340341 Assert . Contains ( message , error . Message ) ;
341342 error = await Assert . ThrowsAnyAsync < Exception > ( ( ) =>
342- session . Rpc . SendMessagesAsync ( [ ] , responseFormat : new ResponseFormat
343+ session . Rpc . SendMessagesAsync ( [ ] , responseFormat : new ResponseFormatJsonSchema
343344 {
344- Type = "json_schema" ,
345345 JsonSchema = new ( ) { Name = "response" , Schema = schema . RootElement } ,
346346 } ) ) ;
347347 Assert . Contains ( message , error . Message ) ;
0 commit comments