fix(llm): avoid stream capture filename collisions - #938
Open
Chan-Developer wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Hi, just following up on this PR when convenient. The stream-capture filename collision fix and regression coverage are ready, and I would be happy to address any feedback. Thanks! |
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.
Root cause
Stream-capture filenames only included timestamps to the nearest second. Concurrent agent calls using the same provider and turn number could therefore select the same capture path, overwriting request JSON or interleaving JSONL chunks.
Changes
Validation
uv run pytest tests/unit/fast_agent/llm/provider/anthropic/test_stream_capture.py tests/unit/fast_agent/llm/providers/test_shared_stream_capture.py tests/unit/fast_agent/llm/providers/test_openai_stream_capture.py tests/unit/fast_agent/llm/providers/test_google_stream_capture.py -q— 10 passeduv run scripts/format.py --check— passeduv run scripts/lint.py— passeduv run scripts/typecheck.py— passedgit diff --check— passed/private/tmpnormalization, long temporary paths exceeding AF_UNIX limits or terminal width, and one durable-process timing failure; none involve the modified stream-capture modules.No matching issue or open PR was found.
This contribution was prepared with AI assistance and manually reviewed and tested by Jacob Chan.
Calfskin wallet
I would appreciate the gift, but I would feel uncomfortable using calfskin and would prefer a durable non-animal alternative.