Add harness environment variables to self-hosted worker with direct backend#72
Merged
liliwilson merged 1 commit intoMay 15, 2026
Conversation
2 tasks
liliwilson
added a commit
to warpdotdev/warp
that referenced
this pull request
May 17, 2026
## 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
stupidloud
pushed a commit
to stupidloud/warp-cn
that referenced
this pull request
May 21, 2026
## 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
lawsmd
pushed a commit
to lawsmd/cortex
that referenced
this pull request
May 22, 2026
…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
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.
Description
This PR sets the
CLAUDE_CONFIG_DIRandCODEX_HOMEenvironment variables for the self-hosted worker with direct backend to beworkspaceDir/.claudeandworkspaceDir/.codexrespectively on a per-task basis.Since we don't have filesystem isolation for the direct backend worker, we want to be able to set harness config on a per-task basis, and cannot rely on the default claude/codex config directories (otherwise, concurrent tasks would clobber each other, we wouldn't clean up their state when done, etc.).
The client-side support for these environment variables is implemented in warpdotdev/warp#10870.
Testing
Ran the
oz-localscript with my self-hosted direct backend worker, nuked my global claude config at~/.claude, and verified that the agent was able to run to completion anyways. Confirmed that the config files were written toworkspaceDir/.claude.