Skip to content

Commit 7875950

Browse files
LuneZ99claudeopenhands-agentxingyaoww
authored
fix: use user-specific cache directory for Jinja2 templates (#1200)
Co-authored-by: Claude <[email protected]> Co-authored-by: openhands <[email protected]> Co-authored-by: Xingyao Wang <[email protected]>
1 parent aebb9db commit 7875950

File tree

1 file changed

+3
-1
lines changed
  • openhands-sdk/openhands/sdk/context/prompts

1 file changed

+3
-1
lines changed

openhands-sdk/openhands/sdk/context/prompts/prompt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def _get_env(prompt_dir: str) -> Environment:
2121
if not prompt_dir:
2222
raise ValueError("prompt_dir is required")
2323
# BytecodeCache avoids reparsing templates across processes
24-
cache_folder = os.path.join(prompt_dir, ".jinja_cache")
24+
# Use user-specific cache directory to avoid permission issues
25+
# in multi-user environments
26+
cache_folder = os.path.join(os.path.expanduser("~"), ".openhands", "cache", "jinja")
2527
os.makedirs(cache_folder, exist_ok=True)
2628
bcc = FileSystemBytecodeCache(directory=cache_folder)
2729
env = Environment(

0 commit comments

Comments
 (0)