fix(types): preserve thinking signature recovery failure (#9114)

Validated in local merge-train (devbox-vm-06-dev002) @ combined-tip (FAST gates: typecheck/complexity/cognitive/changelog/vitest — only pre-existing audit.test.ts flake). Evidence: /home/diegosouzapw/dev/proxys/OmniRoute/.claude/worktrees/merge-train-20260805-222248-suite.log
This commit is contained in:
backryun
2026-08-06 10:30:22 +09:00
committed by GitHub
parent b276453f29
commit 1fd4087995
2 changed files with 4 additions and 1 deletions

View File

@@ -0,0 +1 @@
- **fix(types):** preserved the known first-failure record while reading Anthropic thinking-signature recovery details so TypeScript 7 keeps the retry result union narrow ([#8484](https://github.com/diegosouzapw/OmniRoute/issues/8484))

View File

@@ -69,7 +69,9 @@ export async function recoverAnthropicThinkingSignature(args: {
return args.execute(requestBody);
},
getError: async (result) => {
if (result === firstFailure) return { status: result.status, message: result.message };
if (result === firstFailure) {
return { status: firstFailure.status, message: firstFailure.message };
}
if (result.response.ok) return null;
const details = await args.parseError(result.response.clone());
return { status: details.statusCode, message: details.message };