Skip to content

Conversation

@l2ysho
Copy link

@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

Default Standby Configuration

When usesStandbyMode: true is set, the following defaults are applied:

Option Value
isEnabled true
disableStandbyFieldsOverride false
maxRequestsPerActorRun 4
desiredRequestsPerActorRun 3
idleTimeoutSecs 300
build 'latest'
memoryMbytes 1024
shouldPassActorInput false

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

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 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
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.

Comment on lines +43 to +54
// Default standby mode configuration when usesStandbyMode is enabled in actor.json
const DEFAULT_STANDBY_OPTIONS = {
isEnabled: true,
disableStandbyFieldsOverride: false,
maxRequestsPerActorRun: 4,
desiredRequestsPerActorRun: 3,
idleTimeoutSecs: 300,
build: 'latest',
memoryMbytes: 1024,
shouldPassActorInput: false,
};

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stole this from console.apify.com, it is default preset send when user just enable standby mode. cc @vladfrangu

Copy link
Author

@l2ysho l2ysho Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my idea was result should be the same no matter if I use CLI or console UI


// Enable standby mode if configured in actor.json
if (actorConfig!.usesStandbyMode) {
newActor.actorStandby = DEFAULT_STANDBY_OPTIONS as ActorCollectionCreateOptions['actorStandby'];
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ActorCollectionCreateOptions type look little bit out of date -> StandBy type missing disableStandbyFieldsOverride and shouldPassActorInput

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

2 participants