diff --git a/registry/coder-labs/modules/codex/main.test.ts b/registry/coder-labs/modules/codex/main.test.ts index 7125efbe..72f9b88b 100644 --- a/registry/coder-labs/modules/codex/main.test.ts +++ b/registry/coder-labs/modules/codex/main.test.ts @@ -469,7 +469,7 @@ describe("codex", async () => { ).text(), }); // Drop the remote TOML payload at a path the install script will fetch - // via file:// — keeps the test self-contained (no external network). + // via file://. Keeps the test self-contained (no external network). await execContainer(id, [ "bash", "-c", diff --git a/registry/coder-labs/modules/codex/main.tftest.hcl b/registry/coder-labs/modules/codex/main.tftest.hcl index 2595204f..c4c7403f 100644 --- a/registry/coder-labs/modules/codex/main.tftest.hcl +++ b/registry/coder-labs/modules/codex/main.tftest.hcl @@ -196,11 +196,6 @@ run "test_mcp_config_remote_path" { ] } - assert { - condition = length(var.mcp_config_remote_path) == 2 - error_message = "mcp_config_remote_path should accept a list of URLs" - } - assert { condition = strcontains(local.install_script, base64encode(jsonencode(var.mcp_config_remote_path))) error_message = "install script should embed the base64-encoded mcp_config_remote_path JSON" diff --git a/registry/coder-labs/modules/codex/scripts/install.sh.tftpl b/registry/coder-labs/modules/codex/scripts/install.sh.tftpl index 1920beff..f7e63a29 100644 --- a/registry/coder-labs/modules/codex/scripts/install.sh.tftpl +++ b/registry/coder-labs/modules/codex/scripts/install.sh.tftpl @@ -158,6 +158,9 @@ function populate_config_toml() { fi if [ -n "$${ARG_MCP_CONFIG_REMOTE_PATH}" ] && [ "$${ARG_MCP_CONFIG_REMOTE_PATH}" != "[]" ]; then + if ! command -v jq > /dev/null 2>&1; then + printf "Error: 'jq' is required to process mcp_config_remote_path but was not found. Skipping remote MCP config fetch.\n" >&2 + else for url in $(echo "$${ARG_MCP_CONFIG_REMOTE_PATH}" | jq -r '.[]'); do echo "Fetching MCP configuration from: $${url}" mcp_toml=$(curl -fsSL "$${url}") || { @@ -167,6 +170,7 @@ function populate_config_toml() { printf "Appending MCP servers from %s\n" "$${url}" printf '\n%s\n' "$${mcp_toml}" >> "$${config_path}" done + fi fi if [ "$${ARG_ENABLE_AI_GATEWAY}" = "true" ] && [ -n "$${ARG_AIBRIDGE_CONFIG}" ]; then