Repository navigation
Description
Problem
In the devcontainer, one VS Code server process holds 524137 of the 524288 inotify watches of the host user (/proc/sys/fs/inotify/max_user_watches; counted from /proc/<pid>/fdinfo on 2026-11-19). Other programs then cannot add a watch. Found while testing the podman-in-podman Feature: aardvark-dns 1.17 on debian:sid panics when it cannot watch /etc/resolv.conf, so container name resolution fails ("ping: bad address"), and rootful network removal fails sometimes ("aardvark-dns failed to start"). File watchers of tests and tools can fail in the same way.
The workspace holds about 21 GB of agent worktrees under .data/agent/worktrees/ and about 31 GB of repository clones under repos/ (repos.base_dir), each with its own .venv, caches and build output. .vscode/settings.json and .devcontainer/devcontainer.json set no files.watcherExclude, so VS Code watches all of them. VS Code's default exclude list covers only .git/objects, .git/subtree-cache, node_modules/*/** and .hg/store.
Expected
files.watcherExcludein.vscode/settings.json(or the VS Code customizations of.devcontainer/devcontainer.json, one place only) excludes.data/**,repos/**,**/.venv/**and the tool caches (.mypy_cache,.ruff_cache,.pytest_cache,mutants).- After a window reload, the VS Code server holds a small share of the watches (measure it again from
/proc/<pid>/fdinfo), anddocker compose exec b ping -c1 aworks in a rootless podman-in-podman container on debian:sid. - No test of a config value (owner rule); the proof is the measurement in the PR.
Proposed design
Problem statement
One VS Code server process holds 524137 of the 524288 inotify watches of the host user. The workspace holds about 21 GB of agent worktrees under .data/agent/worktrees/ and about 31 GB of clones under repos/, each with its own virtual environment and caches, and VS Code watches them all. Other programs cannot add a watch, so aardvark-dns panics on /etc/resolv.conf and container name resolution fails. The change excludes these folders from the VS Code file watcher.
Acceptance criteria
Requirement: The workspace excludes the agent folders
The VS Code workspace settings SHALL set files.watcherExclude for the agent worktrees, the repository clones, the virtual environments and the tool caches.
Scenario: The key is in one settings file
- WHEN the developer runs
grep -rn 'files.watcherExclude' .vscode .devcontainerat the workspace root - THEN the command prints one line, and the pull request records that line
Requirement: The settings file stays valid JSON
The change SHALL keep .vscode/settings.json valid JSON.
Scenario: The JSON parser reads the file
- WHEN the developer runs
python -m json.tool .vscode/settings.json - THEN the command prints the parsed content and exits 0
Requirement: The VS Code server holds few watches
The VS Code server in the devcontainer SHALL hold less than 10% of max_user_watches after the change.
Scenario: The watch count after a window reload
- WHEN the developer counts the
inotifylines of/proc/<pid>/fdinfofor the VS Code server process after a window reload - THEN the count is less than 10% of the value of
/proc/sys/fs/inotify/max_user_watches, and the pull request shows the count before and after the change
Requirement: A container resolves the name of its peer
The devcontainer SHALL let a rootless podman-in-podman container resolve the name of a peer container after the window reload.
Scenario: Ping the peer container
- WHEN the developer runs
docker compose exec b ping -c1 ain the rootless podman-in-podman environment on debian:sid - THEN the command prints one reply and exits 0
Existing Tool Considered
No alternatives check has run. The need is the built-in VS Code setting files.watcherExclude, and no separate open tool or library covers it. The change builds no code: it adds one key to .vscode/settings.json, and the devcontainer image does not change.
Key questions
- Which file holds
files.watcherExclude?: Put the key in.vscode/settings.json. That file holds one key in one place and applies to the workspace in the devcontainer. The devcontainer customizations hold each setting twice, undervscodeand underantigravity, so the key would go in two blocks. (best practice) [sources: .vscode/settings.json, .devcontainer/devcontainer.json]- Chosen: Workspace file
.vscode/settings.json. One place, one key, and VS Code reads it in the devcontainer. - Rejected: Devcontainer customizations
.devcontainer/devcontainer.json. The file repeats each setting undervscodeandantigravity, so the key would sit in two blocks.
- Chosen: Workspace file
- Which glob patterns exclude the worktrees, the clones and the caches?: Use
**/.data/**,**/repos/**,**/.venv/**,**/.mypy_cache/**,**/.ruff_cache/**,**/.pytest_cache/**and**/mutants/**. Add the four default keys of VS Code too, so the block keeps them. (best practice) [sources: .vscode/settings.json]- Rejected: Root-anchored patterns such as
.data/**. They match only at the workspace root, and a clone can hold a nested.datafolder. - Chosen:
**/-prefixed patterns. They match at any depth, and VS Code matches them against the absolute path. - Rejected: Project patterns only, with no default keys. A block that replaces the defaults would watch the
.git/objectsof the workspace again.
- Rejected: Root-anchored patterns such as
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 19, 2026
The watcher exhaustion causes DNS failures, test failures, and tool failures in the devcontainer, degrading the development workflow.Both fix devcontainer resource exhaustion, but 3722 raises the process limit while this candidate excludes file paths from VS Code's inotify watcher.devops-cli-service commentedon Nov 19, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 19, 2026
Released in v0.181.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.181.1
devops-cli-service commentedon Nov 19, 2026
Live since 2026-11-19 21:54 UTC