-
Notifications
You must be signed in to change notification settings - Fork 38
feat(actors): enables standby mode via actor.json #991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(actors): enables standby mode via actor.json #991
Conversation
|
Keeping this as draft, it is working but it seems we missing some types in apify-client, lets discuss. |
|
lest's wait for #992 merged and then rebase |
Enables standby mode for Actors based on the 'usesStandbyMode' property in actor.json. If the property is set to true during Actor creation or update, standby mode is enabled with default configuration. Fixes #913
1413949 to
dd47acb
Compare
janbuchar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great that you are fixing this! Consider this approved by me once @vladfrangu approves it, I don't have anything to add beside that one comment.
package.json
Outdated
| "adm-zip": "~0.5.15", | ||
| "ajv": "~8.17.1", | ||
| "apify-client": "^2.14.0", | ||
| "apify-client": "2.22.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as with the other PR
| "apify-client": "2.22.0", | |
| "apify-client": "^2.22.0", |
(you will need to regenerate the lockfile after this iirc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a similar change in #1004 with ~ 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yop, my bad, I used ni apify-client@2.22.0. #1004 is merged so i will sync this. Before that there was ^ so stick to that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd go with ^ personally, but no strong opinions about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok lets go Vlads way then, as it is already in master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just keep in mind that it means we'll need to adjust the conditions again on next feature release. And as you can see, we often ship feature bumps in the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, ok so ^ seems better option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'd say so. For the CLI it's not that important, since the bundled versions will always use what is bundled anyway, but for those installing via NPM it can help.
| // Enable standby mode if configured in actor.json | ||
| if (actorConfig!.usesStandbyMode) { | ||
| newActor.actorStandby = { isEnabled: true }; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just calling out, not blocking: This will only enable standby on new actors, and it will NOT propagate to existing ones (say if you migrate from ??? -> standby, or vice versa)
Maybe this is something we want to do? @B4nan Or should it be a different command, like actors edit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, good point, no strong opinions, I wouldn't add a new command for that (we don't have actors edit, or do we?)
(I wouldn't block the PR on that, it can happen in a future one, or even never if nobody really asks for it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, there are other cases already where changing something in the actor.json file for an existing Actor doesn't change the "platform-side version" of the Actor, so... Ostrich algorithm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah agreed, lets leave that for later never.
|
Cases which have an issue actually to deal with and implement... 🫠 We can
deal with that theb
…On Tue, Jan 27, 2026 at 17:53 Jan Buchar ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/commands/actors/push.ts
<#991 (comment)>:
> + // Enable standby mode if configured in actor.json
+ if (actorConfig!.usesStandbyMode) {
+ newActor.actorStandby = { isEnabled: true };
+ }
I mean, there are other cases already where changing something in the
actor.json file for an existing Actor doesn't change the "platform-side
version" of the Actor, so... Ostrich algorithm?
—
Reply to this email directly, view it on GitHub
<#991 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEJA4MFDELNE5YAYGWY4M2T4I6CXHAVCNFSM6AAAAACRSZV6P6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTOMJSGAYTKMZVGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Fix
usesStandbyModenot being applied when pushing Actor via CLIProblem
When creating an Actor locally using
apify create my-actor -t ts-mcp-serverand then pushing it withapify push, theusesStandbyMode: truesetting fromactor.jsonwas being ignored. The Actor would be created on the platform without standby mode enabled, even though the template explicitly sets this option.In contrast, cloning the same template directly from the Apify Console UI correctly enabled standby mode.
Root Cause
The
pushcommand was not reading theusesStandbyModeproperty fromactor.jsonand was not passing it to the Apify API when creating or updating Actors.Solution
DEFAULT_STANDBY_OPTIONSconstant with all required API fields for standby mode configurationusesStandbyMode: trueis set inactor.json, the standby options are passed to the APIusesStandbyMode: trueis inactor.json, the Actor is updated to enable standby modeChanges
src/commands/actors/push.ts: Added standby mode support for both new and existing Actorstest/api/commands/push.test.ts: Added two API tests to verify standby mode is correctly enabledTesting
apify create my-actor -t ts-mcp-server cd my-actor apify pushThe Actor should now have standby mode enabled with the default configuration.
closes #913