From 230c5d4a5cc31656de3d46719e7f4d2a13369991 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 27 Aug 2026 03:27:28 -0400 Subject: [PATCH] fix(server): recover stale Codex approval callbacks (#5195) --- .../orchestration/Layers/ProviderCommandReactor.test.ts | 6 +++--- .../src/orchestration/Layers/ProviderCommandReactor.ts | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts index a22a7acfb7054034cbb4cc8c64048ead82aa6d7b..a3588244d827afb194e33d5d48cc69584eb3b164 100644 --- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts +++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts @@ -2970,15 +2970,15 @@ describe("ProviderCommandReactor", () => { }); }); - it("surfaces stale provider approval request failures without faking approval resolution", async () => { + it("normalizes stale Codex approval callbacks without faking approval resolution", async () => { const harness = await createHarness(); const now = "2026-01-01T00:00:00.000Z"; harness.respondToRequest.mockImplementation(() => Effect.fail( new ProviderAdapterRequestError({ provider: ProviderDriverKind.make("codex"), - method: "session/request_permission", - detail: "Unknown pending permission request: approval-request-1", + method: "item/requestApproval/decision", + detail: "Unknown pending Codex approval request: approval-request-1", }), ), ); diff --git a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts index 1c0091028addb7173d66a4d9d0cd0c4ab00f4b7e..812893d8c8431d5dbc8bf71adb6d79543984dcb6 100644 --- a/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts +++ b/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts @@ -241,13 +241,15 @@ function isUnknownPendingApprovalRequestError(cause: Cause.Cause