Skip to content

fix(codex): respect CODEX_HOME - #1163

Open
kdcokenny wants to merge 2 commits into
coder:mainfrom
kdcokenny:fix/codex-home
Open

kdcokenny wants to merge 2 commits into
coder:mainfrom
kdcokenny:fix/codex-home

Conversation

@kdcokenny

Copy link
Copy Markdown

Description

respects CODEX_HOME when writing config.toml, falling back to $HOME/.codex when it's unset or empty.

the module was always writing to ~/.codex, so Codex ignored the module's settings when using a custom config directory.

Type of Change

  • New module
  • New template
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder-labs/modules/codex
New version: v5.4.2
Breaking change: [ ] Yes [x] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun fmt)
  • Changes tested locally

also i manually tested it to make sure that it failed as expected without this change and then passed as expected with the change.

Related Issues

Fixes #1157.

@35C4n0r
35C4n0r self-requested a review October 1, 2026 17:22

@35C4n0r 35C4n0r left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CODEX_HOME is a configuration variable; imho we should add a codex_home as a variable with "" (empty, so that we don't overwrite user's CODER_HOME) as the default, and a coder_env block which conditionally sets the CODEX_HOME env if var.codex_home != "".
@matifali @Edd88-pixel thoughts ?

@Edd88-pixel

Copy link
Copy Markdown
Collaborator

@35C4n0r A codex_home input would be useful for convenience, but I’d keep it as a follow-up. CODEX_HOME can already be set through coder_agent.env or a separate coder_env; this PR fixes the module ignoring it

@Edd88-pixel

Copy link
Copy Markdown
Collaborator

@kdcokenny Have you tested this end-to-end with the Codex CLI to confirm it ?

@kdcokenny

Copy link
Copy Markdown
Author

@kdcokenny Have you tested this end-to-end with the Codex CLI to confirm it ?

yep!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: codex module ignores CODEX_HOME when writing configuration

3 participants