From abdbd40baf5dea6e362ed865b300cab4ecf26f41 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Jan 2026 09:57:18 +0000 Subject: [PATCH 1/2] Initial plan From 0e57041e9e74b4e3a36cbcc563a927e526455bb4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Jan 2026 10:01:26 +0000 Subject: [PATCH 2/2] Fix dismiss_notification to accept HTTP 204 No Content response - Add http.StatusNoContent (204) to the list of accepted success status codes - Add test case for 204 response when marking notification as done - Retain existing test for 200 response for backwards compatibility Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com> --- pkg/github/notifications.go | 2 +- pkg/github/notifications_test.go | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pkg/github/notifications.go b/pkg/github/notifications.go index 1de24fb0d..1d695beb3 100644 --- a/pkg/github/notifications.go +++ b/pkg/github/notifications.go @@ -231,7 +231,7 @@ func DismissNotification(t translations.TranslationHelperFunc) inventory.ServerT } defer func() { _ = resp.Body.Close() }() - if resp.StatusCode != http.StatusResetContent && resp.StatusCode != http.StatusOK { + if resp.StatusCode != http.StatusResetContent && resp.StatusCode != http.StatusNoContent && resp.StatusCode != http.StatusOK { body, err := io.ReadAll(resp.Body) if err != nil { return utils.NewToolResultErrorFromErr("failed to read response body", err), nil, nil diff --git a/pkg/github/notifications_test.go b/pkg/github/notifications_test.go index 936a70df4..d2124ae3d 100644 --- a/pkg/github/notifications_test.go +++ b/pkg/github/notifications_test.go @@ -472,7 +472,19 @@ func Test_DismissNotification(t *testing.T) { expectRead: true, }, { - name: "mark as done", + name: "mark as done with 204 response", + mockedClient: MockHTTPClientWithHandlers(map[string]http.HandlerFunc{ + DeleteNotificationsThreadsByThreadID: mockResponse(t, http.StatusNoContent, nil), + }), + requestArgs: map[string]interface{}{ + "threadID": "123", + "state": "done", + }, + expectError: false, + expectDone: true, + }, + { + name: "mark as done with 200 response", mockedClient: MockHTTPClientWithHandlers(map[string]http.HandlerFunc{ DeleteNotificationsThreadsByThreadID: mockResponse(t, http.StatusOK, nil), }),