Direnv #
Albedo uses direnv's own allow state for workspace environment files. The Python
kernel refreshes its environment before run(). The local TUI can ask the
person to allow a blocked file.
In the kernel #
albedo_direnv.refresh locates direnv once
per kernel and invokes direnv export json in the kernel's current directory
when an .envrc may apply. It applies string values and removes variables whose
values are null. Jobs inherit the resulting environment. See
the kernel.
The subprocess has a 600-second timeout. An export timeout or execution error prints a message and leaves the current environment unchanged. When a previously loaded file becomes blocked, the code attempts an unload before applying changes. If that unload fails or returns invalid JSON, old values can remain. The blocked message leaves the decision to allow the file to the person.
In the TUI #
chat_direnv.go checks
direnv status --json when the chat opens or moves, only for a local daemon and
workspace. A blocked file prompts the user. With an empty composer, y runs
direnv allow, while n or Escape dismisses the question. Denied files do not
prompt.