Skip to content

Conversation

@l2ysho
Copy link
Contributor

@l2ysho l2ysho commented Jan 13, 2026

Fix usesStandbyMode not being applied when pushing Actor via CLI

Problem

When creating an Actor locally using apify create my-actor -t ts-mcp-server and then pushing it with apify push, the usesStandbyMode: true setting from actor.json was 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 push command was not reading the usesStandbyMode property from actor.json and was not passing it to the Apify API when creating or updating Actors.

Solution

  1. Added DEFAULT_STANDBY_OPTIONS constant with all required API fields for standby mode configuration
  2. When creating a new Actor, if usesStandbyMode: true is set in actor.json, the standby options are passed to the API
  3. When pushing to an existing Actor that doesn't have standby enabled but usesStandbyMode: true is in actor.json, the Actor is updated to enable standby mode

Changes

  • src/commands/actors/push.ts: Added standby mode support for both new and existing Actors
  • test/api/commands/push.test.ts: Added two API tests to verify standby mode is correctly enabled

Testing

apify create my-actor -t ts-mcp-server
cd my-actor
apify push

The Actor should now have standby mode enabled with the default configuration.

closes #913

@l2ysho l2ysho linked an issue Jan 13, 2026 that may be closed by this pull request
@l2ysho l2ysho requested a review from B4nan January 13, 2026 20:30
@github-actions github-actions bot added this to the 132nd sprint - Tooling team milestone Jan 13, 2026
@github-actions github-actions bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Jan 13, 2026
@l2ysho
Copy link
Contributor Author

l2ysho commented Jan 13, 2026

Keeping this as draft, it is working but it seems we missing some types in apify-client, lets discuss.

@l2ysho
Copy link
Contributor Author

l2ysho commented Jan 15, 2026

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
@l2ysho l2ysho force-pushed the 913-actorjson-option-usesstandbymode-does-not-work branch from 1413949 to dd47acb Compare January 15, 2026 13:06
@l2ysho l2ysho marked this pull request as ready for review January 15, 2026 14:25
@l2ysho l2ysho requested a review from janbuchar January 15, 2026 14:25
@l2ysho l2ysho linked an issue Jan 15, 2026 that may be closed by this pull request
Copy link
Contributor

@janbuchar janbuchar left a 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",
Copy link
Member

@B4nan B4nan Jan 27, 2026

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

Suggested change
"apify-client": "2.22.0",
"apify-client": "^2.22.0",

(you will need to regenerate the lockfile after this iirc)

Copy link
Member

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 ~ 😄

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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.

Comment on lines +202 to +205
// Enable standby mode if configured in actor.json
if (actorConfig!.usesStandbyMode) {
newActor.actorStandby = { isEnabled: true };
}
Copy link
Member

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?

Copy link
Member

@B4nan B4nan Jan 27, 2026

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)

Copy link
Contributor

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?

Copy link
Member

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.

@vladfrangu
Copy link
Member

vladfrangu commented Jan 27, 2026 via email

@l2ysho l2ysho requested a review from vladfrangu January 27, 2026 16:02
@l2ysho l2ysho merged commit 519aa43 into master Jan 28, 2026
22 checks passed
@l2ysho l2ysho deleted the 913-actorjson-option-usesstandbymode-does-not-work branch January 28, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

actor.json option usesStandbyMode does not work

5 participants