-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Labels
Description
Objective
Implement environment variable passing to mirror essential GitHub Actions runner environment variables into the agent container, improving compatibility with actions and workflows.
Context
The Ubuntu runner image provides many environment variables that workflows and actions depend on (e.g., JAVA_HOME, ANDROID_HOME, CHROMEWEBDRIVER, CONDA, etc.). The agent container currently doesn't have access to these, which can cause issues when workflows expect them to be set.
Refer to specs/ubuntulatest.md section "Environment Variables" for the complete list.
Approach
- Identify critical environment variables from the runner that should be passed through:
- Build tool homes:
JAVA_HOME_*_X64,ANDROID_HOME,ANDROID_NDK,GOPATH - Tool paths:
CHROMEWEBDRIVER,GECKOWEBDRIVER,SELENIUM_JAR_PATH - Package managers:
CONDA,VCPKG_INSTALLATION_ROOT
- Build tool homes:
- Create a helper function to generate environment variable pass-through arguments
- Implement variable passing in the AWF command generation for all engines
- Add validation to ensure required variables exist before passing them
- Document which environment variables are automatically mirrored
Files to Modify
- Create:
pkg/workflow/env_mirror.go(environment variable mirroring logic) - Create:
pkg/workflow/env_mirror_test.go(test environment mirroring) - Modify:
pkg/workflow/copilot_engine_execution.go(add env passing to AWF args) - Modify:
pkg/workflow/claude_engine.go(add env passing to AWF args) - Modify:
pkg/workflow/codex_engine.go(add env passing to AWF args) - Modify:
docs/src/content/docs/reference/sandbox.md(document env mirroring)
Acceptance Criteria
- Essential environment variables are correctly passed to the agent container
- Missing variables are handled gracefully (no errors if not present on host)
- Tests verify environment variable presence in the container
- Documentation lists all mirrored environment variables
- Implementation works across all engine types
Related to epic: build/test environment for agentic workflow #11970
AI generated by Plan Command for #11970
Copilot