AgentConfigurationEnvironment
Environment Variable Loading
How project agents combine host-provided env and project .env
Environment Variable Loading
When a project agent starts, it only combines two user-facing env layers:
- host-provided
new Agent({ env }) - project-root
.env
Common use cases
- sharing common secrets from the host
- overriding host values per project with
.env
Recommended practice
- let the host inject shared secrets into
Agent - keep project-local overrides in
.env - keep
downcity.jsonstructural only;${VAR}placeholders are no longer supported
Benefits:
- env flow is explicit
- config stays stable
- there is no hidden string replacement during config loading
What to do after changes
Usually you should restart the agent:
town agent restartThe agent snapshots env at startup, so changing .env or host-injected values does not automatically refresh the current runtime process.