Skip to content

fix: set max capacity for ssestream decoder bufio scanner #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alecrubin
Copy link

Override the default bufio.Scanner max capacity in the ssestream.Decoder.

Fixes #368

@alecrubin alecrubin requested a review from a team as a code owner April 15, 2025 15:54
@@ -14,6 +14,11 @@ import (
"github.com/tidwall/gjson"
)

const (
// ScannerMaxCapacity is the maximum capacity of the scanner buffer used in the decoder.
DecoderScannerMaxCapacity = 512 * 1024 // 512 KiB
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the right value to set here is, hopefully someone from the OpenAI team can tell us what the max size needs to be, but I didn't notice any token too long errors after increasing the capacity to this.

@jacobzim-stl
Copy link
Collaborator

Thanks @alecrubin, we'll get this fix in. Unfortunately it needs to be implemented in the code-generator, so this PR directly be merged.

@alecrubin
Copy link
Author

Thanks @alecrubin, we'll get this fix in. Unfortunately it needs to be implemented in the code-generator, so this PR directly be merged.

Great, thanks @jacobzim-stl!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Responses API Streaming: token too long error
2 participants