Skip to content

CODEX SUPPORT#504

Merged
svarlamov merged 2 commits intomainfrom
feat/add-codex-support
Feb 11, 2026
Merged

CODEX SUPPORT#504
svarlamov merged 2 commits intomainfrom
feat/add-codex-support

Conversation

@svarlamov
Copy link
Copy Markdown
Member

@svarlamov svarlamov commented Feb 11, 2026

To test, please use codex version >= npm i -g @openai/codex@0.99.0-alpha.24

Fixes #501


Open with Devin

@svarlamov svarlamov requested a review from acunniffe February 11, 2026 06:35
@git-ai-cloud
Copy link
Copy Markdown

git-ai-cloud Bot commented Feb 11, 2026

Stats powered by Git AI

🧠 you    ███████░░░░░░░░░░░░░  33%
🤖 ai     ░░░░░░░█████████████  67%
More stats
  • 1.5 lines generated for every 1 accepted
  • 0 seconds waiting for AI
  • Top model: claude::claude-opus-4-6 (2 accepted lines, 3 generated lines)

AI code tracked with git-ai

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@git-ai-cloud-dev
Copy link
Copy Markdown

Stats powered by Git AI

🧠 you    ███████░░░░░░░░░░░░░  33%
🤖 ai     ░░░░░░░█████████████  67%
More stats
  • 1.5 lines generated for every 1 accepted
  • 0 seconds waiting for AI
  • Top model: claude::claude-opus-4-6 (2 accepted lines, 3 generated lines)

AI code tracked with git-ai

@svarlamov svarlamov merged commit 3b8a34e into main Feb 11, 2026
14 checks passed
@svarlamov svarlamov deleted the feat/add-codex-support branch February 11, 2026 15:10
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 8 additional findings in Devin Review.

Open in Devin Review

Comment thread src/mdm/agents/codex.rs
Comment on lines +12 to +14
fn config_path() -> PathBuf {
home_dir().join(".codex").join("config.toml")
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 CodexInstaller::config_path() ignores CODEX_HOME, mismatching CodexPreset::codex_home_dir()

The CodexInstaller always resolves the Codex config to ~/.codex/config.toml via home_dir().join(".codex"), but CodexPreset::codex_home_dir() in src/commands/checkpoint_agent/agent_presets.rs:771-781 respects the CODEX_HOME environment variable. When a user sets CODEX_HOME to a non-default location (e.g. /opt/codex), the installer writes the notify hook to ~/.codex/config.toml, while Codex itself reads its config from $CODEX_HOME/config.toml. The hooks silently fail to activate.

Root Cause

CodexInstaller::config_path() at src/mdm/agents/codex.rs:12-13 is:

fn config_path() -> PathBuf {
    home_dir().join(".codex").join("config.toml")
}

But CodexPreset::codex_home_dir() at src/commands/checkpoint_agent/agent_presets.rs:771-781 is:

pub fn codex_home_dir() -> PathBuf {
    if let Ok(codex_home) = env::var("CODEX_HOME")
        && !codex_home.trim().is_empty()
    {
        return PathBuf::from(codex_home);
    }
    dirs::home_dir()
        .unwrap_or_else(|| PathBuf::from("~"))
        .join(".codex")
}

The check_hooks, install_hooks, and uninstall_hooks methods all use the hardcoded config_path(), so when CODEX_HOME is set, the installer reads/writes the wrong file. Install reports success but Codex never sees the hook.

Impact: Users who override CODEX_HOME will have hooks installed to the wrong location. install-hooks appears to succeed, but checkpoints never fire.

Suggested change
fn config_path() -> PathBuf {
home_dir().join(".codex").join("config.toml")
}
fn config_path() -> PathBuf {
let codex_home = if let Ok(codex_home) = std::env::var("CODEX_HOME")
&& !codex_home.trim().is_empty()
{
PathBuf::from(codex_home)
} else {
home_dir().join(".codex")
};
codex_home.join("config.toml")
}
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

Support for Codex

1 participant