Concepts

When your machine gets in the way

How Dus recognises everyday computer problems on Windows, WSL, macOS and Linux, fixes what is safe to fix, and gives you the exact command for the rest.

Sometimes the code is fine and the computer is the problem. The disk is full, a port is taken, VS Code says "Unable to watch for file changes", or git says a lock file exists. Dus recognises these problems the way an experienced engineer would. It doesn't try to change your code to work around them.

What Dus does when it sees one

When a command fails because of the computer, Dus follows the same steps every time:

  1. Looks first. It runs a check that only reads (for example, how many file watches are in use against the limit, or what is listening on a port).
  2. Says what it is, in plain words. For example: "Linux limits how many files all programs together may watch, and VS Code used them all watching copies of your code."
  3. Fixes what is safe, with your OK. A safe fix changes a setting for your user only and can be undone. If it changes a file, Dus keeps a copy first, next to the file (settings.json.duscode-backup-…). You see a card that says exactly what will change and how to undo it.
    • Say Always on that card and Dus fixes that same problem without asking next time. You can remove that rule in Settings → Permissions.
  4. Asks you for the rest. Some fixes need your password, an administrator or a decision only you can make. Dus never runs these itself. You get an Owner's Call with the exact command, where to run it, and why.
    • On WSL, some fixes belong to Windows: .wslconfig, Defender exclusions and Docker Desktop. For these, Dus gives you the PowerShell to run in Windows, not inside Linux.
  5. Checks it worked, then carries on.

Each problem is handled once per task. Every step is recorded in Duscode's data folder (machine/receipts.jsonl).

Machine health

Dus also checks your computer every few minutes in the background, without being asked. The Machine health card in the workspace's right-hand panel always shows one quiet line about memory (see Memory and Machine health); when something is wrong, the problem appears on the same card.

It watches for:

  • file watches close to the limit (Linux and WSL), and which programs hold them;
  • the disk, /tmp and file entries (inodes) running out;
  • low memory and full swap, including WSL's own memory limit;
  • Docker not running, when your project uses it;
  • the computer's clock being minutes off (after sleep in WSL, for example);
  • a WSL project kept on a Windows drive (/mnt/c), which makes everything slow;
  • VS Code watching Duscode's own task copies.

Fix it on the card applies the safe fix: clicking it is your approval. Copy gives you the exact command for anything that needs you.

In a terminal, duscode doctor shows the same list, and duscode doctor --fix <problem> applies a safe fix.

What Dus knows about

Over fifty everyday problems, each for the systems it applies to. Among them:

Area Examples
File watching VS Code, Vite, Jest, webpack and nodemon hitting the watch limit; Watchman; the open-file limit
Ports and disk A port already in use (and what holds it); disk, /tmp, inodes or Docker images filling the disk
WSL Memory and CPU limits, DNS failing, localhost forwarding, the clock after sleep, slow /mnt/c, Windows line endings, permissions on /mnt/c, Docker Desktop integration, VPNs, IPv6 timeouts in Node
Windows Long paths, PowerShell's script policy, Defender slowing node_modules, PATH too long, locked files, symlink rights
macOS Xcode command line tools, Gatekeeper, Intel and Apple-silicon builds mixed, the open-file limit
Linux npm global installs needing sudo, missing compilers, glibc and musl
Node and Python The wrong Node or pnpm version, an out-of-date lockfile, a Python virtual environment not used
git Sign-in helpers, "dubious ownership", line endings, files too large for GitHub, a stale index.lock
Certificates and SSH Company proxies, self-signed certificates, NODE_EXTRA_CA_CERTS, SSH keys and the agent, a changed server key
Docker and the clock Docker not running or not allowed; a wrong clock breaking certificates and sign-in tokens; running out of memory

Dus never turns certificate checks off to "fix" a certificate problem. It never uses sudo for you. It never changes another program's files without your OK.

Duscode doesn't cause these problems itself

Every helper Dus starts works in its own full copy of your project (a git worktree). These copies live in Duscode's data folder, outside your project, so VS Code and your dev servers never watch them. Finished copies are cleaned up on a schedule. A copy is removed only when it has nothing uncommitted and nothing that exists only on its branch, and the branch itself is kept. Copies made by other tools are never touched.

Your tasks' own copies stay in your project's .duscode/worktrees folder. The Duscode VS Code extension tells VS Code to leave that folder alone. Without the extension, the Machine health card offers to add the same setting to VS Code for you.

When your computer is busy

Tests, checks, Local CI, builds and evals are heavy. Every Duscode window on your computer, and the always-on runner, shares one limit for them. While the computer is busy or short of memory, heavy work waits and says so: "Waiting for the machine: load 9.1 on 8 CPUs, 1.4 GB free". New helpers also wait before they start. A waiting job holds nothing, so it never blocks the others.

While anything waits, the Machine health card shows what is running and what is waiting. Other Duscode windows see the same thing and hold off. The limits are in Settings → General → Machine load:

  • the load per CPU to wait above;
  • how much memory to keep free;
  • how many heavy jobs may run at once;
  • how many test workers each job may use. 0 lets Duscode choose.

Something missing or wrong? Email support@duscode.com.