Skip to content

Update Execution Streaming APIs and add retries on timeouts#638

Merged
alb-rl merged 5 commits intomainfrom
alb/retry-execution-log-stream
Sep 9, 2025
Merged

Update Execution Streaming APIs and add retries on timeouts#638
alb-rl merged 5 commits intomainfrom
alb/retry-execution-log-stream

Conversation

@alb-rl
Copy link
Copy Markdown
Contributor

@alb-rl alb-rl commented Sep 9, 2025

This PR updates the streaming endpoints for executions. Before, it was just stream_updates. Now, it's separated into stream_stdout_updates and stream_stderr_updates.

Similar to runloopai/api-client-ts#611, this PR also enables reconnecting streams on timeouts.

When auto-reconnect is used:

  • For normal method calls (e.g., stream_stdout_updates / stream_stderr_updates), the auto-reconnect wrapper is returned.
  • If you call through with_raw_response or with_streaming_response, the raw stream is returned directly (no auto-reconnect).

Stop conditions:

  • Stream finishes and yields no more items (normal completion).
  • Non-timeout error is raised (e.g., 4xx/5xx other than 408, parse errors).
  • You break out of the loop or call close().

@alb-rl alb-rl changed the title Alb/retry execution log stream Retry execution log stream on timeouts Sep 9, 2025
Copy link
Copy Markdown
Contributor

@tode-rl tode-rl left a comment

Choose a reason for hiding this comment

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

Looks ok to me but would prefer a 2nd look by someone with more prod python experience

@alb-rl alb-rl force-pushed the alb/retry-execution-log-stream branch from b343bc7 to 52a155e Compare September 9, 2025 19:23
@alb-rl alb-rl force-pushed the alb/retry-execution-log-stream branch from 52a155e to ddcf283 Compare September 9, 2025 19:30
@alb-rl alb-rl changed the title Retry execution log stream on timeouts Update Execution Streaming APIs and add retries on timeouts Sep 9, 2025
@alb-rl alb-rl merged commit 3048f8b into main Sep 9, 2025
7 checks passed
@alb-rl alb-rl deleted the alb/retry-execution-log-stream branch September 9, 2025 19:40
@alb-rl alb-rl mentioned this pull request Sep 9, 2025
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