Validate CODEX_HOME before resolving (#10249)

Summary
- require `CODEX_HOME` to point to an existing directory before
canonicalizing and surface clear errors otherwise
- share the same helper logic in both `core` and `rmcp-client` and add
unit tests that cover missing, non-directory, valid, and default paths

This addresses #9222
This commit is contained in:
Eric Traut authored and GitHub committed 2026-01-30 15:46:33 -08:00
1 parent 13e85b1549
commit 8d142fd63d
11 files changed
+168 -58

No files matched your search

+11 -2
View File
@@ -1400,6 +1400,7 @@ dependencies = [
"codex-state",
"codex-utils-absolute-path",
"codex-utils-cargo-bin",
"codex-utils-home-dir",
"codex-utils-pty",
"codex-utils-readiness",
"codex-utils-string",
@@ -1407,7 +1408,6 @@ dependencies = [
"core-foundation 0.9.4",
"core_test_support",
"ctor 0.6.3",
"dirs",
"dunce",
"encoding_rs",
"env-flags",
@@ -1842,7 +1842,7 @@ dependencies = [
"codex-keyring-store",
"codex-protocol",
"codex-utils-cargo-bin",
"dirs",
"codex-utils-home-dir",
"futures",
"keyring",
"mcp-types",
@@ -2007,6 +2007,15 @@ dependencies = [
"thiserror 2.0.17",
]
[[package]]
name = "codex-utils-home-dir"
version = "0.0.0"
dependencies = [
"dirs",
"pretty_assertions",
"tempfile",
]
[[package]]
name = "codex-utils-image"
version = "0.0.0"