Description
codex_model is declared in the root module with a non-empty default, so every environment that does not explicitly opt out enables Codex on its next apply. The sibling CLI model variables are opt-in. This appears unintentional.
#350 added to terraform/variables.tf:
variable "codex_model" {
description = "Default Codex-on-Bedrock model id ... (empty = none)"
type = string
default = "openai.gpt-5.5"
}
That value is passed into the AgentCore module at terraform/main.tf:353:
codex_model = var.codex_model
The module's own variable defaults to empty and documents empty as meaning none (terraform/modules/compute/agentcore/variables.tf:90), and the module treats empty as not-enabled (terraform/modules/compute/agentcore/main.tf:426):
var.codex_model != "" ? { codex = var.codex_model } : {}
Because the root default is non-empty, the module never receives the empty value its own default and description describe. The cli-models SSM parameter is seeded with a codex entry.
This is inconsistent with the other CLI models. kiro_model defaults to "" in the module (agentcore/variables.tf:84) and is set explicitly at the call site. bedrock_model is set per environment in tfvars. codex_model is the only one that is on unless explicitly disabled.
Expected: enabling a new agent CLI is an explicit, per-environment decision.
Actual: it is inherited from a root default, and nothing in a terraform plan diff reads as "enabling a new agent CLI".
Steps to reproduce
git checkout main at b9ab0b6d
- Use an environment tfvars that does not set
codex_model (for example one containing only environment, aws_region, bedrock_model)
terraform plan -var-file=terraform/environments/<env>.tfvars
- Inspect the planned value of the
cli-models SSM parameter: it contains a codex entry despite codex_model never being set for that environment
Logs or screenshots
Root default, terraform/variables.tf:
variable "codex_model" {
default = "openai.gpt-5.5"
}
Module default and gate, terraform/modules/compute/agentcore/:
# variables.tf:84
variable "kiro_model" { default = "" }
# variables.tf:90
variable "codex_model" { default = "" } # description says "(empty = none)"
# main.tf:422
var.kiro_model != "" ? { kiro = var.kiro_model } : {},
# main.tf:426
var.codex_model != "" ? { codex = var.codex_model } : {}
Environment
Question
Is the non-empty root default intended?
If Codex should be opt-in like Kiro, the root default should be "" and environments should opt in through tfvars. If it is intended to be on by default, then the module variable's "" default and its (empty = none) description are misleading and should be updated to match.
Related
#350 also materializes CODEX_HOME under the persistent workspace mount (lambda/agentcore/stage-materializer.js:400; asserted as <ws>/.aidlc/codex-home in lambda/agentcore/test/stage-materializer.test.js:610). Anything on that mount is subject to the AgentCore session-storage idle expiry, documented as 14 days in terraform/modules/compute/agentcore/main.tf:619. That is the mount's expiry rather than a Codex-specific retention policy, but enabling Codex by default widens what lands there, which is a further reason to make the choice explicit.
Description
codex_modelis declared in the root module with a non-empty default, so every environment that does not explicitly opt out enables Codex on its next apply. The sibling CLI model variables are opt-in. This appears unintentional.#350added toterraform/variables.tf:That value is passed into the AgentCore module at
terraform/main.tf:353:The module's own variable defaults to empty and documents empty as meaning none (
terraform/modules/compute/agentcore/variables.tf:90), and the module treats empty as not-enabled (terraform/modules/compute/agentcore/main.tf:426):Because the root default is non-empty, the module never receives the empty value its own default and description describe. The
cli-modelsSSM parameter is seeded with acodexentry.This is inconsistent with the other CLI models.
kiro_modeldefaults to""in the module (agentcore/variables.tf:84) and is set explicitly at the call site.bedrock_modelis set per environment in tfvars.codex_modelis the only one that is on unless explicitly disabled.Expected: enabling a new agent CLI is an explicit, per-environment decision.
Actual: it is inherited from a root default, and nothing in a
terraform plandiff reads as "enabling a new agent CLI".Steps to reproduce
git checkout mainatb9ab0b6dcodex_model(for example one containing onlyenvironment,aws_region,bedrock_model)terraform plan -var-file=terraform/environments/<env>.tfvarscli-modelsSSM parameter: it contains acodexentry despitecodex_modelnever being set for that environmentLogs or screenshots
Root default,
terraform/variables.tf:Module default and gate,
terraform/modules/compute/agentcore/:Environment
mainatb9ab0b6d(feat(agentcore): add Codex CLI with Bedrock inference #350)>= 1.0(terraform/main.tf:2); CI pins1.15.0codex_modelQuestion
Is the non-empty root default intended?
If Codex should be opt-in like Kiro, the root default should be
""and environments should opt in through tfvars. If it is intended to be on by default, then the module variable's""default and its(empty = none)description are misleading and should be updated to match.Related
#350also materializesCODEX_HOMEunder the persistent workspace mount (lambda/agentcore/stage-materializer.js:400; asserted as<ws>/.aidlc/codex-homeinlambda/agentcore/test/stage-materializer.test.js:610). Anything on that mount is subject to the AgentCore session-storage idle expiry, documented as 14 days interraform/modules/compute/agentcore/main.tf:619. That is the mount's expiry rather than a Codex-specific retention policy, but enabling Codex by default widens what lands there, which is a further reason to make the choice explicit.