Skip to content

Conversation

@LZL0
Copy link
Member

@LZL0 LZL0 commented Dec 20, 2025

Summary by cubic

Fixes retry behavior in structured() and structured_array() so stream factory functions are called fresh on each attempt and direct iterators are wrapped correctly, preventing “stream already consumed” and “ReadableStream is locked” errors.

  • Bug Fixes
    • Pass factory functions directly to _internal_run; wrap direct async iterators in a lambda so buffered streams can replay across retries.
    • Apply the fix in both single-stream and multi-stream/fallback paths.
    • Add tests covering structured(), structured_array(), async factories, fallbacks, and retry/exhaustion scenarios.

Written for commit 7fa6674. Summary will update automatically on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@LZL0 LZL0 merged commit 8a5ed0a into master Dec 20, 2025
5 checks passed
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.

2 participants