@@ -118,6 +118,8 @@ func consolidatedPullRequestDeps(t *testing.T) BaseDeps {
118118 case path == "/repos/owner/repo/pulls/2" :
119119 // A sparse PR without a head SHA still yields a valid status payload.
120120 write (http .StatusOK , `{"number":2,"head":{"sha":"abc"}}` )
121+ case path == "/repos/owner/repo/pulls/4" :
122+ write (http .StatusOK , `{"number":4,"title":"Enabled","state":"open","html_url":"https://github.com/owner/repo/pull/4","auto_merge":{"merge_method":"squash","enabled_by":{"login":"octocat"}}}` )
121123 case path == "/repos/owner/repo/pulls/3" :
122124 // A successful null API payload is normalized to the legacy zero-value PR.
123125 write (http .StatusOK , `null` )
@@ -261,10 +263,11 @@ func runTypedPullRequestCases(t *testing.T, session *mcp.ClientSession, schemas
261263}
262264
263265func TestTypedConsolidatedPullRequestOutputs (t * testing.T ) {
264- const minimalPR = `{"number":1,"title":"Subject","body":"body","state":"open","draft":false,"merged":false,"mergeable_state":"clean","html_url":"https://github.com/owner/repo/pull/1","user":{"login":"octocat"},"head":{"ref":"feature","sha":"abc"},"base":{"ref":"main","sha":"def"},"created_at":"2026-01-01T00:00:00Z","updated_at":"2026-01-01T00:00:00Z"}`
266+ const minimalPR = `{"number":1,"title":"Subject","body":"body","state":"open","draft":false,"merged":false,"mergeable_state":"clean","html_url":"https://github.com/owner/repo/pull/1","user":{"login":"octocat"},"head":{"ref":"feature","sha":"abc"},"base":{"ref":"main","sha":"def"},"created_at":"2026-01-01T00:00:00Z","updated_at":"2026-01-01T00:00:00Z","auto_merge":null }`
265267 const prRef = `{"id":"0","url":"https://github.com/owner/repo/pull/1"}`
266268 cases := []typedPullRequestCase {
267269 {"pull_request_read" , map [string ]any {"method" : "get" , "pullNumber" : "1" }, minimalPR },
270+ {"pull_request_read" , map [string ]any {"method" : "get" , "pullNumber" : 4 }, `{"number":4,"title":"Enabled","state":"open","draft":false,"merged":false,"html_url":"https://github.com/owner/repo/pull/4","auto_merge":{"merge_method":"squash","enabled_by":"octocat"}}` },
268271 {"pull_request_read" , map [string ]any {"method" : "get" , "pullNumber" : 3 }, `null` },
269272 {"pull_request_read" , map [string ]any {"method" : "get_diff" , "pullNumber" : 1.0 }, typedPRDiff },
270273 {"pull_request_read" , map [string ]any {"method" : "get_status" , "pullNumber" : 1 }, `{"state":"success","sha":"abc","total_count":1,"statuses":[{"state":"success","context":"ci","target_url":"https://ci"}]}` },
@@ -510,7 +513,7 @@ func TestTypedPullRequestContentParity(t *testing.T) {
510513 require .NoError (t , schemas ["pull_request_read" ].Validate (result .StructuredContent ))
511514 } else {
512515 assert .Nil (t , result .StructuredContent )
513- assert .Equal (t , `{"number":1,"title":"Subject","body":"body","state":"open","draft":false,"merged":false,"html_url":"https://github.com/owner/repo/pull/1","user":{"login":"octocat"}}` , text )
516+ assert .Equal (t , `{"number":1,"title":"Subject","body":"body","state":"open","draft":false,"merged":false,"html_url":"https://github.com/owner/repo/pull/1","user":{"login":"octocat"},"auto_merge":null }` , text )
514517 }
515518 })
516519 }
@@ -525,7 +528,7 @@ func TestConsolidatedPullRequestOutputSchemas(t *testing.T) {
525528 }{
526529 {
527530 pullRequestReadOutputSchema (),
528- []string {`null` , `[]` , `{"diff":""}` , `{"number":1,"title":"","state":"","draft":false,"merged":false,"html_url":""}` , `{"state":"","sha":"","total_count":0,"statuses":[]}` , `{"total_count":0,"check_runs":[]}` , `{"review_threads":[],"totalCount":0,"pageInfo":{"hasNextPage":false,"hasPreviousPage":false}}` , `[{"filename":"f"}]` , `[{"id":1,"html_url":""}]` },
531+ []string {`null` , `[]` , `{"diff":""}` , `{"number":1,"title":"","state":"","draft":false,"merged":false,"html_url":"","auto_merge":null}` , `{"number":1,"title":"","state":"","draft":false,"merged":false,"html_url":"","auto_merge":{"merge_method":"squash","enabled_by":"octocat"} }` , `{"state":"","sha":"","total_count":0,"statuses":[]}` , `{"total_count":0,"check_runs":[]}` , `{"review_threads":[],"totalCount":0,"pageInfo":{"hasNextPage":false,"hasPreviousPage":false}}` , `[{"filename":"f"}]` , `[{"id":1,"html_url":""}]` },
529532 []string {`{}` , `"diff"` , `{"diff":1}` , `[{"unknown":1}]` , `{"number":1}` , `{"number":1,"title":"","state":"unknown","draft":false,"merged":false,"html_url":""}` },
530533 },
531534 {
0 commit comments