Skip to content

fix: fixed autoscaling configs in deployments api#214

Merged
dulaj-me merged 1 commit intomainfrom
dulaj/deployments-autoscaling-configs
Mar 10, 2026
Merged

fix: fixed autoscaling configs in deployments api#214
dulaj-me merged 1 commit intomainfrom
dulaj/deployments-autoscaling-configs

Conversation

@dulaj-me
Copy link
Contributor

@dulaj-me dulaj-me commented Feb 27, 2026

Note

Medium Risk
This changes the published API schema for autoscaling, which may break existing client code generation or validation that expected a generic key/value object.

Overview
Updates the Deployments API OpenAPI contract to replace the autoscaling free-form string map with a typed oneOf schema.

Adds explicit autoscaling config objects for HTTP, queue-backlog, and custom Prometheus metrics, and clarifies that autoscaling can be omitted/null to disable autoscaling (and is omitted in responses when disabled).

Written by Cursor Bugbot for commit 4c94683. This will update automatically on new commits. Configure here.

@github-actions
Copy link

github-actions bot commented Feb 27, 2026

✱ Stainless preview builds

This PR will update the togetherai SDKs with the following commit message.

fix: fixed autoscaling configs in deployments api
⚠️ togetherai-typescript studio · code

Your SDK build had a failure in the build CI job, which is a regression from the base state.
generate ✅build ❗lint ❗test ✅

togetherai-terraform studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅lint ✅test ✅

togetherai-openapi studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅

⚠️ togetherai-python studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅lint ❗test ⏭️

pip install https://pkg.stainless.com/s/togetherai-python/3fcb66860ab6635730a0e2641fee7be8f513d7b5/together-2.3.2-py3-none-any.whl
togetherai-go studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ⏭️lint ✅test ✅

go get github.com/stainless-sdks/togetherai-go@54f42d7d5c546bd5f9e2f798939d6e9982c038d7

This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-03-10 13:55:46 UTC

@dulaj-me dulaj-me marked this pull request as ready for review March 10, 2026 13:45
@dulaj-me dulaj-me merged commit 394df7b into main Mar 10, 2026
6 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Free Tier Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Bugbot Autofix prepared fixes for all 3 issues found in the latest run.

  • ✅ Fixed: Missing required metric field breaks oneOf validation
    • Added required: [metric] to all three autoscaling schemas and added discriminator with propertyName: metric to both oneOf arrays.
  • ✅ Fixed: Autoscaling oneOf missing null type despite description
    • Added type: 'null' as an option in both CreateDeploymentRequest and UpdateDeploymentRequest autoscaling oneOf arrays.
  • ✅ Fixed: custom_metric_name described as required but not enforced
    • Added required: [metric, custom_metric_name] to CustomMetricAutoscalingConfig schema to enforce the documented requirement.

Create PR

Or push these changes by commenting:

@cursor push 4131d6c4b1
Preview (4131d6c4b1)
diff --git a/openapi.yaml b/openapi.yaml
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -12198,6 +12198,9 @@
           - $ref: '#/components/schemas/HTTPAutoscalingConfig'
           - $ref: '#/components/schemas/QueueAutoscalingConfig'
           - $ref: '#/components/schemas/CustomMetricAutoscalingConfig'
+          - type: 'null'
+          discriminator:
+            propertyName: metric
         command:
           description: Command overrides the container's ENTRYPOINT. Provide as an array
             (e.g., ["/bin/sh", "-c"])
@@ -12513,6 +12516,8 @@
             10'
           example: 10
           type: integer
+      required:
+        - metric
       type: object
     QueueAutoscalingConfig:
       description: Autoscaling config for QueueBacklogPerWorker metric
@@ -12531,6 +12536,8 @@
           description: 'Target is the threshold value. Default: 1.01'
           example: 1.01
           type: number
+      required:
+        - metric
       type: object
     CustomMetricAutoscalingConfig:
       description: Autoscaling config for CustomMetric metric
@@ -12550,6 +12557,9 @@
           description: 'Target is the threshold value. Default: 500'
           example: 500
           type: number
+      required:
+        - metric
+        - custom_metric_name
       type: object
     KubernetesEvent:
       properties:
@@ -12675,6 +12685,9 @@
           - $ref: '#/components/schemas/HTTPAutoscalingConfig'
           - $ref: '#/components/schemas/QueueAutoscalingConfig'
           - $ref: '#/components/schemas/CustomMetricAutoscalingConfig'
+          - type: 'null'
+          discriminator:
+            propertyName: metric
         command:
           description: Command overrides the container's ENTRYPOINT. Provide as an array
             (e.g., ["/bin/sh", "-c"])
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

description: 'Target is the threshold value. Default: 500'
example: 500
type: number
type: object
Copy link

Choose a reason for hiding this comment

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

Missing required metric field breaks oneOf validation

High Severity

None of the three new schemas (HTTPAutoscalingConfig, QueueAutoscalingConfig, CustomMetricAutoscalingConfig) mark metric as required, and the oneOf lacks a discriminator. Without required: [metric], a payload like {"target": 100} matches all three schemas, violating the oneOf constraint (exactly one must match) and causing validation to reject valid requests. The existing InterpreterOutput schema in this file demonstrates the correct pattern: using discriminator: propertyName plus required on each sub-schema.

Additional Locations (1)

Fix in Cursor Fix in Web

oneOf:
- $ref: '#/components/schemas/HTTPAutoscalingConfig'
- $ref: '#/components/schemas/QueueAutoscalingConfig'
- $ref: '#/components/schemas/CustomMetricAutoscalingConfig'
Copy link

Choose a reason for hiding this comment

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

Autoscaling oneOf missing null type despite description

Medium Severity

The autoscaling field descriptions in CreateDeploymentRequest and UpdateDeploymentRequest say "set to null to disable autoscaling," but the oneOf doesn't include a null type option. In OpenAPI 3.1.0, null needs to be explicitly allowed (e.g., - type: 'null' in the oneOf list). Without it, sending null for autoscaling will fail validation, contradicting the documented behavior.

Additional Locations (1)

Fix in Cursor Fix in Web

description: 'Target is the threshold value. Default: 500'
example: 500
type: number
type: object
Copy link

Choose a reason for hiding this comment

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

custom_metric_name described as required but not enforced

Medium Severity

The custom_metric_name property in CustomMetricAutoscalingConfig has a description that explicitly states "Required," but the schema has no required list enforcing it. A client can submit a CustomMetric autoscaling config without custom_metric_name and pass validation, even though the backend presumably needs a Prometheus metric name to function. This mismatch between documented and enforced constraints will lead to confusing server-side errors.

Fix in Cursor Fix in Web

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.

2 participants