Problem
Boundary installation and wrapper script logic is embedded inside the agentapi module (scripts/boundary.sh, variables in main.tf). Additionally, lifecycle hook variables (pre_install_script, install_script, post_install_script, start_script) are passed through agentapi's Terraform variables and shell script, coupling consumer module concerns into agentapi. Finally, scripts are written to /tmp/ which can conflict with other processes and isn't a stable location.
These issues mean:
- Boundary cannot be extracted into a standalone module (REG-2) without first removing it from agentapi.
- Lifecycle hooks add unnecessary coupling — consumer modules (e.g. claude-code) should manage their own install and start scripts directly rather than threading them through agentapi variables.
/tmp/ script paths are fragile — multiple module instances or concurrent processes could collide.
Proposal
- Remove all boundary-related variables and logic from the agentapi module (
enable_boundary, boundary_config_path, boundary_version, compile_boundary_from_source, use_boundary_directly, scripts/boundary.sh, coder_env.boundary_config).
- Remove lifecycle hook variables (
pre_install_script, install_script, post_install_script, start_script) and their execution blocks from scripts/main.sh. Consumer modules should place their start script directly at $module_path/scripts/agentapi-start.sh.
- Add a
module_directory variable (default $HOME/.coder-modules/coder/agentapi) and write scripts there instead of /tmp/.
- Pass the lib script path via
ARG_LIB_SCRIPT_PATH instead of hardcoding /tmp/agentapi-lib.sh.
- Update tests accordingly: remove boundary and lifecycle hook tests, write start scripts directly to the container.
Breaking changes
The following Terraform variables are removed:
enable_boundary
boundary_config_path
boundary_version
compile_boundary_from_source
use_boundary_directly
pre_install_script
install_script
post_install_script
start_script
Consumer modules that pass these variables will need to be updated.
Context
Prerequisite for REG-2 (Decouple boundary into its own standalone module).
🤖 Generated with Coder Agents
Problem
Boundary installation and wrapper script logic is embedded inside the
agentapimodule (scripts/boundary.sh, variables inmain.tf). Additionally, lifecycle hook variables (pre_install_script,install_script,post_install_script,start_script) are passed through agentapi's Terraform variables and shell script, coupling consumer module concerns into agentapi. Finally, scripts are written to/tmp/which can conflict with other processes and isn't a stable location.These issues mean:
/tmp/script paths are fragile — multiple module instances or concurrent processes could collide.Proposal
enable_boundary,boundary_config_path,boundary_version,compile_boundary_from_source,use_boundary_directly,scripts/boundary.sh,coder_env.boundary_config).pre_install_script,install_script,post_install_script,start_script) and their execution blocks fromscripts/main.sh. Consumer modules should place their start script directly at$module_path/scripts/agentapi-start.sh.module_directoryvariable (default$HOME/.coder-modules/coder/agentapi) and write scripts there instead of/tmp/.ARG_LIB_SCRIPT_PATHinstead of hardcoding/tmp/agentapi-lib.sh.Breaking changes
The following Terraform variables are removed:
enable_boundaryboundary_config_pathboundary_versioncompile_boundary_from_sourceuse_boundary_directlypre_install_scriptinstall_scriptpost_install_scriptstart_scriptConsumer modules that pass these variables will need to be updated.
Context
Prerequisite for REG-2 (Decouple boundary into its own standalone module).
🤖 Generated with Coder Agents