[fix][R²] agent-sandbox proxy: raise CPU limit to 1 so it can successfully boot. - #362
Merged
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
|
| Filename | Overview |
|---|---|
| charts/retool/Chart.yaml | Increments the chart patch version to publish the updated default; no dependency change requires a lockfile update. |
| charts/retool/values.yaml | Raises the authoritative proxy CPU limit default to one core, which renders directly into the proxy container resources. |
| values.yaml | Keeps the repository-level customer values copy synchronized with the deployable chart defaults. |
Reviews (1): Last reviewed commit: "[fix][R²] `agent-sandbox` proxy: raise C..." | Re-trigger Greptile
drewmacneil
marked this pull request as ready for review
August 12, 2026 23:36
lukefoster11
approved these changes
Aug 13, 2026
lukefoster11
left a comment
Contributor
There was a problem hiding this comment.
This seems reasonable 👍
Contributor
Author
Merge activity
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Impact
The R² agent-sandbox proxy is in permanent
CrashLoopBackOffon internal balloon instances, which breaks R² entirely and surfaces to users as a misleading "reached its maximum agent sandbox capacity" error. Observed oncli-4-40,blaker-r2,kcheng-r2, andjvecchio-r2; root-caused and fix-verified live oncli-4-40.Where this could reach beyond balloons. The 500m cap is a chart default and nothing overrides it — the internal-onprem balloon values and the Terragrunt MSH client values set only
proxy.backendDomainSuffixes(and ingress/secret names), so any install with the agent sandbox enabled renders the same limit. Confirmed by renderingbrilliantretool-prod, which picks up the identical 500m proxy limit.That is shared configuration, not an observed failure: we have not seen a customer instance crashloop, and whether one does depends on how its node CPU lands against the ~60s liveness budget. Balloons cleared it by ~4s or lost by ~3s, so the margin is thin either way — the exposure is real even though the reports so far are internal.
Reviewers: this raises a default for every self-hosted install, not just ours. That breadth is deliberate — the cap is wrong everywhere and an internal-only override would leave the same trap in the shipped chart — but please confirm you're comfortable with it.
Fix
rr.agentSandbox.proxy.resources.limits.cpu:500m→'1', matchingagent_executor/helm/agent-executor/values.yamlin the monorepo (the source chart for this component, which already specifies'1').Applied to both
values.yamlandcharts/retool/values.yaml— the repo keeps them byte-identical and CI enforces it (.github/workflows/values-yaml-synced.yaml). Chart version bumped6.11.17→6.11.18percheck-version-increment: truein.github/ct.yaml.Why
The proxy needs ~26 CPU-seconds to bind port 3019. Capped at 500m that is ~64s wall-clock, just past this chart's ~60s liveness budget (
initialDelaySeconds: 10+failureThreshold: 5×periodSeconds: 10, with nostartupProbeintemplates/deployment_agent_sandbox.yaml), so kubelet kills it ~3s before it comes up — cleanly, exit 0 — then loses the same race on every retry. Boot was ~56s across three balloon pods spanning three image versions, three nodes, and six days, i.e. CPU-capped rather than load-dependent.With no ready proxy endpoint, every backend→sandbox call (
/sandbox/<id>/run-agent,/run-default-snapshot) failsECONNREFUSED. Those failures mark sandboxes terminal, the controller deletes the jobs, the prewarm pool churns instead of filling, andassignfalls through to on-demand creation — which times out at 30s against a ~67s cold start and returns503 no capacity available. Hence a capacity message for what is really a proxy outage.Verified live before opening this: patching
cli-4-40's proxy tolimits.cpu: 1cut boot from 63.6s to 26.4s, the pod went1/1with 0 restarts, its endpoint moved fromnotReadyAddressestoaddresses,run-agentstarted returning 200, and controller churn dropped from ~60 events per 6 minutes to 1. That live patch reverts on the balloon's next helm upgrade, which is why it needs to land here.Verification
helm templateagainst a balloon (cli-4-40) and an MSH customer (brilliantretool-prod), before vs. after, with the chart version held constant to isolate the change: exactly one changed line in each,cpu: 500m→cpu: "1", inside the*-agent-sandbox-proxyDeployment. The*-agent-sandbox-controllerDeployment (byte-identical resources block) and the*-agent-sandbox-job-templateConfigMap are unchanged, as are all other Deployments and StatefulSets.helm lintpasses.Deliberately not included
Scoped to the single field verified live. Three related items left for reviewers:
controller.resources.limits.cpuis the same500mand booted in 55.6s against the same 60s budget — it survives on ~4s of margin and is the same bug one unlucky restart away. A dead controller is worse than a dead proxy: no/assignat all. Strong candidate for a follow-up.proxy.replicaCount: 1→2, matching the monorepo. More correct — one replica losing the boot race takes R² down for the whole instance — but it doubles proxy pod count on every self-hosted deployment, unlike a limit raise on a pod already requesting 250m.startupProbeon proxy and controller would remove this failure class rather than widening the margin. Tracked separately in the monorepo chart, which has none either.