feat(acp): add env field to ACPAgentConfig for subprocess env injection (#1447)

Allow per-agent environment variables to be declared in config.yaml under
acp_agents.<name>.env. Values prefixed with $ are resolved from the host
environment at invocation time, consistent with other config fields.
Passes None to spawn_agent_process when env is empty so the subprocess
inherits the parent environment unchanged.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
DanielWalnut
2026-03-27 20:03:30 +08:00
committed by GitHub
parent 40a4acbbed
commit 8590249db4
5 changed files with 215 additions and 3 deletions

View File

@@ -406,6 +406,8 @@ sandbox:
# description: Claude Code for implementation, refactoring, and debugging
# model: null
# # auto_approve_permissions: false # Set to true to auto-approve ACP permission requests
# # env: # Optional: inject environment variables into the agent subprocess
# # ANTHROPIC_API_KEY: $ANTHROPIC_API_KEY # $VAR resolves from host environment
#
# codex:
# # DeerFlow expects an ACP adapter here. The standard `codex` CLI does not
@@ -415,6 +417,8 @@ sandbox:
# description: Codex CLI for repository tasks and code generation
# model: null
# # auto_approve_permissions: false # Set to true to auto-approve ACP permission requests
# # env: # Optional: inject environment variables into the agent subprocess
# # OPENAI_API_KEY: $OPENAI_API_KEY # $VAR resolves from host environment
# ============================================================================
# Skills Configuration