Skip to content

Commit 3d92d06

Browse files
committed
fix(api): attach anthropic abort signal via spread to drop the surviving guard mutant
1 parent 262ec50 commit 3d92d06

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/api/providers/anthropic.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
203203
betas.push("prompt-caching-2024-07-31")
204204
const requestOptions: Anthropic.RequestOptions = {
205205
headers: { "anthropic-beta": betas.join(",") },
206-
}
207-
if (abortSignal) {
208-
requestOptions.signal = abortSignal
206+
...(abortSignal && { signal: abortSignal }),
209207
}
210208
stream = await this.client.messages.create(
211209
requestParams as Anthropic.Messages.MessageCreateParamsStreaming,

0 commit comments

Comments
 (0)