Skip to content

chore: refactor attempt_stream_responses() out of stream_responses()#4194

Merged
bolinfest merged 1 commit intomainfrom
pr4194
Sep 25, 2025
Merged

chore: refactor attempt_stream_responses() out of stream_responses()#4194
bolinfest merged 1 commit intomainfrom
pr4194

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Sep 24, 2025

I would like to be able to swap in a different way to resolve model sampling requests, so this refactoring consolidates things behind attempt_stream_responses() to make that easier. Ideally, we would support an in-memory backend that we can use in our integration tests, for example.

Comment thread codex-rs/core/src/client.rs
Comment thread codex-rs/core/src/client.rs Outdated
}

enum RetryDirective {
Http {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This feels like an error type

@bolinfest
Copy link
Copy Markdown
Collaborator Author

changed the function to return Result<ResponseStream, StreamAttemptError>

@bolinfest bolinfest merged commit a0c37f5 into main Sep 25, 2025
19 checks passed
@bolinfest bolinfest deleted the pr4194 branch September 25, 2025 17:34
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants