Repository navigation
Description
Problem
The devcontainer has a limit of 2048 processes and threads (pids.max of its cgroup, the default of rootless Podman). VS Code fills it, and then the tools of agent sessions fail with exit code 1, can't start new thread or fork errors, and the sessions end. This happened on 2026-11-05 and on 2026-11-06, and it lost agent work each time.
Evidence, from a log of pids.current every 5 seconds:
| Time (UTC) | Count | What happened |
|---|---|---|
| 2026-11-05 21:29:15 to 21:30:12 | 604 to 2048 in 57 s | 94 refused forks, load 180. About 39 rg processes, 619 rg threads. |
| 2026-11-06 02:25:44 to 02:27:48 | 722 to 2048 in 2 min | 30 rg processes, then 98, 553 refused forks, load 300. |
Every rg process is a child of the VS Code extension host (@vscode/ripgrep-universal), not of a command of an agent. Each rg starts one thread for each of the 16 CPUs, so 98 searches use about 1,600 slots. The second burst came in the minute that a new worktree with its virtual environment was created: 6,189 new files under .data/agent/worktrees/. I did not find which extension starts the searches: no extension log names one.
A full devops ci or a pytest run with workers adds to the count, but the baseline with 4 agents is about 600 to 1,000. The searches are what pass the limit.
Expected
The container limit leaves room for a burst of searches, so a burst slows VS Code and does not stop the tools of a session. Raise the limit in runArgs of .devcontainer/devcontainer.json (Podman and Docker both accept --pids-limit), to a value that the burst fits in with a margin, for example 8192. The cause (which extension runs the searches, and whether .data can leave its file list) stays open as a follow-up.
Acceptance criteria
-
.devcontainer/devcontainer.jsonholds a--pids-limitinrunArgs, with a comment that states the measure above. - A test or the devcontainer validation check reads the value and fails if it is under 4096.
-
k8s/README.md, CONTRIBUTING.md or the devcontainer document that names the limit of 2048 states the new value, and where it takes effect (a rebuild of the container). - A person rebuilds the container: the pull request says so.
Existing tool considered
--pids-limit is the standard option of podman run and docker run. The cost of the change is about 100,000 tokens and 30 minutes.
Related
#2336 (limit how many CPU-heavy gates run at once), #3593.
Proposed design
Problem statement
a
Acceptance criteria
Existing Tool Considered
b
Key questions
None.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 6, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(devcontainer)scope of the title gives the scope.The limit has caused loss of agent work on two consecutive days and will recur until fixed.Agent sessions that lose work are the core failure this project must prevent.The change adds one flag to runArgs, a validation check, and a doc note, estimated at 30 minutes.Both items touch the devcontainer configuration, but #144 updates usage documentation while the candidate raises the pids limit in devcontainer.json.devops-cli-service commentedon Nov 6, 2026
Refine cannot set this item to Ready at 7496693 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
dan-petty commentedon Nov 6, 2026
Cause found on 2026-11-06. The searches are
rg --files --hidden --no-ignore --followwith the glob**/{*.py,*.pyi,*.ipynb,pyproject.toml,requirements.txt,Pipfile,pyvenv.cfg,mspythonconfig.json}, run by the extension host (parent pid of thergprocesses). That glob isMARKER_GLOBof the extensionms-python.vscode-python-envs1.42.0 (registerWorkspacePythonContext, filedist/extension.js). It watches the glob over the whole workspace and starts onefindFilesscan, so onergprocess, for each created or deleted file. It has no debounce and no check for a scan in progress.So a
git worktree addthat checks out about 2,000 Python files starts about 2,000 scans in seconds. Eachrgstarts 16 threads, one for each CPU, so 100 scans use about 1,700 of the 2,048 slots. All our bursts (2026-11-05 21:29, 2026-11-06 02:25, 04:03 and 04:07) came with a new worktree or virtual environment under.data/agent/worktrees/.The upstream issue is microsoft/vscode-python-environments#1989 (open,
triage-needed; the code is unchanged in 1.43.0). The extension has no setting that turns this off.python.useEnvironmentsExtensionis at its default (false), so the Python extension does not even use it.I could not reproduce it with 40 small files under
.data: each scan ends in milliseconds when the host is idle. The scans pile up only when the host is loaded.What this means for the item:
--pids-limitstays the fix for this repository, because the cause is in an extension that we do not own.files.watcherExcludefor.dataunless a measure shows that it stops the scans. Measure the number ofrgprocesses that start (for examplestrace -f -e trace=execveon the extension host, ifstraceexists) while a worktree is created. If it cannot be measured, leave the setting out and say so.devops-cli-service commentedon Nov 6, 2026
Refine cannot set this item to Ready at 9fc5d8f until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 6, 2026
Released in v0.64.3: https://github.com/dan-petty/devops-cli/releases/tag/v0.64.3
devops-cli-service commentedon Nov 6, 2026
Live since 2026-11-06 05:02 UTC