fix: drop explicit OH_PERSISTENCE_DIR from dev-docker.mjs, use derived default#329
Closed
xingyaoww wants to merge 1 commit into
Closed
fix: drop explicit OH_PERSISTENCE_DIR from dev-docker.mjs, use derived default#329xingyaoww wants to merge 1 commit into
xingyaoww wants to merge 1 commit into
Conversation
…d default OH_PERSISTENCE_DIR was set to /home/openhands/.openhands in the Docker containerEnv, but the agent-server already derives a suitable persistence directory from conversations_path.parent / '.openhands' when the env var is absent. Since OH_CONVERSATIONS_PATH points at /home/openhands/.openhands/agent-canvas/conversations, the derived default resolves to /home/openhands/.openhands/agent-canvas/.openhands — still on the mounted volume, so settings and secrets persist across container restarts. This also brings dev-docker.mjs in line with buildAgentServerEnv() in dev-safe.mjs, which never set OH_PERSISTENCE_DIR. Co-authored-by: openhands <openhands@all-hands.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Problem
dev-docker.mjsexplicitly setsOH_PERSISTENCE_DIR=/home/openhands/.openhandsin the container environment, but:The agent-server already derives a suitable default — when
OH_PERSISTENCE_DIRis unset,_get_persistence_dir()in the SDK falls back toconfig.conversations_path.parent / ".openhands". SinceOH_CONVERSATIONS_PATHis set to/home/openhands/.openhands/agent-canvas/conversations, the derived default resolves to/home/openhands/.openhands/agent-canvas/.openhands— still on the mounted~/.openhandsvolume, so settings and secrets persist across container restarts.buildAgentServerEnv()indev-safe.mjsnever setsOH_PERSISTENCE_DIR— the Docker path was the only place this env var was explicitly set, creating an inconsistency between Docker and non-Docker dev workflows.Fix
Remove
OH_PERSISTENCE_DIRfrom thecontainerEnvobject indev-docker.mjs, letting the agent-server use its derived default. This follows the same pattern as theTMUX_TMPDIRremoval in #325.Remaining
containerEnvvars (and why they stay)OH_CONVERSATIONS_PATH/agent-server/workspace/conversationsOH_BASH_EVENTS_DIROH_SECRET_KEYOH_SESSION_API_KEYS_0VITE_SESSION_API_KEYfor authThis PR was created by an AI agent (OpenHands) on behalf of the user.