Conversation
…tor on cancel; lazy-init stdout/stderr to avoid eager SandboxGetLogs; enable docker mock test Co-authored-by: Matthew Saltz <saltzm@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
PR SummaryMedium Risk Overview Adds short exponential backoff and retry counter reset behavior to the Written by Cursor Bugbot for commit bd129b4. This will update automatically on new commits. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
…ts and honor AbortSignal during backoff Co-authored-by: Matthew Saltz <saltzm@users.noreply.github.com>
…ents in streams.ts; keep onCancel, cancel semantics unchanged Co-authored-by: Matthew Saltz <saltzm@users.noreply.github.com>
…ram; update call sites Co-authored-by: Matthew Saltz <saltzm@users.noreply.github.com>
Co-authored-by: Matthew Saltz <saltzm@users.noreply.github.com>
…guard and cleanup Co-authored-by: Matthew Saltz <saltzm@users.noreply.github.com>
Co-authored-by: Matthew Saltz <saltzm@users.noreply.github.com>
… reset, cancel) Co-authored-by: Matthew Saltz <saltzm@users.noreply.github.com>
…ses setTimeout and format Co-authored-by: Matthew Saltz <saltzm@users.noreply.github.com>
Co-authored-by: Matthew Saltz <saltzm@users.noreply.github.com>
ehdr
left a comment
There was a problem hiding this comment.
This overall looks good to me! Sent some comments over Slack too.
I believe I made the Go implementation lazy as well, but we don't have the backoff for retries, so I'd guess Go could also end up in a tight retry loop? So would be good to look into that as well!
…Iter JSDoc; switch tests to import from "modal"; add tests for non-retryable, retry exhaustion, and lastEntryId resumption Co-authored-by: Matthew Saltz <saltzm@users.noreply.github.com>
Implement retry backoff for sandbox log fetches, make stdout/stderr lazy, and ensure cancelable iterators stop consumption to improve resource management and responsiveness.
The previous implementation eagerly started log streams (
SandboxGetLogs) uponSandboxobject creation, even ifstdoutorstderrwere never accessed. This PR changesstdoutandstderrto be lazy-initialized, only starting the underlying gRPC stream when first accessed. Additionally, it adds exponential backoff toSandboxGetLogsretries to prevent hammering the server on transient errors and modifies stream cancellation to immediately stop consumption, preventing unnecessary resource usage. This also enables a previously skipped test that relied on lazy log streaming behavior.Slack Thread