auto-sync: 2026-06-06 11:26:44

This commit is contained in:
cfdaily
2026-06-06 11:26:44 +08:00
parent 72e5de9396
commit ea89d568d0
4 changed files with 607 additions and 4 deletions
+3 -1
View File
@@ -158,7 +158,9 @@ async def _generate_title(description: str) -> str | None:
base_url = "https://open.bigmodel.cn/api/paas/v4"
api_key = ""
model = "glm-4-flash"
oc_cfg = Path.home() / ".openclaw" / "openclaw.json"
oc_cfg = Path(os.environ.get(
"OPENCLAW_HOME", str(Path.home() / ".openclaw")
)) / "openclaw.json"
if oc_cfg.exists():
with open(oc_cfg) as f:
cfg = _json.load(f)
+5 -1
View File
@@ -3,6 +3,7 @@
from __future__ import annotations
import logging
import os
import sqlite3
from datetime import datetime
from pathlib import Path
@@ -261,7 +262,10 @@ class ProjectRegistry:
def discover_sanguo_projects(self, scan_dir: Optional[Path] = None) -> List[str]:
"""扫描 sanguo_projects 开发目录,自动注册正式项目"""
scan_dir = scan_dir or Path.home() / ".openclaw" / "sanguo_projects"
scan_dir = scan_dir or Path(os.environ.get(
"SANGUO_PROJECTS_DIR",
str(Path.home() / ".openclaw" / "sanguo_projects")
))
discovered = []
if not scan_dir.exists():
+7 -2
View File
@@ -9,6 +9,7 @@ from __future__ import annotations
import asyncio
import json
import logging
import os
import uuid
from datetime import datetime
from pathlib import Path
@@ -1165,7 +1166,9 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_
@staticmethod
def _revive_session(agent_id: str) -> bool:
"""假死复活术:修改 sessions.json status 从 running 改为 idle"""
sessions_path = Path.home() / ".openclaw" / "agents" / agent_id / "sessions" / "sessions.json"
sessions_path = Path(os.environ.get(
"OPENCLAW_HOME", str(Path.home() / ".openclaw")
)) / "agents" / agent_id / "sessions" / "sessions.json"
if not sessions_path.exists():
return False
try:
@@ -1249,7 +1252,9 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_
替代失效的 compactionCheckpoints 检测。
"""
result = {"status": "unknown", "lock_pid": None, "lock_pid_alive": False, "recent_compact": False}
sessions_path = Path.home() / ".openclaw" / "agents" / agent_id / "sessions" / "sessions.json"
sessions_path = Path(os.environ.get(
"OPENCLAW_HOME", str(Path.home() / ".openclaw")
)) / "agents" / agent_id / "sessions" / "sessions.json"
if not sessions_path.exists():
return result
try: