Repository navigation
fix: keep host variables out of the daemons' ddev start launches, for #8380 - #8976
Merged
rfay merged 2 commits intoOct 21, 2026
Merged
Conversation
## Short Summary (TL;DR) `ddev start` no longer passes AI agent variables like `AI_AGENT` or `CLAUDECODE` to `supervisord` and `web_extra_daemons`, so a project runs the same whether a person or an agent started it. ## The Issue - Follow-up to ddev#8380, see ddev#8380 (comment) `ddev start` runs `/start.sh` through `app.Exec`, which since ddev#8380 adds the host variables that `execEnv` forwards, and `start.sh` ends with `exec supervisord`. So every daemon inherited the agent variables of the shell that ran `ddev start`, while PID 1 did not have them. Astro 7.4 runs `astro dev` in the background when it detects an agent, so its `web_extra_daemons` command exited at once and supervisor kept respawning it. ## How This PR Solves The Issue A new `ExecOpts.SkipHostEnv` makes `Exec` pass only `Env`, without `execEnv`, and the `/start.sh` exec sets it. That gives `start.sh` the same environment it had before ddev#8380. This leaves the container environment alone, so bare `web_environment` names that Compose resolved at start still reach the daemons, as they did before ddev#8380. ## Manual Testing Instructions ```bash ddev utility download-ddev --pr 8976 export PATH="$HOME/tmp/ddev-download-ddev/pr-8976:$PATH" mkdir -p ~/tmp/start-env && cd ~/tmp/start-env ddev config --project-type=php --web-environment-add=MY_BARE_VAR AI_AGENT=manual-test MY_BARE_VAR=from-host ddev start -y ddev exec 'tr "\0" "\n" < /proc/$(pgrep -x supervisord)/environ | grep -E "AI_AGENT|MY_BARE_VAR"' # MY_BARE_VAR=from-host only, no AI_AGENT AI_AGENT=manual-test ddev exec 'echo $AI_AGENT' # manual-test, ddev exec still forwards it ``` See the note added under [Host Variables Forwarded on Exec](https://ddev--8976.org.readthedocs.build/en/8976/users/configuration/environment-variables/#host-variables-forwarded-on-exec). ## Automated Testing Overview `TestExtraPortExpose`, which already starts a project with `web_extra_daemons`, now sets `AI_AGENT` before `ddev start` and checks that `ddev exec` gets it while `supervisord` does not. It fails without the fix. 🤖 Developed with assistance from [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 5.5 <[email protected]>
stasadev
added a commit
to ddev/ddev.com
that referenced
this pull request
Oct 19, 2026
ddev/ddev#8976 stops `ddev start` from passing `AI_AGENT`, `CLAUDECODE` and the other agent variables to supervisord, so `astro dev` stays in the foreground whoever ran `ddev start`, and the flag is no longer needed. The leak came from ddev/ddev#8380, which no DDEV release includes, so `ddev_version_constraint` stays as it is. The `bump-deps` skill keeps the daemon check without naming the flag. 🤖 Developed with assistance from [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Download this PR's build for your OS and architecture with: ddev utility download-ddev --pr 8976Or download the artifact for your OS and architecture directly:
See Testing a PR. |
ddev start launchesddev start launches, for #8380
stasadev
force-pushed
the
20261019_stasadev_start_sh_no_agent_env
branch
from
October 19, 2026 12:49
33639c5 to
cea2a7d
Compare
rfay
approved these changes
Oct 19, 2026
rfay
left a comment
Member
There was a problem hiding this comment.
Wow, amazing how much complexity we're dealing with in our world. I thought this was just a little docker-compose wrapper!
Co-authored-by: Randy Fay <[email protected]>
ddev start launches, for #8380ddev start launches, for #8380
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short Summary (TL;DR)
ddev startno longer passes AI agent variables likeAI_AGENTorCLAUDECODEtosupervisordandweb_extra_daemons, so a project runs the same whether a person or an agent started it.The Issue
ddev startruns/start.shthroughapp.Exec, which since #8380 adds the host variables thatexecEnvforwards, andstart.shends withexec supervisord. So every daemon inherited the agent variables of the shell that randdev start, while PID 1 did not have them. Astro 7.4 runsastro devin the background when it detects an agent, so itsweb_extra_daemonscommand exited at once and supervisor kept respawning it.How This PR Solves The Issue
A new
ExecOpts.SkipHostEnvmakesExecpass onlyEnv, withoutexecEnv, and the/start.shexec sets it. That givesstart.shthe same environment it had before #8380. This leaves the container environment alone, so bareweb_environmentnames that Compose resolved at start still reach the daemons, as they did before #8380.Manual Testing Instructions
See the note added under Host Variables Forwarded on Exec.
Automated Testing Overview
TestExtraPortExpose, which already starts a project withweb_extra_daemons, now setsAI_AGENTbeforeddev startand checks thatddev execgets it whilesupervisorddoes not. It fails without the fix.🤖 Developed with assistance from Claude Code