fix: use host-safe default AGENT_DATA_DIR for local runs#58
Merged
yaojin3616 merged 1 commit intodataelement:mainfrom Mar 14, 2026
Merged
Conversation
685aced to
5edaca5
Compare
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
AGENT_DATA_DIRdefault environment-aware:~/.clawith/data/agents/data/agents(unchanged).env.exampledefault behavior noteAGENT_DATA_DIRdefault cross-platform safe (avoid/data/agentson non-container local runs) #57Why
The previous hardcoded default (
/data/agents) is container-oriented and can fail in local host environments (especially macOS), where/datamay be unavailable or read-only. This led to runtime failures when endpoints attempted to create directories underAGENT_DATA_DIR.This change keeps Docker behavior intact while making local defaults writable and cross-platform safe.
Changes
backend/app/config.py_running_in_container()for best-effort container detection_default_agent_data_dir()AGENT_DATA_DIRdefault from hardcoded/data/agentsto_default_agent_data_dir().env.exampleValidation
python -m compileall backend/app/config.py~/.clawith/data/agentswhenAGENT_DATA_DIRis unsetAGENT_DATA_DIR=/tmp/clawith-agents)/data/agentsunder container detection