Repository navigation
feat: add standby_request for calling Standby Actors, with per-request compression in HTTP clients - #1153
Draft
vdusek wants to merge 9 commits into
Draft
feat: add standby_request for calling Standby Actors, with per-request compression in HTTP clients#1153vdusek wants to merge 9 commits into
standby_request for calling Standby Actors, with per-request compression in HTTP clients#1153vdusek wants to merge 9 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1153 +/- ##
==========================================
+ Coverage 95.53% 95.56% +0.03%
==========================================
Files 61 61
Lines 5974 5995 +21
==========================================
+ Hits 5707 5729 +22
+ Misses 267 266 -1
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:
|
vdusek
added a commit
to apify/apify-docs
that referenced
this pull request
Oct 20, 2026
While working on better support for calling Standby Actors from the API client (apify/apify-client-python#1153), I couldn't find an explanation of how the authentication headers are handled (Maybe I just missed it?). I have two questions: 1. Does the Apify token reach the Actor's code? (It shouldn't.). 2. If an Actor needs its own authentication header, what's the best practice for sending it? Is it `X-Apify-Authorization`? I drafted a change; see the diff and suggest better/correct/more precise explanation. Thank you. (tagging @mvolfik, as I know a lot of the work there was done by you)
standby_request for calling Standby Actorsstandby_request for calling Standby Actors, with per-request compression in HTTP clients
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.
Adds
ActorClient.standby_request()(and the async twin) for sending HTTP requests to an Actor in Standby mode, so users don't have to look upstandby_urland attach the token by hand.The design follows the CLI RFC (apify/apify-cli#1299):
standbyUrlreturned by the API, so the token can't be sent to another host. Both built-in HTTP clients dropAuthorizationon a cross-host redirect.Authorizationheader. The Standby router removes it before forwarding, so it never reaches the Actor's code. An Actor that readsAuthorizationfor its own auth gets the Apify token inX-Apify-Authorizationinstead, as described in the platform docs.standbyUrlis fetched on the first call and reused by the same client.compressionargument opts in, with an algorithm name or anHttpCompressor.long, since the first request to an idle Actor waits for a Standby run to start.ApifyApiError, and 5xx/429 are retried like API calls. The docs say so, because a non-idempotent endpoint may get the request twice.To support the opt-in,
HttpClient.callandHttpClientAsync.calltake a per-requestcompressionargument:Trueuses the client's compressor, anHttpCompressoris used for that request only, andFalsesends the body uncompressed. A custom HTTP client that replacescallitself (not justsend_request) needs to accept the new argument to work withstandby_request.Also fixes the async docstring sync script, which turned
ApifyClientErrorinto the nonexistentApifyClientAsyncError.Naming keeps
standby, as agreed in #product-server-actors until the Server Actors rename reaches the API. Includes a concepts page covering authentication, compression, timeouts, and retries. JS parity: apify/apify-client-js#1159.Open question: keep
standby(it matches the current API fieldsstandbyUrlandactorStandby), switch to "server" to follow the Server Actors rename, or keepstandbyand mark the method experimental so it can be renamed later?Closes: #973
✍️ Drafted by Claude Code