Skip to content

Commit c7a3a2a

Browse files
fix(cli): make agent autoscaling opt-in instead of a hardcoded default
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>
1 parent 3d486e0 commit c7a3a2a

21 files changed

Lines changed: 182 additions & 10 deletions

File tree

src/agentex/lib/cli/handlers/deploy_handlers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,9 @@ def merge_deployment_configs(
292292
"memory": manifest.deployment.global_config.resources.limits.memory,
293293
},
294294
},
295-
# Enable autoscaling by default for production deployments
295+
# Opt-in only: a crash loop's restart CPU burn reads as load and scales it to max.
296296
"autoscaling": {
297-
"enabled": True,
297+
"enabled": False,
298298
"minReplicas": 1,
299299
"maxReplicas": 10,
300300
"targetCPUUtilizationPercentage": 50,
@@ -307,9 +307,8 @@ def merge_deployment_configs(
307307
if temporal_config:
308308
helm_values[TEMPORAL_WORKER_KEY] = {
309309
"enabled": True,
310-
# Enable autoscaling for temporal workers as well
311310
"autoscaling": {
312-
"enabled": True,
311+
"enabled": False,
313312
"minReplicas": 1,
314313
"maxReplicas": 10,
315314
"targetCPUUtilizationPercentage": 50,

src/agentex/lib/cli/templates/default-claude-code/environments.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ environments:
5151
limits:
5252
cpu: "1000m"
5353
memory: "2Gi"
54+
# Autoscaling is opt-in. Unset keys inherit maxReplicas 10 and a 50% CPU target.
55+
# autoscaling:
56+
# enabled: true
5457
temporal:
5558
enabled: false
5659

src/agentex/lib/cli/templates/default-codex/environments.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ environments:
5151
limits:
5252
cpu: "1000m"
5353
memory: "2Gi"
54+
# Autoscaling is opt-in. Unset keys inherit maxReplicas 10 and a 50% CPU target.
55+
# autoscaling:
56+
# enabled: true
5457
temporal:
5558
enabled: false
5659

src/agentex/lib/cli/templates/default-langgraph/environments.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ environments:
5151
limits:
5252
cpu: "1000m"
5353
memory: "2Gi"
54+
# Autoscaling is opt-in. Unset keys inherit maxReplicas 10 and a 50% CPU target.
55+
# autoscaling:
56+
# enabled: true
5457
temporal:
5558
enabled: false
5659

src/agentex/lib/cli/templates/default-openai-agents/environments.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,7 @@ environments:
5050
limits:
5151
cpu: "1000m"
5252
memory: "2Gi"
53+
# Autoscaling is opt-in. Unset keys inherit maxReplicas 10 and a 50% CPU target.
54+
# autoscaling:
55+
# enabled: true
5356

src/agentex/lib/cli/templates/default-pydantic-ai/environments.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ environments:
5151
limits:
5252
cpu: "1000m"
5353
memory: "2Gi"
54+
# Autoscaling is opt-in. Unset keys inherit maxReplicas 10 and a 50% CPU target.
55+
# autoscaling:
56+
# enabled: true
5457
temporal:
5558
enabled: false
5659

src/agentex/lib/cli/templates/default/environments.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ environments:
5151
limits:
5252
cpu: "1000m"
5353
memory: "2Gi"
54+
# Autoscaling is opt-in. Unset keys inherit maxReplicas 10 and a 50% CPU target.
55+
# autoscaling:
56+
# enabled: true
5457
temporal:
5558
enabled: false
5659

src/agentex/lib/cli/templates/sync-claude-code/environments.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,7 @@ environments:
5050
limits:
5151
cpu: "1000m"
5252
memory: "2Gi"
53+
# Autoscaling is opt-in. Unset keys inherit maxReplicas 10 and a 50% CPU target.
54+
# autoscaling:
55+
# enabled: true
5356

src/agentex/lib/cli/templates/sync-codex/environments.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,7 @@ environments:
5050
limits:
5151
cpu: "1000m"
5252
memory: "2Gi"
53+
# Autoscaling is opt-in. Unset keys inherit maxReplicas 10 and a 50% CPU target.
54+
# autoscaling:
55+
# enabled: true
5356

src/agentex/lib/cli/templates/sync-langgraph/environments.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,7 @@ environments:
5050
limits:
5151
cpu: "1000m"
5252
memory: "2Gi"
53+
# Autoscaling is opt-in. Unset keys inherit maxReplicas 10 and a 50% CPU target.
54+
# autoscaling:
55+
# enabled: true
5356

0 commit comments

Comments
 (0)