From 62f2f6b0f917ae928985a6b6135a30f399b1d53a Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Tue, 3 Mar 2026 09:00:17 +0530 Subject: [PATCH 1/9] feat(coder-labs/modules/codex): skip migration notice and add agentapi type --- registry/coder-labs/modules/codex/main.tf | 10 ++++++++-- registry/coder-labs/modules/codex/scripts/install.sh | 4 ++++ registry/coder-labs/modules/codex/scripts/start.sh | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/registry/coder-labs/modules/codex/main.tf b/registry/coder-labs/modules/codex/main.tf index cc07ce2f9..da7cb979e 100644 --- a/registry/coder-labs/modules/codex/main.tf +++ b/registry/coder-labs/modules/codex/main.tf @@ -136,8 +136,8 @@ variable "agentapi_version" { variable "codex_model" { type = string - description = "The model for Codex to use. Defaults to gpt-5.2-codex." - default = "gpt-5.2-codex" + description = "The model for Codex to use. Defaults to gpt-5.3-codex." + default = "gpt-5.3-codex" } variable "pre_install_script" { @@ -189,6 +189,7 @@ locals { install_script = file("${path.module}/scripts/install.sh") start_script = file("${path.module}/scripts/start.sh") module_dir_name = ".codex-module" + latest_codex_model = "gpt-5.3-codex" aibridge_config = <<-EOF [model_providers.aibridge] name = "AI Bridge" @@ -200,6 +201,9 @@ locals { model_provider = "aibridge" model = "${var.codex_model}" model_reasoning_effort = "${var.model_reasoning_effort}" + + [notice.model_migration] + "${var.codex_model}" = "${local.latest_codex_model}" EOF } @@ -249,6 +253,8 @@ module "agentapi" { chmod +x /tmp/install.sh ARG_OPENAI_API_KEY='${var.openai_api_key}' \ ARG_REPORT_TASKS='${var.report_tasks}' \ + ARG_CODEX_MODEL='${var.codex_model}' \ + ARG_LATEST_CODEX_MODEL='${local.latest_codex_model}' \ ARG_INSTALL='${var.install_codex}' \ ARG_CODEX_VERSION='${var.codex_version}' \ ARG_BASE_CONFIG_TOML='${base64encode(var.base_config_toml)}' \ diff --git a/registry/coder-labs/modules/codex/scripts/install.sh b/registry/coder-labs/modules/codex/scripts/install.sh index 97d539a8c..c83ee2b36 100644 --- a/registry/coder-labs/modules/codex/scripts/install.sh +++ b/registry/coder-labs/modules/codex/scripts/install.sh @@ -20,6 +20,8 @@ echo "=== Codex Module Configuration ===" printf "Install Codex: %s\n" "$ARG_INSTALL" printf "Codex Version: %s\n" "$ARG_CODEX_VERSION" printf "App Slug: %s\n" "$ARG_CODER_MCP_APP_STATUS_SLUG" +printf "Codex Model: %s\n" "${ARG_CODEX_MODEL:-"Default"}" +printf "Latest Codex Model: %s\n" "${ARG_LATEST_CODEX_MODEL}" printf "Start Directory: %s\n" "$ARG_CODEX_START_DIRECTORY" printf "Has Base Config: %s\n" "$([ -n "$ARG_BASE_CONFIG_TOML" ] && echo "Yes" || echo "No")" printf "Has Additional MCP: %s\n" "$([ -n "$ARG_ADDITIONAL_MCP_SERVERS" ] && echo "Yes" || echo "No")" @@ -99,6 +101,8 @@ preferred_auth_method = "apikey" [sandbox_workspace_write] network_access = true +[notice.model_migration] +"${ARG_CODEX_MODEL}" = "${ARG_LATEST_CODEX_MODEL}" EOF } diff --git a/registry/coder-labs/modules/codex/scripts/start.sh b/registry/coder-labs/modules/codex/scripts/start.sh index 3e55dc70f..767351651 100644 --- a/registry/coder-labs/modules/codex/scripts/start.sh +++ b/registry/coder-labs/modules/codex/scripts/start.sh @@ -213,7 +213,7 @@ capture_session_id() { start_codex() { printf "Starting Codex with arguments: %s\n" "${CODEX_ARGS[*]}" - agentapi server --term-width 67 --term-height 1190 -- codex "${CODEX_ARGS[@]}" & + agentapi server --type codex --term-width 67 --term-height 1190 -- codex "${CODEX_ARGS[@]}" & capture_session_id } From 17366de88247bb098fb815526eadc9012fe97771 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Tue, 3 Mar 2026 09:06:45 +0530 Subject: [PATCH 2/9] chore: bump module versions (patch) --- registry/coder-labs/modules/codex/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/registry/coder-labs/modules/codex/README.md b/registry/coder-labs/modules/codex/README.md index b4a895dea..16e6c105b 100644 --- a/registry/coder-labs/modules/codex/README.md +++ b/registry/coder-labs/modules/codex/README.md @@ -13,7 +13,7 @@ Run Codex CLI in your workspace to access OpenAI's models through the Codex inte ```tf module "codex" { source = "registry.coder.com/coder-labs/codex/coder" - version = "4.1.1" + version = "4.1.2" agent_id = coder_agent.example.id openai_api_key = var.openai_api_key workdir = "/home/coder/project" @@ -32,7 +32,7 @@ module "codex" { module "codex" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder-labs/codex/coder" - version = "4.1.1" + version = "4.1.2" agent_id = coder_agent.example.id openai_api_key = "..." workdir = "/home/coder/project" @@ -51,7 +51,7 @@ For tasks integration with AI Bridge, add `enable_aibridge = true` to the [Usage ```tf module "codex" { source = "registry.coder.com/coder-labs/codex/coder" - version = "4.1.1" + version = "4.1.2" agent_id = coder_agent.example.id workdir = "/home/coder/project" enable_aibridge = true @@ -94,7 +94,7 @@ data "coder_task" "me" {} module "codex" { source = "registry.coder.com/coder-labs/codex/coder" - version = "4.1.1" + version = "4.1.2" agent_id = coder_agent.example.id openai_api_key = "..." ai_prompt = data.coder_task.me.prompt @@ -112,7 +112,7 @@ This example shows additional configuration options for custom models, MCP serve ```tf module "codex" { source = "registry.coder.com/coder-labs/codex/coder" - version = "4.1.1" + version = "4.1.2" agent_id = coder_agent.example.id openai_api_key = "..." workdir = "/home/coder/project" From 98e813a7e09acfb56137b951dbbf6c8aadb2a472 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Tue, 3 Mar 2026 09:08:32 +0530 Subject: [PATCH 3/9] chore: bun fmt --- registry/coder-labs/modules/codex/main.tf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/registry/coder-labs/modules/codex/main.tf b/registry/coder-labs/modules/codex/main.tf index da7cb979e..61498ff33 100644 --- a/registry/coder-labs/modules/codex/main.tf +++ b/registry/coder-labs/modules/codex/main.tf @@ -184,13 +184,13 @@ resource "coder_env" "coder_aibridge_session_token" { } locals { - workdir = trimsuffix(var.workdir, "/") - app_slug = "codex" - install_script = file("${path.module}/scripts/install.sh") - start_script = file("${path.module}/scripts/start.sh") - module_dir_name = ".codex-module" + workdir = trimsuffix(var.workdir, "/") + app_slug = "codex" + install_script = file("${path.module}/scripts/install.sh") + start_script = file("${path.module}/scripts/start.sh") + module_dir_name = ".codex-module" latest_codex_model = "gpt-5.3-codex" - aibridge_config = <<-EOF + aibridge_config = <<-EOF [model_providers.aibridge] name = "AI Bridge" base_url = "${data.coder_workspace.me.access_url}/api/v2/aibridge/openai/v1" From 9b05bb8924b3e2539c3d0faa7f94e13bf6151025 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Tue, 3 Mar 2026 09:46:25 +0530 Subject: [PATCH 4/9] feat: add profile default in codex config --- registry/coder-labs/modules/codex/scripts/install.sh | 8 ++++++++ registry/coder-labs/modules/codex/scripts/start.sh | 7 ++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/registry/coder-labs/modules/codex/scripts/install.sh b/registry/coder-labs/modules/codex/scripts/install.sh index c83ee2b36..53ef07402 100644 --- a/registry/coder-labs/modules/codex/scripts/install.sh +++ b/registry/coder-labs/modules/codex/scripts/install.sh @@ -92,11 +92,19 @@ function install_codex() { write_minimal_default_config() { local config_path="$1" + + ARG_DEFAULT_PROFILE="" + + if [[ "${ARG_ENABLE_AIBRIDGE}" = "true" ]]; then + ARG_DEFAULT_PROFILE='"profile" = "aibridge"' + fi + cat << EOF > "$config_path" # Minimal Default Codex Configuration sandbox_mode = "workspace-write" approval_policy = "never" preferred_auth_method = "apikey" +${ARG_DEFAULT_PROFILE} [sandbox_workspace_write] network_access = true diff --git a/registry/coder-labs/modules/codex/scripts/start.sh b/registry/coder-labs/modules/codex/scripts/start.sh index 767351651..e0e7d9725 100644 --- a/registry/coder-labs/modules/codex/scripts/start.sh +++ b/registry/coder-labs/modules/codex/scripts/start.sh @@ -155,11 +155,8 @@ setup_workdir() { build_codex_args() { CODEX_ARGS=() - if [ "$ARG_ENABLE_AIBRIDGE" = "true" ]; then - printf "AI Bridge is enabled, using profile aibridge\n" - CODEX_ARGS+=("--profile" "aibridge") - elif [ -n "$ARG_CODEX_MODEL" ]; then - CODEX_ARGS+=("--model" "$ARG_CODEX_MODEL") + if [[ -n "${ARG_CODEX_MODEL}" ]] && [[ "${ARG_ENABLE_AIBRIDGE}" != "true" ]]; then + CODEX_ARGS+=("--model" "${ARG_CODEX_MODEL}") fi if [ "$ARG_CONTINUE" = "true" ]; then From f5d293eac373cf086b3b997460e7820ac9a3cdb5 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Tue, 3 Mar 2026 10:06:08 +0530 Subject: [PATCH 5/9] fix: remove notice config from ai-bridge config --- registry/coder-labs/modules/codex/main.tf | 3 --- 1 file changed, 3 deletions(-) diff --git a/registry/coder-labs/modules/codex/main.tf b/registry/coder-labs/modules/codex/main.tf index 61498ff33..41bf86ee1 100644 --- a/registry/coder-labs/modules/codex/main.tf +++ b/registry/coder-labs/modules/codex/main.tf @@ -201,9 +201,6 @@ locals { model_provider = "aibridge" model = "${var.codex_model}" model_reasoning_effort = "${var.model_reasoning_effort}" - - [notice.model_migration] - "${var.codex_model}" = "${local.latest_codex_model}" EOF } From b7b4ce646f6231bae5eba92d5d75594a9b9531f5 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Tue, 3 Mar 2026 10:08:37 +0530 Subject: [PATCH 6/9] chore: fix names --- registry/coder-labs/modules/codex/scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/coder-labs/modules/codex/scripts/install.sh b/registry/coder-labs/modules/codex/scripts/install.sh index 53ef07402..9e73e048f 100644 --- a/registry/coder-labs/modules/codex/scripts/install.sh +++ b/registry/coder-labs/modules/codex/scripts/install.sh @@ -109,7 +109,7 @@ ${ARG_DEFAULT_PROFILE} [sandbox_workspace_write] network_access = true -[notice.model_migration] +[notice.model_migrations] "${ARG_CODEX_MODEL}" = "${ARG_LATEST_CODEX_MODEL}" EOF } From 825a0c9299f6ac658453e0b1f3932ea2f5f0db2b Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Tue, 3 Mar 2026 10:19:14 +0530 Subject: [PATCH 7/9] chore: remove double quotes from toml --- registry/coder-labs/modules/codex/scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/coder-labs/modules/codex/scripts/install.sh b/registry/coder-labs/modules/codex/scripts/install.sh index 9e73e048f..4742c4137 100644 --- a/registry/coder-labs/modules/codex/scripts/install.sh +++ b/registry/coder-labs/modules/codex/scripts/install.sh @@ -96,7 +96,7 @@ write_minimal_default_config() { ARG_DEFAULT_PROFILE="" if [[ "${ARG_ENABLE_AIBRIDGE}" = "true" ]]; then - ARG_DEFAULT_PROFILE='"profile" = "aibridge"' + ARG_DEFAULT_PROFILE='profile = "aibridge"' fi cat << EOF > "$config_path" From 10a4b3ee469649d14d3afd7c3822f26d52c62d8e Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Tue, 3 Mar 2026 10:28:39 +0530 Subject: [PATCH 8/9] chore: update tests --- registry/coder-labs/modules/codex/main.test.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/registry/coder-labs/modules/codex/main.test.ts b/registry/coder-labs/modules/codex/main.test.ts index a4edd8185..d4b9b96eb 100644 --- a/registry/coder-labs/modules/codex/main.test.ts +++ b/registry/coder-labs/modules/codex/main.test.ts @@ -464,22 +464,15 @@ describe("codex", async () => { }); await execModuleScript(id); - - const startLog = await readFileContainer( - id, - "/home/coder/.codex-module/agentapi-start.log", - ); - const configToml = await readFileContainer( id, "/home/coder/.codex/config.toml", ); - expect(startLog).toContain("AI Bridge is enabled, using profile aibridge"); - expect(startLog).toContain( - "Starting Codex with arguments: --profile aibridge", - ); expect(configToml).toContain( "[profiles.aibridge]\n" + 'model_provider = "aibridge"', ); + expect(configToml).toContain( + 'profile = "aibridge"', + ); }); }); From eb3d4afd7ddbf3ef6cd723983200890514580a05 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Tue, 3 Mar 2026 10:31:57 +0530 Subject: [PATCH 9/9] chore: bun fmt --- registry/coder-labs/modules/codex/main.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/registry/coder-labs/modules/codex/main.test.ts b/registry/coder-labs/modules/codex/main.test.ts index d4b9b96eb..f8d9f0a59 100644 --- a/registry/coder-labs/modules/codex/main.test.ts +++ b/registry/coder-labs/modules/codex/main.test.ts @@ -471,8 +471,6 @@ describe("codex", async () => { expect(configToml).toContain( "[profiles.aibridge]\n" + 'model_provider = "aibridge"', ); - expect(configToml).toContain( - 'profile = "aibridge"', - ); + expect(configToml).toContain('profile = "aibridge"'); }); });