You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Docker on v0.6.4, shell_exec subprocesses only see a minimal environment (HOME, PATH, PWD) even though the full environment is present in the running openfang process and config passthrough/allowlists are set.
This looks related to the subprocess env-clearing behavior and may be similar in class to #660.
Version
OpenFang: v0.6.4
Deployment: Docker Compose
Restart method: always docker compose down && docker compose up -d
OpenFang itself can use OPENAI_API_KEY, so the main service can read env vars.
The failure seems specific to the subprocess execution path used by shell_exec.
This may be related to the subprocess env_clear() behavior described in the project security model, but it appears the configured allow/passthrough lists are not being applied to shell_exec.
Description
Summary
In Docker on v0.6.4,
shell_execsubprocesses only see a minimal environment (HOME,PATH,PWD) even though the full environment is present in the runningopenfangprocess and config passthrough/allowlists are set.This looks related to the subprocess env-clearing behavior and may be similar in class to #660.
Version
docker compose down && docker compose up -dActual
When the agent runs:
the complete output is only:
So
shell_execis getting only a minimal environment.Proof the env vars are in the OpenFang process
Running this through the agent:
shows PID 1 has the expected variables, including:
So the environment is definitely present in the
openfangservice process, but not in the subprocess used byshell_exec.Docker Compose environment resolution is correct
docker compose configresolves the environment correctly before container creation. Relevant section:Config used
Redacted version of relevant config:
Notes
OPENAI_API_KEY, so the main service can read env vars.shell_exec.env_clear()behavior described in the project security model, but it appears the configured allow/passthrough lists are not being applied toshell_exec.Expected Behavior
Expected
Commands run through
shell_execshould receive the explicitly allowed environment variables, or at minimum honor:exec_policy.env_passthroughenv_allowlistSteps to Reproduce
Reproduction
environment:docker compose configresolves those variablescat /proc/1/environprintenvHOME,PATH, andPWDOpenFang Version
0.6.4
Operating System
Linux (x86_64)
Logs / Screenshots
No response