Skip to content

[P3] Verify and document the policy for an empty CODEX_HOME #98

Closed

Description

@abruption

Priority: P3. Configuration-contract question requiring upstream compatibility verification before choosing a fix.

At v0.4.3 commit 543b661f64f65f65154e3322847be1756deb778e, defaultOptions selects process.env.CODEX_HOME with nullish coalescing and passes the value to resolve. A pure-function diagnostic confirmed that an explicitly empty value resolves to the current working directory. This differs from an unset value, which selects the home-directory default.

The downstream directory observation treats a missing lock directory inside an existing home as not_created, and listThreads maps that observation to an empty thread list. These source paths explain why choosing the effective home matters to absence diagnostics. However, this review did not run the CLI's absence or unlock behavior with an empty environment value, and did not determine Codex's own empty-value semantics. It therefore does not establish a wrong-home bug or a demonstrated false absence result.

First verify the supported Codex versions' handling of an explicitly empty CODEX_HOME, using authoritative source or a bounded configuration diagnostic without opening user sessions or changing native lock files. Then define the intended codex-unlock contract. Matching upstream behavior or deliberately rejecting an empty value are possible policies, but a rejection must be documented as an explicit choice. Do not silently substitute the usual home-directory default for an empty string.

Acceptance criteria:

  • Record the upstream evidence and supported-version scope, distinguishing unset, empty, relative, and absolute environment values.
  • Document the chosen empty-value policy and its interaction with an explicit CLI home option. Keep relative-path behavior deliberate and reviewable.
  • Add bounded configuration tests with temporary directories for unset and empty values, and option precedence. Test CLI output and exit status only after selecting the contract.
  • If rejecting empty values, produce a clear configuration/usage error and document that deliberate policy. Do not emit a successful absence result for a rejected configuration.
  • If retaining upstream-compatible resolution, test and document that behavior rather than labeling it a safety defect without supporting evidence.
  • Preserve fail-closed handling of unavailable or unsafe directories; use fixtures rather than existing native Codex files.

Related closed issue: #67. This concerns effective-home selection and does not assume its missing-home handling remains defective.

Activity

  1. added
    question
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions