From 112473a2b7bd279ace1cae0ba68d8998d17f010a Mon Sep 17 00:00:00 2001 From: yunyingk Date: Fri, 11 Sep 2026 11:48:28 +0800 Subject: [PATCH 1/2] Use POST method for approval style preferences endpoint --- src/domains/seal/api.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/domains/seal/api.ts b/src/domains/seal/api.ts index cd37357..6446c74 100644 --- a/src/domains/seal/api.ts +++ b/src/domains/seal/api.ts @@ -274,10 +274,8 @@ export async function updateApprovalStylePreferences( params: Record, endpoint = "api/v1/agent/ai-approval/config" ): Promise { - return unwrap( - await client.patch(endpoint, { json: params }), - ApprovalStylePreferencesSchema - ); + await client.post(endpoint, { json: params }); + return getApprovalStylePreferences(client, endpoint); } export type WebhookMutationPreview = { From 55dcd20d48206307686e4e5f3c56f5f9a8f30d21 Mon Sep 17 00:00:00 2001 From: yunyingk Date: Fri, 11 Sep 2026 11:50:36 +0800 Subject: [PATCH 2/2] Update corps-bind test mock to expect POST for approval style preferences --- src/cli/commands/corps-bind.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cli/commands/corps-bind.test.ts b/src/cli/commands/corps-bind.test.ts index 2caa603..37bd59d 100644 --- a/src/cli/commands/corps-bind.test.ts +++ b/src/cli/commands/corps-bind.test.ts @@ -302,9 +302,9 @@ describe("corps sync-test", () => { expect(parsed.productionGuarantees.prodRulesStayDraft).toBe(true); expect(parsed.productionGuarantees.prodVersionPublished).toBe(false); - const patchPref = requests.find((r) => r.method === "PATCH" && r.path.includes("config")); - expect(patchPref).toBeDefined(); - expect((patchPref?.body as any).decisionPreferences?.explicitApprove).toBe("Prod approve note"); + const postPref = requests.find((r) => (r.method === "POST" || r.method === "PATCH") && r.path.includes("config")); + expect(postPref).toBeDefined(); + expect((postPref?.body as any).decisionPreferences?.explicitApprove).toBe("Prod approve note"); const deleteRule = requests.find((r) => r.method === "DELETE" && r.path === "/api/v1/rules/test-rule-old"); expect(deleteRule).toBeDefined(); @@ -402,10 +402,10 @@ function mockSealSyncRequests(options: { }); } - if (url.pathname === "/api/v1/agent/ai-approval/config" && method === "PATCH") { + if (url.pathname === "/api/v1/agent/ai-approval/config" && (method === "POST" || method === "PATCH")) { const body = JSON.parse(rawBody || "{}"); - options.onMutation?.("PATCH", url.pathname, body); - return jsonResponse({ data: body }); + options.onMutation?.(method, url.pathname, body); + return jsonResponse({ data: { success: true } }); } if (url.pathname === "/api/v1/rules" && method === "GET") {