Repository navigation
fix(agent-stream): batch contiguous tool argument fragments - #4006
Merged
kev1n77 merged 1 commit intoNov 19, 2026
Merged
Conversation
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.
Summary
Fixes #4005
ParamsPartialdeltas for the same tool call within a stream attempt, using a 16 ms window and a 4 KiB buffer limit.Type and Areas
Bug fix in the shared Rust
agent-streamcrate.Motivation / Impact
The runtime journal was serializing a full record for every small argument fragment. In the original isolated macOS Desktop reproduction, the same 33,224 bytes of
ExecCommandarguments now produce 349ParamsPartialrecords and a 177,239-byte journal. The baseline was 33,224 records and 13,645,695 bytes, a 98.7% size reduction. Reassembled arguments matched the single-fragment control byte for byte, and the tool completed successfully.Verification
cargo test --locked -p openbitfun-agent-stream— 86 passed, including tool interleaving, argument snapshots, byte and idle-time flushes, and cancellation ordering.cargo test --locked -p openbitfun-ai-adapters --test ai_stream_contracts stream_processor_openai— 12 passed.cargo test --locked -p openbitfun-agent-runtime --no-default-features --features agent-runtime --lib session_event_journal— 18 passed.cargo build --locked -p openbitfun-desktop --bin openbitfun-desktop— passed on macOS.snapshotRequired.Reviewer Notes
AI-assisted. Testing level was full for the local Desktop reproduction and focused Rust suites. Native Desktop evidence was collected on an isolated build with the same stream patch. Live Peer Device, SSH workspaces, Remote Connect, and Detached Dispatch were outside the test scope.
Checklist