Skip to content

fix(chains): defer promotion until chainlets are ACTIVE#2162

Draft
armishra wants to merge 3 commits intomainfrom
archit/cor-1054-deployment-promotes-h100-chainlet-without-min-replicas-set
Draft

fix(chains): defer promotion until chainlets are ACTIVE#2162
armishra wants to merge 3 commits intomainfrom
archit/cor-1054-deployment-promotes-h100-chainlet-without-min-replicas-set

Conversation

@armishra
Copy link
Contributor

@armishra armishra commented Jan 27, 2026

🚀 What

Defer chain promotion until all chainlets reach ACTIVE status, preventing traffic routing to non-ready deployments.

💻 How

  • Add promote_chain_deployment() API method to call backend promotion endpoint
  • Track promote flag separately in PushOptionsBaseten (don't set environment at deploy time)
  • After all chainlets are ACTIVE, call separate promote API
  • Add warning when using --promote --no-wait (promotion skipped)

🔬 Testing

  • CI

🚢 Release requirements

  • Pre-release: None
  • Post-release: None
  • External communication: None

🤖 Generated with Claude Code

…tates

When chainlets (especially H100/MCM) deploy without min_replicas set, they
can immediately scale to zero after reaching ACTIVE state. When traffic
arrives or health checks run, they transition to WAKING_UP (SCALING_FROM_ZERO).

Previously, WAKING_UP was not in DEPLOYING_STATUSES, causing the CLI to
incorrectly report "Deployment failed" for chainlets that were actually
in a valid transitional state.

Similarly, SCALED_TO_ZERO is a valid terminal state for deployments without
min replicas - it's not a failure, just an idle state.

This fix adds both states to DEPLOYING_STATUSES so they are treated as
non-failure states during deployment status checks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@linear
Copy link

linear bot commented Jan 27, 2026

When `--promote` is passed to `truss chains push`, promotion is now
deferred until after all chainlets reach ACTIVE status. This prevents
routing traffic to non-ready deployments.

Changes:
- Add `promote_chain_deployment()` API method to call the backend
  promotion endpoint
- Track `promote` flag separately in PushOptionsBaseten
- Deploy as published without environment, wait for ACTIVE, then
  call separate promote API
- Add warning when using `--promote --no-wait` (promotion skipped)
- Add `chain_id` and `chain_deployment_id` properties to
  BasetenChainService for use in promotion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@armishra armishra changed the title fix(chains): treat WAKING_UP and SCALED_TO_ZERO as valid deployment states fix(chains): defer promotion until chainlets are ACTIVE Jan 27, 2026
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@armishra armishra requested a review from tyranitar January 27, 2026 23:21
@armishra armishra marked this pull request as draft February 13, 2026 22:56
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