fix: rework claude batch API implementation#1263
Open
tasoo-oos wants to merge 1 commit intokwaroran:mainfrom
Open
fix: rework claude batch API implementation#1263tasoo-oos wants to merge 1 commit intokwaroran:mainfrom
tasoo-oos wants to merge 1 commit intokwaroran:mainfrom
Conversation
935e434 to
ed281c0
Compare
Contributor
Author
|
I saw this commit caused merge conflict. |
Contributor
Author
|
I resolved merge conflict with the new commits related to plugin v3 interceptor flag. |
- Convert batch polling from plain while-loop to ReadableStream for streaming response, bypassing abort signal cancellation mechanism - Add batch cancellation support via dedicated cancel endpoint - Handle thinking/redacted_thinking content blocks in batch responses - Add 24-hour timeout for batch requests - Use controller.error() instead of passing errors as stream chunks - Reuse headers variable instead of inline header objects
a9c9c85 to
c555455
Compare
10 tasks
Contributor
Author
|
Rebased past commits to work with #1304 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Summary
Related Issues
None
Changes
Before this change:
batchData.result.message.content?.[0]?.text ?? '')message.contentAfter this change:
v1/messages/batches/$MESSAGE_BATCH_ID/cancel)Impact
StreamResponseChunk) instead of returning plain JSON in order to bypass AbortSignal Check on other parts of the codebase.request.tsandindex.svelte.tsshould be edited to bypass abort signal check. That decision seemed risky for this small change since that could cause unexpected failure to abort API request with other model requests.'anthropic_batching_cancel'passed down tofetchNative.Additional Notes
I have written very few PR before, so I hope this comment is helpful enough.
Footnotes
Modifies the behavior of prompting, requesting or handling responses from ai models. ↩
Almost over 80% of the code is ai generated. ↩