Skip to content

Add conversation-based Loop Runtime autoscaling on GKE - #122

Merged
Alex R (alexr17) merged 2 commits into
mainfrom
alexr/loop-runtime-autoscaling
Nov 4, 2026
Merged

Alex R (alexr17) merged 2 commits into
mainfrom
alexr/loop-runtime-autoscaling

Conversation

@alexr17

Copy link
Copy Markdown
Contributor

Builds on #120 with opt-in conversation-based Loop Runtime autoscaling through GKE custom metrics, defaulting to 1–50 pods at 50% claimed capacity.
Applications expose loop_runtime_claimed_conversation_utilization (0–100) on their runtime HTTP metrics endpoint; missing application support leaves the HPA unable to perform metric-driven scaling, with no image-version gate.
Helm leaves replica ownership to the HPA while enabled, applies a five-minute downscale window, and restores fixed replicas when disabled.
Sandbox-worker replicas remain separately configured and must provide enough capacity for the runtime limit.

Input Behavior
Google Autopilot or Standard, runtime and autoscaling enabled, AutoscalingMetric API present Render the HPA and metric source; omit Deployment replicas.
Autoscaling disabled, missing, or null Preserve fixed replicas, including explicit zero and the null/empty fallback to one.
Runtime disabled or missing from reused values Omit runtime autoscaling resources.
Partial autoscaling map on reused values; missing or null settings Fill the documented autoscaling defaults.
Disabling autoscaling after enabling it Remove the HPA and metric source; restore the configured fixed count.
Enabling on an existing Deployment Removing the replica field can initially reset the count to one.
Empty, zero, negative, fractional, or reversed replica bounds Reject invalid autoscaling bounds.
Empty, zero, negative, or above-100 utilization; empty or relative metrics path Reject invalid enabled settings.
Missing AutoscalingMetric API Fail with prerequisite guidance.
AWS or Azure Runtime remains disabled by default; enabling it retains the existing Google-only validation.
Release tags with or without v, full/short/numeric SHAs, prerelease and custom tags Pass through unchanged, including images without the metrics endpoint.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T23:58:39.347699Z 85d7501 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85d7501ff5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment on lines +169 to +173
- it: should restore explicit fixed replicas when autoscaling is disabled
values: *values
set:
loopRuntime.replicas: 3
loopRuntime.autoscaling: null

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Cover the required autoscaling upgrade and empty-value matrix

The new suite does not exercise the helper's reuse-values/defaulting branches: every enabled case inherits the complete autoscaling defaults, and the null case disables the entire map rather than testing null settings while enabled. There are also no cases for reversed or fractional replica bounds, despite the commit explicitly promising to reject them. Add cases that remove the retained autoscaling map before applying partial overrides, supply null individual settings, and exercise the distinct invalid-bound branches. These are explicitly required release-blocking checks under AGENTS.md, not optional coverage improvements.

AGENTS.md reference: AGENTS.md:L14-L17

Useful? React with 👍 / 👎.

Base automatically changed from alexr/loop-runtime-single-replica to main November 4, 2026 00:52
@alexr17
Alex R (alexr17) force-pushed the alexr/loop-runtime-autoscaling branch from 0abd7c4 to 9ca0b85 Compare November 4, 2026 00:52
@alexr17
Alex R (alexr17) merged commit 64a7691 into main Nov 4, 2026
3 checks passed
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