Repository navigation
Conversation
T3 Code caps the agents slice at a share of the RAM the machine has when an agent starts. A VM whose host plugs memory as it runs short starts small: in one that boots with 2 GiB and may grow to 16, agents were capped at 1.5 GiB, or throttled at 1 GiB with swap, and the cap only caught up at the next agent launch. An administrator's own drop-in for the slice loses to the runtime override too. T3CODE_AGENT_SLICE_MEMORY_POLICY=host-managed leaves the slice's memory alone. Unset or automatic keeps the caps; anything else warns and keeps them. Scopes, OOM reporting and the parent slice's CPU, IO and task limits are unchanged. The same option is proposed upstream in pingdotgg#24717.
This branch has not been deployed
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.
Summary
T3CODE_AGENT_SLICE_MEMORY_POLICY=host-managedleavesapp-t3code-agents.slice's memory to whoever runs the machine. Unset orautomatickeeps T3 Code's caps. Any other value logs a warning and keeps them.Why. In a workbench workspace the VM boots with 2 GiB and its host plugs more memory as it runs short, up to its max. T3 Code takes the cap from the RAM the VM has when an agent starts: 1.5 GiB right after boot. Under 0.1.10's throttle, a clone took over 10 minutes. The host already sizes the VM, so a second cap inside it only gets in the way.
Upstream proposes the same option in pingdotgg#24717. Drop this commit once that merges.
Evidence
MemoryHigh/MemoryMaxeven with the variable set:vp test run src/process/agentScope.test.tspasses 17 of 17. Only the parent slice's CPU, IO and task limits are set, and scopes keepOOMPolicy=stop.pnpm run typecheckforapps/serverexits 0, andvp fmt --checkis clean.nix buildof t3code-nix with this as patch 0014 succeeds, install check included.Merge Danger
Door: two-way
The change is opt-in. Without the variable, behaviour is unchanged.
Blast Radius: opt-in
Only servers started with the variable stop capping their agents. Limits set by an earlier run stay until the user manager restarts.