Skip to content

refactor(session): simplify LLM stream by replacing queue with fromAsyncIterable#20324

Merged
thdxr merged 1 commit intodevfrom
refactor/llm-stream-cleanup
Mar 31, 2026
Merged

refactor(session): simplify LLM stream by replacing queue with fromAsyncIterable#20324
thdxr merged 1 commit intodevfrom
refactor/llm-stream-cleanup

Conversation

@thdxr
Copy link
Copy Markdown
Member

@thdxr thdxr commented Mar 31, 2026

Summary

Simplifies the LLM streaming implementation by removing the manual queue-based approach and using Stream.fromAsyncIterable directly.

Changes

  • Removes the Queue.unbounded and manual queue management
  • Replaces async queue filling with direct Stream.fromAsyncIterable usage
  • Simplifies error handling by passing error mapper directly to fromAsyncIterable
  • Reduces code complexity (15 deletions, 5 insertions)

This change makes the stream handling more idiomatic and reduces potential race conditions with the queue-based approach.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@thdxr thdxr merged commit 567a911 into dev Mar 31, 2026
11 checks passed
@thdxr thdxr deleted the refactor/llm-stream-cleanup branch March 31, 2026 19:27
jeromelau pushed a commit to jeromelau/opencode that referenced this pull request Apr 2, 2026
vicary pushed a commit to vicary/opencode that referenced this pull request Apr 6, 2026
balcsida pushed a commit to balcsida/opencode that referenced this pull request Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant