From 50f4d5388b2f4b6fd713954bc9d60de9bfcfb687 Mon Sep 17 00:00:00 2001 From: Matt Hazinski Date: Tue, 14 Oct 2025 09:49:52 -0700 Subject: [PATCH] fix(codex): pass folder variable to agentapi module (#477) ## Description The folder variable was not being passed from the codex module to the agentapi module, causing agentapi to use its default value of `/home/coder` instead of the user-specified folder path. This resulted in permission errors when the codex module tried to create directories in `/home/coder` when users specified a different folder like `/home/matt/foo`. Fix by adding `folder = var.folder` to the agentapi module invocation. ## Type of Change - [ ] New module - [ ] New template - [x] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other ## Module Information Path: registry/coder-labs/modules/codex New version: v2.1.1 Breaking change: [ ] Yes [X] No ## Testing & Validation - [x] Tests pass (`bun test`) - [x] Code formatted (`bun fmt`) - [x] Changes tested locally ## Related Issues Fixes https://github.com/coder/registry/issues/476 --------- Co-authored-by: Claude Co-authored-by: DevelopmentCats --- registry/coder-labs/modules/codex/README.md | 8 ++++---- registry/coder-labs/modules/codex/main.tf | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/registry/coder-labs/modules/codex/README.md b/registry/coder-labs/modules/codex/README.md index e5eaafe4..549721ec 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 = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id openai_api_key = var.openai_api_key folder = "/home/coder/project" @@ -33,7 +33,7 @@ module "codex" { module "codex" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder-labs/codex/coder" - version = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id openai_api_key = "..." folder = "/home/coder/project" @@ -60,7 +60,7 @@ module "coder-login" { module "codex" { source = "registry.coder.com/coder-labs/codex/coder" - version = "2.1.0" + version = "2.1.1" agent_id = coder_agent.example.id openai_api_key = "..." ai_prompt = data.coder_parameter.ai_prompt.value @@ -106,7 +106,7 @@ For custom Codex configuration, use `base_config_toml` and/or `additional_mcp_se ```tf module "codex" { source = "registry.coder.com/coder-labs/codex/coder" - version = "2.1.0" + version = "2.1.1" # ... other variables ... # Override default configuration diff --git a/registry/coder-labs/modules/codex/main.tf b/registry/coder-labs/modules/codex/main.tf index 7c2e890d..460d5af9 100644 --- a/registry/coder-labs/modules/codex/main.tf +++ b/registry/coder-labs/modules/codex/main.tf @@ -131,6 +131,7 @@ module "agentapi" { version = "1.2.0" agent_id = var.agent_id + folder = var.folder web_app_slug = local.app_slug web_app_order = var.order web_app_group = var.group