Skip to content

fix(llm): avoid stream capture filename collisions - #938

Open
Chan-Developer wants to merge 1 commit into
evalstate:mainfrom
Chan-Developer:codex/unique-stream-capture-filenames
Open

fix(llm): avoid stream capture filename collisions#938
Chan-Developer wants to merge 1 commit into
evalstate:mainfrom
Chan-Developer:codex/unique-stream-capture-filenames

Conversation

@Chan-Developer

Copy link
Copy Markdown
Contributor

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

  • Include microseconds in shared OpenAI/Google stream-capture filenames.
  • Apply the same precision to Anthropic's provider-specific capture path.
  • Add deterministic regression tests for both filename builders.

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 passed
  • uv run scripts/format.py --check — passed
  • uv run scripts/lint.py — passed
  • uv run scripts/typecheck.py — passed
  • git diff --check — passed
  • Full unit suite: 7672 passed, 5 skipped, 11 unrelated local failures. The failures were caused by macOS /private/tmp normalization, 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.

@Chan-Developer

Copy link
Copy Markdown
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!

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.

1 participant