Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1253 +/- ##
==========================================
+ Coverage 91.39% 91.54% +0.14%
==========================================
Files 65 65
Lines 6798 6892 +94
==========================================
+ Hits 6213 6309 +96
+ Misses 585 583 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pijukatel
force-pushed
the
claude/affectionate-fermi-74vvu9
branch
from
November 25, 2026 08:26
56f958a to
44f93a7
Compare
Pijukatel
changed the base branch from
master
to
claude/intelligent-cerf-xz42y2
November 25, 2026 08:26
Pijukatel
marked this pull request as ready for review
November 25, 2026 12:57
vdusek
reviewed
Nov 27, 2026
since to streamed logs and reopen closed streams
Pijukatel
force-pushed
the
claude/affectionate-fermi-74vvu9
branch
from
November 27, 2026 10:39
43356e5 to
fbd56b4
Compare
…rm closes the stream `RunClient.get_streamed_log()`, `StreamedLog`, and their async counterparts take a `since` datetime and redirect only the log lines logged at that time or later. The `from_start` argument is deprecated in favour of it: `from_start=True` maps to `since=None` and `from_start=False` to `since=datetime.now(tz=UTC)`. It emits a `DeprecationWarning` and will be removed in v4, which the new v4 upgrading guide describes. The platform closes a log stream that has carried no data for several minutes, even when the run is still going (apify/apify-core#26653). A streamed log created by `get_streamed_log()` now checks the run status when its stream ends, reopens the stream if the run has not finished, and skips the replayed lines up to the last redirected one. A stream that broke off with an error gets one more reopen after the run finishes, so the last lines are not lost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
…warning Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
…eams from it `StreamedLog` and `StreamedLogAsync` get a read-only `last_redirected_at` property with the timestamp of the last redirected line, so a redirection can be continued in another process, for example after the redirecting Actor reboots, by passing it plus one millisecond as `since`. A stream reopened after the platform closes it uses the same rule: it redirects only lines logged after `last_redirected_at`, which replaces the tracking of how many lines share the last timestamp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
…r reboots The test builds two Actors: one that logs numbered lines, and one that runs a wheel of the client from this checkout. The second one redirects the first one's log, saves `last_redirected_at` to its key-value store, reboots, and resumes with `since`. The test checks that every line was redirected exactly once, with some lines before the reboot and some after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
…x minutes The Actor under test logs a counter for 30 seconds, counts silently until 390 seconds, which is longer than the platform keeps an idle log stream open, and then logs the counter again. The test checks that `ActorClient.call` redirects every logged line exactly once and that the log stream was reopened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
A redirector Actor running a wheel of the client from this checkout calls the silent counting Actor with the default logger, so the redirected lines land in the redirector's own log. The test checks that log for every counter line, exactly once, and for the number of times the log stream was opened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
… backoff Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
…atch-up reopen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
Measured on the platform: a log stream cut off for being idle always fails with a transport error (impit: `RemoteProtocolError`, after 330 s on the in-platform API URL and up to 360 s on the public one), while a stream that ends without an error has always delivered the whole log of a finished run. The run status read right after such a clean end was not terminal yet in 11 of 26 runs, so reopening on a non-terminal status downloaded the whole log a second time. The redirection now reopens a stream only when reading it failed after it had delivered data, and stops at a clean end. It no longer reads the run status, so `StreamedLog` no longer takes a `run_client`. Messages replayed by the reopened stream are skipped up to the last redirected timestamp without changing `since`. A stream timeout ends the redirection as before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAJFbkcdJ8X36dT46m4
Only a failed read of the stream means it broke off. A failure to process a received line, such as an undecodable byte, repeats on every replay, so treating it as a broken stream re-downloaded the whole log once a second until `stop`. It now ends the redirection with a logged error again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAJFbkcdJ8X36dT46m4
A stream read that fails is reopened only when the HTTP client classifies the error as a retryable transport error that is not a timeout, instead of after any exception. The error both built-in transports raise when the platform cuts off an idle stream (`RemoteProtocolError`) is classified so. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAJFbkcdJ8X36dT46m4
…ing a replay that makes no progress - A reopened stream skips the replayed messages by timestamp and by how many messages at the last timestamp were already redirected, so a stream that breaks off inside a group of same-millisecond lines loses none of them. - A reopened stream that breaks off again before it replays the last redirected line ends the redirection with a warning, instead of reopening and downloading the log again at the same point indefinitely. - The `from_start` deprecation warning uses `stacklevel=3`. - `_is_broken_read` moves to `StreamedLogBase`, the async `last_redirected_at` docstring names `RunClientAsync.get_streamed_log`, and a comment about `stop` no longer assumes that no earlier stream delivered data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
The removal of `from_start` is tracked in #1259. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ocuAHA5qh4VqF6Ps7XR5p
Pijukatel
force-pushed
the
claude/affectionate-fermi-74vvu9
branch
from
November 27, 2026 14:08
c5d9b74 to
2729297
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_streamed_log()andStreamedLogtakesince: datetime | None.from_startis deprecated; its removal in v4 is tracked in Delete deprecatedfrom_startand update upgrading guide #1259.StreamedLog.last_redirected_at: pass it plus 1 ms assinceto continue the redirection after a reboot.last_redirected_atare skipped. The reopen re-downloads the whole log, because the API can't start from a given point.