Skip to content

Bug: folder variable not passed from codex module to agentapi module #476

@matthazinski

Description

@matthazinski

When using the codex module with a custom folder parameter, the specified folder path is not being passed to the underlying agentapi module. This causes the module to use the agentapi default value of /home/coder instead, resulting in permission errors when that directory doesn't exist or isn't accessible.

Steps to Reproduce

  1. Configure the codex module with a custom folder path:
module "codex" {
  source   = "registry.coder.com/coder-labs/codex/coder"
  version  = "2.1.0"
  agent_id = coder_agent.dev.id
  folder   = "/home/matt/foobar"  # Custom folder path
  openai_api_key = var.openai_api_key
  ai_prompt = data.coder_parameter.ai_prompt.value
}
  1. Create or start a Coder workspace using this template

  2. Check the workspace startup logs

Expected Behavior

The codex module should initialize and run in the user-specified folder (/home/matt/foobar).

Actual Behavior

The module attempts to use /home/coder instead and fails with a permission error:

Warning: The specified folder '/home/coder' does not exist.
Creating the folder...
mkdir: cannot create directory '/home/coder': Permission denied

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions