Rename VM executor limit to guest-execution cap with env override - #1913
Draft
jog1t wants to merge 1 commit into
Draft
Rename VM executor limit to guest-execution cap with env override#1913jog1t wants to merge 1 commit into
jog1t wants to merge 1 commit into
Conversation
|
🚅 Environment agentos-pr-1913 in rivet-frontend has no services deployed. |
…nable The process-wide V8 executor slot cap was derived from available_parallelism() and had no override path in any shipped build: every runtime.* config value came from RuntimeConfig::default(). Its own limit error told operators to "raise runtime.executor.maxActiveVms", a knob nothing could set. The cap admits concurrently running guest executions, not VMs. Every live guest process holds one slot for its whole lifetime, so a shell and the command it waits on need two, and a fleet of parallel agents exhausts it well before any per-VM cap. CPU count is the wrong unit: the slot costs one OS thread and one thread-affine V8 isolate, and an agent parked on a network read burns no CPU while holding one. - Read AGENTOS_MAX_ACTIVE_GUEST_EXECUTIONS at sidecar startup, before the process topology is fixed. Missing, non-numeric, zero, or above-ceiling values fail startup with a typed error instead of being clamped. - Default to a fixed 64 rather than the host core count, so admitted concurrency no longer varies per machine, with a hard ceiling of 1024. - Rename the knob, config field, and limit error to say guest executions, and point the error at a variable an operator can actually set. - Log the effective ceiling at startup so the admitted value is observable before an execution is rejected for exceeding it. Kept process-scoped rather than exposed as a client wire field: one sidecar process is shared by every VM and connection it hosts, so no single tenant may rewrite the ceiling for its neighbours.
jog1t
force-pushed
the
claude/maxactivevms-exposure-analysis-nd6qqa
branch
from
August 24, 2026 22:31
418ac77 to
70c8b83
Compare
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.
Rename the process-wide concurrency limit from
max_active_vm_executorstomax_active_guest_executionsto better reflect that it bounds all guest processes (JavaScript, TypeScript, Python, WASM) rather than just V8 isolates. Add operator-configurable override viaAGENTOS_MAX_ACTIVE_GUEST_EXECUTIONSenvironment variable with validation and improved error messaging.Key changes
RuntimeConfig.max_active_vm_executors→max_active_guest_executionsthroughout the codebaseDEFAULT_MAX_ACTIVE_GUEST_EXECUTIONS = 64(fixed default, no longer derived from CPU count)MAX_ACTIVE_GUEST_EXECUTIONS_CEILING = 1024(hard upper bound)MAX_ACTIVE_GUEST_EXECUTIONS_ENV(environment variable name)RuntimeConfig::apply_env_overrides()andapply_env_overrides_from()methods that parse and validate the environment variable before any VM is createdImplementation details
The default is now a fixed constant (64) rather than derived from
available_parallelism(), ensuring identical admission ceilings across hosts. This prevents silent rejection of ordinary workloads on small hosts (e.g., a shell plus the command it waits on already needs two slots).The override is read once at process startup via
apply_env_overrides()beforeSidecarRuntime::process()fixes topology, ensuring the ceiling is process-wide and shared by all VMs. A present-but-invalid value is a hard error, never silently clamped or fallen back to default — an operator who explicitly requests a specific ceiling must get exactly that or a clear error.Limit-exceeded errors now name
AGENTOS_MAX_ACTIVE_GUEST_EXECUTIONSso operators know exactly which knob to turn, and explain the lifetime semantics (parent and child each hold one slot).https://claude.ai/code/session_0182QmdSp9xAUey53LViPA8B