Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion registry/coder-labs/modules/codex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module "codex" {
preferred_auth_method = "apikey"
EOT

additional_mcp_servers = <<-EOT
mcp = <<-EOT
[mcp_servers.GitHub]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]
Expand Down
2 changes: 1 addition & 1 deletion registry/coder-labs/modules/codex/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ describe("codex", async () => {
].join("\n");
const { id, scripts } = await setup({
moduleVariables: {
additional_mcp_servers: additional,
mcp: additional,
},
});
await runScripts(id, scripts);
Expand Down
12 changes: 6 additions & 6 deletions registry/coder-labs/modules/codex/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ variable "install_codex" {

variable "codex_version" {
type = string
description = "The version of Codex to install. Empty string installs the latest available version."
default = ""
description = "The version of Codex to install."
default = "latest"
}

variable "openai_api_key" {
Expand All @@ -75,16 +75,16 @@ variable "base_config_toml" {
trust_level = "trusted"

When non-empty, the value is written verbatim as the base of config.toml;
additional_mcp_servers and AI Gateway sections are still appended after it.
mcp and AI Gateway sections are still appended after it.
Note: model_reasoning_effort and workdir trust are only applied in the
default config. Include them in your custom config if needed.
EOT
default = ""
}

variable "additional_mcp_servers" {
variable "mcp" {
type = string
description = "Additional MCP servers configuration in TOML format."
description = "MCP server configurations in TOML format. When set, servers are appended to the Codex config.toml."
Comment thread
DevelopmentCats marked this conversation as resolved.
default = ""
}

Expand Down Expand Up @@ -140,7 +140,7 @@ locals {
ARG_CODEX_VERSION = var.codex_version != "" ? base64encode(var.codex_version) : ""
ARG_WORKDIR = local.workdir != "" ? base64encode(local.workdir) : ""
ARG_BASE_CONFIG_TOML = var.base_config_toml != "" ? base64encode(var.base_config_toml) : ""
ARG_ADDITIONAL_MCP_SERVERS = var.additional_mcp_servers != "" ? base64encode(var.additional_mcp_servers) : ""
ARG_MCP = var.mcp != "" ? base64encode(var.mcp) : ""
ARG_ENABLE_AI_GATEWAY = tostring(var.enable_ai_gateway)
ARG_AIBRIDGE_CONFIG = var.enable_ai_gateway ? base64encode(local.aibridge_config) : ""
ARG_MODEL_REASONING_EFFORT = var.model_reasoning_effort
Expand Down
8 changes: 4 additions & 4 deletions registry/coder-labs/modules/codex/scripts/install.sh.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ARG_INSTALL='${ARG_INSTALL}'
ARG_CODEX_VERSION=$(echo -n '${ARG_CODEX_VERSION}' | base64 -d)
ARG_WORKDIR=$(echo -n '${ARG_WORKDIR}' | base64 -d)
ARG_BASE_CONFIG_TOML=$(echo -n '${ARG_BASE_CONFIG_TOML}' | base64 -d)
ARG_ADDITIONAL_MCP_SERVERS=$(echo -n '${ARG_ADDITIONAL_MCP_SERVERS}' | base64 -d)
ARG_MCP=$(echo -n '${ARG_MCP}' | base64 -d)
ARG_ENABLE_AI_GATEWAY='${ARG_ENABLE_AI_GATEWAY}'
ARG_AIBRIDGE_CONFIG=$(echo -n '${ARG_AIBRIDGE_CONFIG}' | base64 -d)
ARG_MODEL_REASONING_EFFORT='${ARG_MODEL_REASONING_EFFORT}'
Expand Down Expand Up @@ -150,9 +150,9 @@ function populate_config_toml() {
write_minimal_default_config "$${config_path}"
fi

if [ -n "$${ARG_ADDITIONAL_MCP_SERVERS}" ]; then
printf "Adding additional MCP servers\n"
echo "$${ARG_ADDITIONAL_MCP_SERVERS}" >> "$${config_path}"
if [ -n "$${ARG_MCP}" ]; then
printf "Adding MCP servers\n"
echo "$${ARG_MCP}" >> "$${config_path}"
fi

if [ "$${ARG_ENABLE_AI_GATEWAY}" = "true" ] && [ -n "$${ARG_AIBRIDGE_CONFIG}" ]; then
Expand Down
Loading