Skip to content

fix(cli): make agent autoscaling opt-in instead of a hardcoded default - #498

Closed
mohammadatallah-scale wants to merge 1 commit into
nextfrom
mohammad/deploy-autoscaling-opt-in
Closed

fix(cli): make agent autoscaling opt-in instead of a hardcoded default#498
mohammadatallah-scale wants to merge 1 commit into
nextfrom
mohammad/deploy-autoscaling-opt-in

Conversation

@mohammadatallah-scale

@mohammadatallah-scale mohammadatallah-scale commented Aug 21, 2026

Copy link
Copy Markdown

Important

Pending Mohammad's self-review. This note is removed by a human, not automation.

This CLI gave every deployment an HPA, so a crash-looping pod's restart CPU burn read as load, scaled it to maxReplicas, and froze there. Four of its releases account for 39 of 49 crash-looping pods on dev-sgp.

scaleapi/scaleapi#157885 fixes the same default on the backend cloud-deploy path. This PR is the CLI path.

cc @danielmillerp @RoxyFarhad @smoreinis @MichaelSun48 @declan-scale, this repo has no CODEOWNERS so the PR needs routing.

Test plan

  • Default-off assertions for the agent and the worker go red when the old default is restored
  • All 5 committed environments.yaml consumers checked: none sets autoscaling, so none relies on an absent enabled key
  • CI not yet green

Greptile Summary

The PR makes CLI-generated agent and Temporal worker autoscaling opt-in while retaining default replica and CPU bounds for explicit opt-ins.

  • Changes both generated Helm autoscaling blocks to default enabled to false.
  • Documents the opt-in configuration across all generated environment templates.
  • Adds deployment-merge tests covering defaults, separate worker opt-in, inherited bounds, and environment overrides.

Confidence Score: 5/5

The PR appears safe to merge, with the implementation, generated configuration guidance, and tests aligned on autoscaling being disabled unless explicitly enabled.

The recursive Helm-value merge preserves default bounds for partial opt-ins, the agent and Temporal worker remain independently configurable, and no concrete changed-code failure remains.

Important Files Changed

Filename Overview
src/agentex/lib/cli/handlers/deploy_handlers.py Disables agent and Temporal worker autoscaling by default while preserving recursively merged bounds and environment overrides.
tests/lib/cli/test_deploy_handlers.py Adds focused coverage for disabled defaults, inherited autoscaling bounds, independent Temporal worker configuration, and override precedence.
src/agentex/lib/cli/templates/default/environments.yaml.j2 Documents the agent autoscaling opt-in beneath the generated environment's Helm overrides.
src/agentex/lib/cli/templates/temporal/environments.yaml.j2 Documents separate agent and Temporal worker autoscaling opt-ins using the canonical Helm value paths.

Reviews (1): Last reviewed commit: "fix(cli): make agent autoscaling opt-in ..." | Re-trigger Greptile

Context used:

A crash-looping pod's restart CPU burn reads as CPU load, so the HPA this
CLI attached to every deployment scaled the failure to maxReplicas, then
froze there once the metrics went missing.

Keep the autoscaling block so an environments.yaml opt-in still deep-merges
onto the existing replica bounds and CPU target.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant