Skip to content

Pass environment variables (i.e. AI_AGENT) for AI detection inside web container #8378

@stasadev

Description

@stasadev

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem?

From Slack https://drupal.slack.com/archives/C5TQRQZRR/p1777655560509749

so PHPStan and other tools have agent detection. but if Claude invokes ddev php vendor/bin/... the detection is lost. Is there some magical way to pass this along? Or just setup .ddev/config.local.yaml and "fake" the AI_AGENT  env tools in DDEV always think its an agent

Describe your solution

See https://github.com/laravel/agent-detector#supported-agents

We should pass these environment variables inside the web container here:

environment:
- COLUMNS

Edit: this won't work if people run ddev start, and only then open the agent. It should be passed in runtime, e.g. docker-compose exec -e AI_AGENT=....

Describe alternatives

Pass them to all containers inside fixupComposeYaml, but I'm not sure if it's useful.

Additional context

We should have first-class support for this - users shouldn't have to do extra work for it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions