Retain deletion recovery when native error status is missing

Signed-off-by: Codex <noreply@openai.com>
This commit is contained in:
Codex
2026-09-29 23:10:19 +00:00
parent 0736b704d6
commit 2224c12672
2 changed files with 17 additions and 0 deletions

View File

@@ -424,3 +424,19 @@ test("native status, never a body-claimed status, binds acceptance and abort", (
"retain",
);
});
test("missing native status cannot settle a typed deletion error", () => {
for (const code of ["future_code", "not_owner", "must_archive"]) {
for (const attempt of ["initial", "check"]) {
assert.equal(
deletionResponseDisposition(
{ body: { error: { code } } },
envelope,
attempt,
),
"retain",
attempt + " " + code + " without native status is ambiguous",
);
}
}
});

View File

@@ -239,6 +239,7 @@ export function deletionResponseDisposition(
].some((field) => Object.hasOwn(response, field));
if (
code &&
typeof status === "number" &&
(!suppliedTuple || tupleMatches) &&
DEFINITIVE_ERRORS[code] === status &&
(attempt === "initial" || !FRESH_ONLY_ERRORS.has(code))