run_bash: optionally wrap in direnv exec for dev shell env

t-465·WorkTask·
·
·
Created1 month ago·Updated4 weeks ago

Description

Edit

Wrap run_bash commands in direnv exec to get full dev shell environment.

Problem

Ava's run_bash only has explicitly declared rundeps in PATH. Many tools from the dev shell (nix develop) aren't available.

Solution

Modify executeRunBash in Tools.hs to optionally wrap commands:

-- If CODEROOT has a .envrc, wrap in direnv exec
let wrappedCmd = 
  if hasDirenv coderoot
  then "direnv exec " <> coderoot <> " bash -c " <> shellQuote cmd
  else cmd

Requirements

1. Add direnv as a rundep to Ava 2. Detect if working directory has .envrc 3. Shell-quote the command properly 4. Consider cwd parameter - may need different .envrc

Alternative

Just keep adding explicit rundeps as needed. Simpler but more manual.

Timeline (5)

🔄[human]Open → InProgress4 weeks ago
💬[human]4 weeks ago

Feature is already implemented:

  • use_dev_shell parameter exists in run_bash schema
  • direnv is in Ava runtime deps (-- : run direnv)
  • Implementation in executeRunBash wraps command in direnv exec when enabled
  • Schema documented: 'if true, wrap command in direnv exec to get full dev shell environment'
🔄[human]InProgress → Done4 weeks ago
Complete[engineer]{"verified":true}4 weeks ago