Skip to content

fix: respect env vars for client config paths and add Codex local scope#7

Merged
jrandolf merged 1 commit intomainfrom
fix/env-vars-and-codex-local
Mar 11, 2026
Merged

fix: respect env vars for client config paths and add Codex local scope#7
jrandolf merged 1 commit intomainfrom
fix/env-vars-and-codex-local

Conversation

@jrandolf
Copy link
Collaborator

Summary

  • Claude Code (#1): Check CLAUDE_CONFIG_DIR env var before defaulting to ~/.claude.json
  • VS Code (#1): Check XDG_CONFIG_HOME on Linux before defaulting to ~/.config for the settings path
  • Codex (#2): Enable --local flag support with trust-level validation — reads projects.<cwd>.trust_level from the global config.toml and returns an informative error (with setup instructions) if the project is not marked "trusted"

Closes #1, Closes #2

Test plan

  • TestClaudeCodeConfigPath_WithEnvVar — verifies CLAUDE_CONFIG_DIR is used
  • TestClaudeCodeConfigPath_WithoutEnvVar — verifies fallback to ~/.claude.json
  • TestVSCodeConfigPath_WithXDGEnvVar — verifies XDG_CONFIG_HOME used on Linux
  • TestVSCodeConfigPath_WithoutXDGEnvVar — verifies fallback on Linux
  • TestReadCodexProjectTrustLevel_* — 5 cases covering trusted, untrusted, missing project, no config, multiple projects
  • TestCodexLocalPath_Trusted — happy path returns .codex/config.toml
  • TestCodexLocalPath_Untrusted — error when project not trusted
  • TestCodexLocalPath_NoConfigFile — error when config absent
  • All existing tests pass

🤖 Generated with Claude Code

…pe support

- Claude Code: check CLAUDE_CONFIG_DIR before defaulting to ~/.claude.json
- VS Code: check XDG_CONFIG_HOME on Linux before defaulting to ~/.config
- Codex: enable local config (SupportsLocal=true) with trust-level validation;
  reads projects.<cwd>.trust_level from global config.toml and returns an
  informative error if the project is not trusted

Closes #1, #2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jrandolf jrandolf merged commit 20fd958 into main Mar 11, 2026
1 check passed
@jrandolf jrandolf deleted the fix/env-vars-and-codex-local branch March 11, 2026 04:30
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.

Please support project scope configuration for OpenAI Codex. Please respect environment variables for clients.

1 participant