Unbounded streaming buffers (OOM risk) #6
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: High
In
streamAnthropicandstreamResponses, text/reasoning content is accumulated in unboundedstrings.Builder:These grow without limit. A malicious upstream that streams an infinite response (or a very long one) causes OOM.
Files:
cmd/ocgo/main.go:1063,1192Fix: Cap the builders at a reasonable limit (e.g., truncate after N bytes).