Respect CODEX_HOME and CLAUDE_CONFIG_DIR for writing config.#10870
Conversation
6f66619 to
2c20695
Compare
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR updates the Claude and Codex harness setup to honor CLAUDE_CONFIG_DIR and CODEX_HOME when seeding config files, with tests covering the new config locations.
Concerns
- No blocking concerns found.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| return Ok(PathBuf::from(home_dir)); | ||
| // This function is used specifically for determining where to land `.claude.json`. | ||
| fn claude_global_config_path() -> Result<PathBuf> { | ||
| if let Ok(dir) = std::env::var("CLAUDE_CONFIG_DIR") { |
There was a problem hiding this comment.
Oh interesting, I thought .claude.json didn’t respect the env vars, only the directory did
There was a problem hiding this comment.
Yeah, I originally did too... I did test this though and fortunately it does respect the env var
2c20695 to
28d36f0
Compare
c9d5533 to
5706061
Compare
5706061 to
8803a2c
Compare
…dev#10870) ## Description <!-- Please remember to add your design buddy onto the PR for review, if it contains any UI changes! --> Update the implementations for claude and codex harnesses to consistently respect the environment variables `CLAUDE_CONFIG_DIR` and `CODEX_HOME` respectively. While `.claude.json` gets written to `~` (not `~/.claude`) when the `CLAUDE_CONFIG_DIR` is unset, we need to make sure that we set it to `CLAUDE_CONFIG_DIR/.claude.json` when the environment variable is set. This is important for the self-hosted worker direct backend, to make sure that we can seed per-task config in worker-scoped repos. Associated `oz-agent-worker` PR: warpdotdev/oz-agent-worker#72 ## Testing <!-- How did you test this change? What automated tests did you add? If you didn't add any new tests, what's your justification for not adding any? Manual testing is required for changes that can be manually tested, and almost all changes can be manually tested. If your change can be manually tested, please include screenshots or a screen recording that show it working end to end. You can run the app locally using `./script/run` - see WARP.md for more details on how to get set up. --> Ran with `./script/oz-local` and passed in `-e CODEX_HOME` and `-e CLAUDE_CONFIG_DIR`. Nuked my local `~/.claude` and `~/.codex` directories and then confirmed agents could run to completion and seed the correct config files. Also ran without setting the env vars and confirmed that we run to completion. - [x] I have manually tested my changes locally with `./script/run` ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
Description
Update the implementations for claude and codex harnesses to consistently respect the environment variables
CLAUDE_CONFIG_DIRandCODEX_HOMErespectively.While
.claude.jsongets written to~(not~/.claude) when theCLAUDE_CONFIG_DIRis unset, we need to make sure that we set it toCLAUDE_CONFIG_DIR/.claude.jsonwhen the environment variable is set.This is important for the self-hosted worker direct backend, to make sure that we can seed per-task config in worker-scoped repos. Associated
oz-agent-workerPR: warpdotdev/oz-agent-worker#72Testing
Ran with
./script/oz-localand passed in-e CODEX_HOMEand-e CLAUDE_CONFIG_DIR. Nuked my local~/.claudeand~/.codexdirectories and then confirmed agents could run to completion and seed the correct config files.Also ran without setting the env vars and confirmed that we run to completion.
./script/runAgent Mode