fix(llm/tools): emit all tool_calls per SSE chunk and cap web body memory#247
Merged
Conversation
…mory - parse_sse_line now returns Vec<LlmResponseDelta> and yields every entry in delta.tool_calls, fixing silent drops of parallel tool-call fragments. - Add tools::util::read_body_with_cap for bounded HTTP body reads; applied in web_fetch (4 MiB) and web_search (2 MiB JSON / 64 KiB errors) to bound peak memory against large or malicious responses. - LLM error bodies are now also capped when reporting non-2xx responses. - Added UTF-8-boundary-safe truncation and unit tests. Closes #233, closes #234 chore(release): v0.45.4
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.
Closes #233, closes #234.
parse_sse_linenow returnsVec<LlmResponseDelta>and yields every entry indelta.tool_calls, fixing silent drops of parallel tool-call fragments.tools::util::read_body_with_capfor bounded HTTP body reads; applied inweb_fetch(4 MiB) andweb_search(2 MiB JSON / 64 KiB errors) to bound peak memory against large or malicious responses.Checklist:
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspacecargo build --release