feat(codex): resolve auth path via CODEX_HOME and host env API#90
Merged
Conversation
Expose
|
Contributor
There was a problem hiding this comment.
1 issue found across 5 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="src-tauri/src/plugin_engine/host_api.rs">
<violation number="1" location="src-tauri/src/plugin_engine/host_api.rs:222">
P1: This implementation exposes all environment variables to the plugin, including potentially sensitive secrets (like `AWS_ACCESS_KEY_ID`, `SSH_AUTH_SOCK`, or generic API keys) that the plugin does not need.
Restrict access to an allowlist (e.g., `["CODEX_HOME"]`) or a safe namespace (e.g., `OPENUSAGE_*`).</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
robinebers
approved these changes
Feb 7, 2026
Owner
|
Awesome, thank you @igalarzab! |
Contributor
Author
|
thank you for open sourcing this app! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OpenUsage is not respecting the value of
$CODEX_HOME[1], so if the config is not in~/.codexis not able to read it.This PR allows OpenUsage to read
$CODEX_HOME, and if defined, uses it. Otherwise it fallsback to~/.config/codexand~/.codexThis should be backward compatible for everyone
[1] https://developers.openai.com/codex/config-advanced/#config-and-state-locations
What changed
host.env.get(name)to the plugin host API (src-tauri/src/plugin_engine/host_api.rs).plugins/codex/plugin.js):CODEX_HOMEis set: use${CODEX_HOME}/auth.json.~/.config/codex/auth.json, then~/.codex/auth.json.docs/plugins/api.md).plugins/codex/plugin.test.js).plugins/test-helpers.js).env.getexposure (src-tauri/src/plugin_engine/host_api.rs).Summary by cubic
Respect CODEX_HOME for Codex auth and add a safe env API for plugins. If CODEX_HOME is set, use ${CODEX_HOME}/auth.json with no fallback; otherwise use the first existing auth file in ~/.config/codex or ~/.codex and write refreshes back to that path.
Written for commit 1092716. Summary will update on new commits.