fix(codex): respect command approval decisions

This commit is contained in:
Lucenx9
2026-04-25 03:32:34 +02:00
committed by Peter Steinberger
parent d4a9b28d0c
commit 453789914b
2 changed files with 19 additions and 1 deletions

View File

@@ -757,6 +757,24 @@ describe("Codex app-server approval bridge", () => {
},
},
});
expect(
buildApprovalResponse(
"item/commandExecution/requestApproval",
{ availableDecisions: ["decline"] },
"approved-once",
),
).toEqual({
decision: "decline",
});
expect(
buildApprovalResponse(
"item/commandExecution/requestApproval",
{ availableDecisions: ["decline"] },
"approved-session",
),
).toEqual({
decision: "decline",
});
expect(buildApprovalResponse("item/fileChange/requestApproval", undefined, "denied")).toEqual({
decision: "decline",
});

View File

@@ -274,7 +274,7 @@ function commandApprovalDecision(
return amendmentDecision;
}
}
return "accept";
return hasAvailableDecision(requestParams, "accept") ? "accept" : "decline";
}
function fileChangeApprovalDecision(outcome: AppServerApprovalOutcome): JsonValue {