From 106f539447ba48f4855c224198adccf719ac14fc Mon Sep 17 00:00:00 2001 From: Cameron Smith Date: Mon, 31 Aug 2026 23:24:48 -0400 Subject: [PATCH] feat(omp): set direnv preflight budget for agent bash commands omp folds a clone's direnv environment into the bash commands it runs, which is what lets a devshell-provided tool resolve without wrapping the call in `nix develop` or `direnv exec`. The mechanism is on by default; what this sets is the budget it runs under. `bash.direnvLoadTimeoutMs` goes from the upstream 30000 to 180000. The first export in a clone has to realise the flake devshell, measured at 7.4 seconds in this repository against an already-populated nix store and running to minutes when the closure has to be built, while later exports served from the nix-direnv cache return in under 10 milliseconds. The higher ceiling cannot stall a short command, because the effective budget is the smaller of this value and the command's own deadline. Overrunning it runs the command without the direnv environment rather than failing, so a tight value loses devshell tools silently. `bash.direnv` is declared at the value it already defaults to, so that a change to that default appears as a diff here rather than as devshell tools disappearing from every bash command. A clone whose .envrc has not been through `direnv allow` still runs without the devshell. That gate belongs to direnv's own configuration and is untouched here. --- modules/home/ai/omp/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/home/ai/omp/default.nix b/modules/home/ai/omp/default.nix index 9dd8ede9e..7ece514ad 100644 --- a/modules/home/ai/omp/default.nix +++ b/modules/home/ai/omp/default.nix @@ -121,6 +121,18 @@ # aiAgentSettings.theme carries, which pi and atomic resolve against a # vendored theme file; the two are not interchangeable strings. theme.dark = lib.mkDefault "dark-catppuccin"; + + # 180000 rather than upstream's 30000: a clone's first export has to + # realise the flake devshell, 7.4s here against a populated nix store + # and minutes when the closure must be built, and overrunning the + # budget runs the command without the devshell rather than failing. + # direnv is pinned at its own default so a change to that default + # shows up as a diff here. + bash = { + direnv = lib.mkDefault "auto"; + + direnvLoadTimeoutMs = lib.mkDefault 180000; + }; modelRoles = { default = lib.mkDefault "anthropic/claude-opus-5:xhigh"; advisor = lib.mkDefault "openai-codex/gpt-5.6-sol:xhigh";