Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

refactor: 密钥文件路径改用 get_user_workspace_dir 解析

linghb7ccac25e6081
diff --git a/jiuwenswarm/agents/harness/common/tools/web_file_download.py b/jiuwenswarm/agents/harness/common/tools/web_file_download.py
index 061e4cbb89..bb37ab15e0 100644
--- a/jiuwenswarm/agents/harness/common/tools/web_file_download.py
+++ b/jiuwenswarm/agents/harness/common/tools/web_file_download.py
@@ -24,6 +24,8 @@ import time
from pathlib import Path
from typing import Any
+from jiuwenswarm.common.utils import get_user_workspace_dir
+
logger = logging.getLogger(__name__)
_DEFAULT_EXPIRES_SECONDS = 600
@@ -35,7 +37,7 @@ def _get_secret_file_path() -> Path:
workspace = os.getenv("JIUWENSWARM_WORKSPACE")
if workspace:
return Path(workspace) / "config" / _SECRET_FILE_NAME
- return Path.home() / ".jiuwenswarm" / "config" / _SECRET_FILE_NAME
+ return get_user_workspace_dir() / "config" / _SECRET_FILE_NAME
def _load_or_create_secret() -> str: